Date: Friday, November 29, 2019 @ 13:53:59 Author: arojas Revision: 369909
Use system maeparser, switch to gtk3 Added: openbabel/trunk/system-maeparser.patch Modified: openbabel/trunk/PKGBUILD ------------------------+ PKGBUILD | 20 ++- system-maeparser.patch | 280 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 293 insertions(+), 7 deletions(-) Modified: PKGBUILD =================================================================== --- PKGBUILD 2019-11-29 13:37:49 UTC (rev 369908) +++ PKGBUILD 2019-11-29 13:53:59 UTC (rev 369909) @@ -1,20 +1,26 @@ -# Maintainer: Andrea Scarpino <[email protected]> +# Maintainer: +# Contributor: Andrea Scarpino <[email protected]> # Contributor: Damir Perisa <[email protected]> pkgbase=openbabel pkgname=(openbabel python-openbabel) pkgver=3.0.0 -pkgrel=2 +pkgrel=3 pkgdesc="A library designed to interconvert between many file formats used in molecular modeling and computational chemistry" arch=('x86_64') url="https://openbabel.org/wiki/Main_Page" license=('GPL') -makedepends=('cmake' 'eigen' 'wxgtk' 'boost' 'python' 'swig') -source=("https://github.com/openbabel/openbabel/releases/download/openbabel-${pkgver//./-}/openbabel-$pkgver-source.tar.bz2") -sha256sums=('aad58ef8deaea9f58faeecb333f87bb18e0bdf4854e3a3b188a814a8c4517259') +makedepends=('cmake' 'eigen' 'wxgtk3' 'boost' 'python' 'swig' 'maeparser' 'rapidjson') +source=("https://github.com/openbabel/openbabel/releases/download/openbabel-${pkgver//./-}/openbabel-$pkgver-source.tar.bz2" + system-maeparser.patch::"https://github.com/openbabel/openbabel/commit/8500f8a9.patch") +sha256sums=('aad58ef8deaea9f58faeecb333f87bb18e0bdf4854e3a3b188a814a8c4517259' + '14d2b019dfb3e4d6d1b8a529e5da8c2ec84b1e599b9ae74913f8548542d0ab4b') prepare() { mkdir -p build + + cd $pkgbase-$pkgver + patch -p1 -i ../system-maeparser.patch # Unbundle maeparser } build() { @@ -21,7 +27,7 @@ cd build cmake ../openbabel-$pkgver \ -DCMAKE_INSTALL_PREFIX=/usr \ - -DwxWidgets_CONFIG_EXECUTABLE=/usr/bin/wx-config \ + -DwxWidgets_CONFIG_EXECUTABLE=/usr/bin/wx-config-gtk3 \ -DRUN_SWIG=ON \ -DPYTHON_BINDINGS=ON make @@ -32,7 +38,7 @@ package_openbabel() { depends=('libxml2' 'libsm') - optdepends=('wxgtk: GUI interface') + optdepends=('wxgtk3: GUI interface' 'maeparser: maestro format support') cd build make DESTDIR="$pkgdir" install Added: system-maeparser.patch =================================================================== --- system-maeparser.patch (rev 0) +++ system-maeparser.patch 2019-11-29 13:53:59 UTC (rev 369909) @@ -0,0 +1,280 @@ +From e259b6737787d2545f45b63c90f0f27a40e0179f Mon Sep 17 00:00:00 2001 +From: Ricardo R-S <[email protected]> +Date: Wed, 16 Oct 2019 15:57:46 -0400 +Subject: [PATCH 1/7] add Find modules for maeparser and coordgen + +--- + cmake/modules/Findcoordgen.cmake | 46 +++++++++++++++++++++++++++++++ + cmake/modules/Findmaeparser.cmake | 32 +++++++++++++++++++++ + 2 files changed, 78 insertions(+) + create mode 100644 cmake/modules/Findcoordgen.cmake + create mode 100644 cmake/modules/Findmaeparser.cmake + +diff --git a/cmake/modules/Findmaeparser.cmake b/cmake/modules/Findmaeparser.cmake +new file mode 100644 +index 000000000..920b3ec8e +--- /dev/null ++++ b/cmake/modules/Findmaeparser.cmake +@@ -0,0 +1,32 @@ ++# Try to find Schrodinger's MAEParser libraries. ++# ++# Different version handling is not yet supported ++# ++# Once found, this will find and define the following variables: ++# ++# maeparser_INCLUDE_DIRS - maeparser's includes directory ++# maeparser_LIBRARIES - maeparser's shared libraries ++# ++# ++ ++include(FindPackageHandleStandardArgs) ++ ++find_path(maeparser_INCLUDE_DIRS ++ NAMES "maeparser/Reader.hpp" ++ HINTS ${maeparser_DIR} ++ PATH_SUFFIXES "include" ++ DOC "include path for maeparser" ++) ++message(STATUS "maeparser include dir set as '${maeparser_INCLUDE_DIRS}'") ++ ++find_library(maeparser_LIBRARIES ++ NAMES maeparser ++ HINTS ${maeparser_DIR} ++ PATH_SUFFIXES "lib" ++ DOC "libraries for maeparser" ++) ++message(STATUS "maeparser libraries set as '${maeparser_LIBRARIES}'") ++ ++find_package_handle_standard_args(maeparser FOUND_VAR maeparser_FOUND ++ REQUIRED_VARS maeparser_INCLUDE_DIRS ++ maeparser_LIBRARIES) + +From c4c6ef37d91c8b27e0b8af9f2e4772332caa7cf1 Mon Sep 17 00:00:00 2001 +From: Ricardo R-S <[email protected]> +Date: Wed, 16 Oct 2019 15:59:18 -0400 +Subject: [PATCH 2/7] update CMakelists + +--- + CMakeLists.txt | 124 ++++++++++++++++++++++++++++++++++++++++++------- + 1 file changed, 108 insertions(+), 16 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e8396dd17..26edc9433 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -482,33 +482,65 @@ find_package(Boost) + if(Boost_FOUND AND BUILD_SHARED) + include_directories(${Boost_INCLUDE_DIRS} ${Boost_INCLUDE_DIR}) + option(WITH_MAEPARSER "Build Maestro support" ON) + else() + option(WITH_MAEPARSER "Build Maestro support" OFF) + endif() + +- + if(WITH_MAEPARSER) +- set (CMAKE_CXX_STANDARD 11) +- +- set(MAEPARSER_VERSION 1.1) +- if(NOT EXISTS "${openbabel_SOURCE_DIR}/external/maeparser-${MAEPARSER_VERSION}") +- file(DOWNLOAD "https://github.com/schrodinger/maeparser/archive/v${MAEPARSER_VERSION}.tar.gz" +- "${openbabel_SOURCE_DIR}/external/maeparser-${MAEPARSER_VERSION}.tar.gz" STATUS status) +- execute_process(COMMAND ${CMAKE_COMMAND} -E tar zxf +- ${openbabel_SOURCE_DIR}/external/maeparser-${MAEPARSER_VERSION}.tar.gz +- WORKING_DIRECTORY ${openbabel_SOURCE_DIR}/external) +- message(STATUS "Downloaded MaeParser to ${openbabel_SOURCE_DIR}/external/maeparser-${MAEPARSER_VERSION}.") ++ ++ find_package(maeparser MODULE QUIET) ++ ++ if (maeparser_FOUND) ++ ++ message(STATUS "Maestro formats will be supported. Using MaeParser libraries at ${maeparser_LIBRARIES}.") ++ ++ else() ++ ++ set(MAEPARSER_VERSION "master") ++ ++ set(MAEPARSER_DIR "${openbabel_SOURCE_DIR}/external/maeparser-${MAEPARSER_VERSION}") ++ ++ # Do not build the test, as it will be put into the bin dir, where it won't be found by the test runner. ++ set(MAEPARSER_BUILD_TESTS OFF CACHE BOOL "Disable Maeparser tests") ++ ++ if(EXISTS "${MAEPARSER_DIR}/maeparser/CMakeLists.txt") ++ ++ message(STATUS "Building existing MaeParser '${MAEPARSER_VERSION}' source at ${MAEPARSER_DIR}.") ++ ++ else() ++ ++ file(DOWNLOAD "https://github.com/schrodinger/maeparser/archive/${MAEPARSER_VERSION}.tar.gz" ++ "${MAEPARSER_DIR}/maeparser-${MAEPARSER_VERSION}.tar.gz") ++ ++ execute_process(COMMAND ${CMAKE_COMMAND} -E tar zxf "maeparser-${MAEPARSER_VERSION}.tar.gz" ++ WORKING_DIRECTORY "${MAEPARSER_DIR}") ++ ++ file(RENAME "${MAEPARSER_DIR}/maeparser-${MAEPARSER_VERSION}" "${MAEPARSER_DIR}/maeparser") ++ ++ if(EXISTS "${MAEPARSER_DIR}/maeparser/CMakeLists.txt") ++ message(STATUS "Downloaded MaeParser '${MAEPARSER_VERSION}' to ${MAEPARSER_DIR}.") ++ else() ++ message(FATAL_ERROR "Failed getting or unpacking Maeparser '${MAEPARSER_VERSION}'.") ++ endif() ++ ++ endif() ++ ++ add_subdirectory("${MAEPARSER_DIR}/maeparser") ++ ++ set(maeparser_INCLUDE_DIRS "${MAEPARSER_DIR}") ++ set(maeparser_LIBRARIES maeparser) ++ ++ message(STATUS "Maestro formats will be supported. Using MaeParser '${MAEPARSER_VERSION}' at ${MAEPARSER_DIR}") ++ + endif() +- set(MAEPARSER_DIR ${openbabel_SOURCE_DIR}/external/maeparser-${MAEPARSER_VERSION}) +- add_subdirectory(${MAEPARSER_DIR}) +- include_directories(${MAEPARSER_DIR}) +- set(libs ${libs} maeparser) + +- message(STATUS "Maestro formats will be supported. Using MaeParser ${MAEPARSER_VERSION} at ${MAEPARSER_INCLUDE_DIRS}") ++ include_directories(${maeparser_INCLUDE_DIRS}) ++ set(libs ${libs} ${maeparser_LIBRARIES}) ++ + else() + message(STATUS "Maestro formats will NOT be supported. Please install Boost to enable Maestro formats.") + endif() + + option(WITH_JSON "Build JSON support" ON) + option(OPENBABEL_USE_SYSTEM_RAPIDJSON "Use the system rapidjson if available." ON) + if(WITH_JSON) + +From 3809081838b673a9ab45f3e6061dc1a525eba4f3 Mon Sep 17 00:00:00 2001 +From: Ricardo R-S <[email protected]> +Date: Wed, 16 Oct 2019 15:58:13 -0400 +Subject: [PATCH 3/7] update maeparser include paths to use the same as coorden + +--- + src/formats/maeformat.cpp | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/formats/maeformat.cpp b/src/formats/maeformat.cpp +index 795f8d746..9efb2560f 100644 +--- a/src/formats/maeformat.cpp ++++ b/src/formats/maeformat.cpp +@@ -29,9 +29,9 @@ GNU General Public License for more details. + #include <iostream> + #include <map> + +-#include <MaeConstants.hpp> +-#include <Reader.hpp> +-#include <Writer.hpp> ++#include <maeparser/MaeConstants.hpp> ++#include <maeparser/Reader.hpp> ++#include <maeparser/Writer.hpp> + + using namespace std; + using namespace schrodinger::mae; + +From 9e093701df695a9d0983298eac3e255e255aba56 Mon Sep 17 00:00:00 2001 +From: Ricardo R-S <[email protected]> +Date: Mon, 21 Oct 2019 08:29:20 -0400 +Subject: [PATCH 5/7] only use boost threads if not static build + +--- + src/CMakeLists.txt | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 7c83ca355..de81c33f2 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -3,7 +3,7 @@ set(SOVERSION 6) + set(LIBRARY_VERSION 6.0.0) + + +-find_package(Boost 1.45.0 COMPONENTS system) ++find_package(Boost 1.45.0 COMPONENTS system) + + + +@@ -248,8 +248,8 @@ add_library(openbabel ${BUILD_TYPE} + ) + + target_link_libraries(openbabel ${libs}) +-if(Boost_FOUND) +- include_directories(${Boost_INCLUDE_DIRS}) ++if(Boost_FOUND AND (BUILD_SHARED OR BUILD_MIXED)) ++ include_directories(${Boost_INCLUDE_DIRS}) + target_link_libraries(openbabel ${Boost_LIBRARIES} ) + find_package(Threads REQUIRED) + if(THREADS_HAVE_PTHREAD_ARG) + +From 9d79d1358cfce4cf977629ffb638fbf659fc6573 Mon Sep 17 00:00:00 2001 +From: Ricardo R-S <[email protected]> +Date: Mon, 11 Nov 2019 10:17:41 -0500 +Subject: [PATCH 6/7] set fixed versions; handle github dirs + +--- + CMakeLists.txt | 17 +++++++++++------ + 1 file changed, 11 insertions(+), 6 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 26edc9433..60a59576a 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -498,7 +498,7 @@ if(WITH_MAEPARSER) + + else() + +- set(MAEPARSER_VERSION "master") ++ set(MAEPARSER_VERSION "v1.2.2" CACHE STRING "Maeparser fallback version to download") + + set(MAEPARSER_DIR "${openbabel_SOURCE_DIR}/external/maeparser-${MAEPARSER_VERSION}") + +@@ -517,9 +517,13 @@ if(WITH_MAEPARSER) + execute_process(COMMAND ${CMAKE_COMMAND} -E tar zxf "maeparser-${MAEPARSER_VERSION}.tar.gz" + WORKING_DIRECTORY "${MAEPARSER_DIR}") + +- file(RENAME "${MAEPARSER_DIR}/maeparser-${MAEPARSER_VERSION}" "${MAEPARSER_DIR}/maeparser") ++ message(STATUS "${MAEPARSER_DIR}") + +- if(EXISTS "${MAEPARSER_DIR}/maeparser/CMakeLists.txt") ++ find_path(MAEPARSER_UNPACK_DIR "CMakeLists.txt" PATH "${MAEPARSER_DIR}/*" NO_DEFAULT_PATH) ++ message(STATUS ${MAEPARSER_UNPACK_DIR}) ++ ++ if(MAEPARSER_UNPACK_DIR) ++ file(RENAME "${MAEPARSER_UNPACK_DIR}" "${MAEPARSER_DIR}/maeparser") + message(STATUS "Downloaded MaeParser '${MAEPARSER_VERSION}' to ${MAEPARSER_DIR}.") + else() + message(FATAL_ERROR "Failed getting or unpacking Maeparser '${MAEPARSER_VERSION}'.") + +From a97306e9a32ee210701ae20d3073dd1d384dd68d Mon Sep 17 00:00:00 2001 +From: Ricardo R-S <[email protected]> +Date: Tue, 12 Nov 2019 14:30:58 -0500 +Subject: [PATCH 7/7] restore master as fallback; remove leftover debug msgs + +--- + CMakeLists.txt | 7 ++----- + 1 file changed, 2 insertions(+), 5 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 60a59576a..7d74d5ad4 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -498,7 +498,7 @@ if(WITH_MAEPARSER) + + else() + +- set(MAEPARSER_VERSION "v1.2.2" CACHE STRING "Maeparser fallback version to download") ++ set(MAEPARSER_VERSION "master" CACHE STRING "Maeparser fallback version to download") + + set(MAEPARSER_DIR "${openbabel_SOURCE_DIR}/external/maeparser-${MAEPARSER_VERSION}") + +@@ -517,10 +517,7 @@ if(WITH_MAEPARSER) + execute_process(COMMAND ${CMAKE_COMMAND} -E tar zxf "maeparser-${MAEPARSER_VERSION}.tar.gz" + WORKING_DIRECTORY "${MAEPARSER_DIR}") + +- message(STATUS "${MAEPARSER_DIR}") +- + find_path(MAEPARSER_UNPACK_DIR "CMakeLists.txt" PATH "${MAEPARSER_DIR}/*" NO_DEFAULT_PATH) +- message(STATUS ${MAEPARSER_UNPACK_DIR}) + + if(MAEPARSER_UNPACK_DIR) + file(RENAME "${MAEPARSER_UNPACK_DIR}" "${MAEPARSER_DIR}/maeparser")
