Skip to content

Commit

Permalink
openbabel2: fix C++ standard, fix opportunistic usage of wxWidgets
Browse files Browse the repository at this point in the history
  • Loading branch information
barracuda156 committed Dec 7, 2024
1 parent 0e36bca commit 5aedc32
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 2 deletions.
11 changes: 9 additions & 2 deletions science/openbabel2/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 \
Expand Down
32 changes: 32 additions & 0 deletions science/openbabel2/files/patch-fix-wxWidgets-search.diff
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 5aedc32

Please sign in to comment.