Skip to content

Commit

Permalink
mysql57: fix for powerpc
Browse files Browse the repository at this point in the history
  • Loading branch information
barracuda156 authored and reneeotten committed Sep 2, 2024
1 parent bc5c495 commit f8cb8e5
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 2 deletions.
15 changes: 13 additions & 2 deletions databases/mysql57/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ if {$subport eq $name} {
patch-lockpool.diff \
patch-cmake-fix-test-env.diff

platform darwin powerpc {
# These can be applied unconditionally, but unneeded outside of ppc.
patchfiles-append \
patch-powerpc.diff \
patch-NOTE_TRIGGER.diff
}

post-patch {
reinplace "s|@NAME@|${name_mysql}|g" \
${worksrcpath}/cmake/install_layout.cmake
Expand All @@ -94,7 +101,6 @@ if {$subport eq $name} {
${worksrcpath}/cmake/merge_archives.cmake.in
}


patchfiles-append \
patch-rename_version.diff
post-patch {
Expand Down Expand Up @@ -133,7 +139,12 @@ if {$subport eq $name} {
configure.cppflags-delete \
-I${prefix}/include

use_parallel_build yes
if {[string match *gcc* ${configure.compiler}]} {
configure.args-append \
-DFORCE_UNSUPPORTED_COMPILER=ON
configure.ldflags-append \
-latomic
}

select.group mysql
select.file ${filespath}/${name_mysql}
Expand Down
14 changes: 14 additions & 0 deletions databases/mysql57/files/patch-NOTE_TRIGGER.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
--- a/mysys/kqueue_timers.c 2023-10-11 19:42:50.000000000 +0800
+++ b/mysys/kqueue_timers.c 2024-09-02 16:18:37.000000000 +0800
@@ -150,7 +150,11 @@
{
struct kevent kev;

+#if defined(NOTE_TRIGGER)
EV_SET(&kev, 0, EVFILT_USER, 0, NOTE_TRIGGER, 0, 0);
+#elif defined(EV_TRIGGER)
+ EV_SET(&kev, 0, EVFILT_USER, EV_TRIGGER, 0, 0, 0);
+#endif

if (kevent(kq_fd, &kev, 1, NULL, 0, NULL) < 0)
my_message_local(ERROR_LEVEL,
27 changes: 27 additions & 0 deletions databases/mysql57/files/patch-powerpc.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
--- a/cmake/os/Darwin.cmake 2023-03-16 23:25:04.000000000 +0800
+++ b/cmake/os/Darwin.cmake 2023-05-18 10:00:33.000000000 +0800
@@ -47,5 +47,9 @@

# This is used for the version_compile_machine variable.
IF(CMAKE_SIZEOF_VOID_P MATCHES 8)
- SET(MYSQL_MACHINE_TYPE "x86_64")
+ IF(CMAKE_OSX_ARCHITECTURES MATCHES "ppc64")
+ SET(MYSQL_MACHINE_TYPE "ppc64")
+ ELSE()
+ SET(MYSQL_MACHINE_TYPE "x86_64")
+ ENDIF()
ENDIF()

--- a/rapid/plugin/x/CMakeLists.txt 2023-05-18 09:26:35.000000000 +0800
+++ b/rapid/plugin/x/CMakeLists.txt 2023-05-18 12:13:03.000000000 +0800
@@ -135,6 +135,10 @@
SET(BOOST_LIB_SOURCES
${BOOST_SOURCES_DIR}/libs/atomic/src/lockpool.cpp)
ENDIF()
+ IF(APPLE AND CMAKE_OSX_ARCHITECTURES MATCHES "ppc|ppc64")
+ SET(BOOST_LIB_SOURCES
+ ${BOOST_SOURCES_DIR}/libs/atomic/src/lockpool.cpp)
+ ENDIF()
IF (CMAKE_CXX_COMPILER_ID STREQUAL "SunPro")
SET(BOOST_LIB_SOURCES
${BOOST_SOURCES_DIR}/libs/atomic/src/lockpool.cpp)

0 comments on commit f8cb8e5

Please sign in to comment.