From 6c11a1c2e83cb42e4a8d712a3aecf2fbc05dfef7 Mon Sep 17 00:00:00 2001 From: Sergey Fedorov Date: Tue, 3 Dec 2024 09:58:35 +0800 Subject: [PATCH] plfit: fix running tests, fix build with gcc --- math/plfit/Portfile | 13 ++++++++++--- math/plfit/files/patch-fix-linking-gcc.diff | 11 +++++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 math/plfit/files/patch-fix-linking-gcc.diff diff --git a/math/plfit/Portfile b/math/plfit/Portfile index ddace16fd802a..2baf5b7beb85d 100644 --- a/math/plfit/Portfile +++ b/math/plfit/Portfile @@ -25,9 +25,16 @@ test.target test compiler.c_standard 1999 -configure.args-append -DBUILD_SHARED_LIBS=ON \ - -DPLFIT_ENABLE_LTO=AUTO \ - -DPLFIT_USE_OPENMP=OFF +configure.args-append -DBUILD_SHARED_LIBS=ON \ + -DPLFIT_ENABLE_LTO=AUTO \ + -DPLFIT_USE_OPENMP=OFF + +configure.pre_args-replace \ + -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON \ + -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF + +# ld: unknown option: --version-script=/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_plfit/plfit/work/plfit-1.0.0/src/plfit.map +patchfiles-append patch-fix-linking-gcc.diff variant openmp description {Enable OpenMP support} { configure.args-replace -DPLFIT_USE_OPENMP=OFF -DPLFIT_USE_OPENMP=ON diff --git a/math/plfit/files/patch-fix-linking-gcc.diff b/math/plfit/files/patch-fix-linking-gcc.diff new file mode 100644 index 0000000000000..49d331564cb38 --- /dev/null +++ b/math/plfit/files/patch-fix-linking-gcc.diff @@ -0,0 +1,11 @@ +--- src/CMakeLists.txt 2024-11-21 17:12:31.000000000 +0800 ++++ src/CMakeLists.txt 2024-12-03 09:42:09.000000000 +0800 +@@ -25,7 +25,7 @@ + target_link_libraries(plfit OpenMP::OpenMP_C) + endif() + +-if(CMAKE_C_COMPILER_ID STREQUAL "GNU") ++if(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT APPLE) + set_target_properties(plfit PROPERTIES LINK_FLAGS "-Wl,--version-script=${PROJECT_SOURCE_DIR}/src/plfit.map") + set_target_properties(plfit PROPERTIES LINK_DEPENDS ${PROJECT_SOURCE_DIR}/src/plfit.map) + endif()