From 5aedc3228a947f67c38d283e73f18b26a166a276 Mon Sep 17 00:00:00 2001 From: Sergey Fedorov Date: Sun, 8 Dec 2024 00:34:31 +0800 Subject: [PATCH] openbabel2: fix C++ standard, fix opportunistic usage of wxWidgets Closes: https://trac.macports.org/ticket/71480 --- science/openbabel2/Portfile | 11 +++++-- .../files/patch-fix-wxWidgets-search.diff | 32 +++++++++++++++++++ 2 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 science/openbabel2/files/patch-fix-wxWidgets-search.diff diff --git a/science/openbabel2/Portfile b/science/openbabel2/Portfile index 232abe179b8ad..3cf62e84b9653 100644 --- a/science/openbabel2/Portfile +++ b/science/openbabel2/Portfile @@ -8,7 +8,7 @@ github.setup openbabel openbabel 2-4-1 openbabel- name openbabel2 conflicts openbabel version [string map {- .} ${github.version}] -revision 0 +revision 1 categories science devel chemistry license GPL-2 @@ -31,13 +31,20 @@ checksums rmd160 0587a3d3dd24c485ff9a680ff83145f052b504f4 \ depends_build-append \ path:share/pkgconfig/eigen3.pc:eigen3 \ - port:pkgconfig + path:bin/pkg-config:pkgconfig depends_lib-append path:lib/pkgconfig/cairo.pc:cairo \ port:libiconv \ port:libxml2 \ port:zlib +# Build behaves incoherently, ignoring -DBUILD_GUI=OFF. +# https://trac.macports.org/ticket/71480 +patchfiles-append patch-fix-wxWidgets-search.diff + +# eigen3-devel needs C++14 though. +compiler.cxx_standard 2011 + configure.args-append \ -DBUILD_GUI=OFF \ -DBUILD_TESTING=OFF \ diff --git a/science/openbabel2/files/patch-fix-wxWidgets-search.diff b/science/openbabel2/files/patch-fix-wxWidgets-search.diff new file mode 100644 index 0000000000000..777d809e9fbc6 --- /dev/null +++ b/science/openbabel2/files/patch-fix-wxWidgets-search.diff @@ -0,0 +1,32 @@ +--- CMakeLists.txt 2016-10-10 23:56:17.000000000 +0800 ++++ CMakeLists.txt 2024-12-08 00:28:25.000000000 +0800 +@@ -178,15 +178,6 @@ + endif() + endif() + +-# wxWidgets instructions based on http://wiki.wxwidgets.org/CMake +-#find_package(wxWidgets COMPONENTS base core REQUIRED) +-find_package(wxWidgets COMPONENTS base core adv) +-if(wxWidgets_FOUND) +- include(${wxWidgets_USE_FILE}) +- add_definitions(-DHAVE_WXWIDGETS) +- include_directories(${wxWidgets_INCLUDE_DIRS}) +-endif() +- + if(MSVC) + # Ensure that CharacterSet="0" in the project files + add_definitions(-D_SBCS) # Single-Byte Character Set (requires CMake 2.8.8) +@@ -494,6 +485,13 @@ + + if(BUILD_GUI) + message(STATUS "Attempting to build the GUI") ++ # wxWidgets instructions based on http://wiki.wxwidgets.org/CMake ++ find_package(wxWidgets COMPONENTS base core adv) ++ if(wxWidgets_FOUND) ++ include(${wxWidgets_USE_FILE}) ++ add_definitions(-DHAVE_WXWIDGETS) ++ include_directories(${wxWidgets_INCLUDE_DIRS}) ++ endif() + if(wxWidgets_FOUND) + message(STATUS " wxWidgets found => GUI will be built") + add_subdirectory(src/GUI)