diff options
-rw-r--r-- | sci-chemistry/openbabel/files/openbabel-2.4.1-gcc10.patch | 62 | ||||
-rw-r--r-- | sci-chemistry/openbabel/openbabel-2.4.1-r2.ebuild | 101 |
2 files changed, 163 insertions, 0 deletions
diff --git a/sci-chemistry/openbabel/files/openbabel-2.4.1-gcc10.patch b/sci-chemistry/openbabel/files/openbabel-2.4.1-gcc10.patch new file mode 100644 index 000000000000..88d8c2add64a --- /dev/null +++ b/sci-chemistry/openbabel/files/openbabel-2.4.1-gcc10.patch @@ -0,0 +1,62 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2e66dd1..ef4f16b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,16 +1,11 @@ + # Please ensure that any changes remain compliant with 2.4.8. + if(NOT EMBED_OPENBABEL) +- cmake_minimum_required(VERSION 2.4.8) ++ cmake_minimum_required(VERSION 2.4.10) + endif() + + project(openbabel) + set(CMAKE_MODULE_PATH ${openbabel_SOURCE_DIR}/cmake/modules) + +-# Allow loose loop constructs, i.e. no matching in if/else/endif or loops. +-# Note that this is true by default in CMake 2.6.0, but we currently only +-# require CMake 2.4.8 - remove this when the CMake requirement is bumped. +-set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS 1) +- + if(COMMAND cmake_policy) + cmake_policy(SET CMP0003 NEW) + cmake_policy(SET CMP0005 OLD) # add_definitions need updating to set to NEW +@@ -20,7 +15,6 @@ if(COMMAND cmake_policy) + endif() + + include (CheckCXXCompilerFlag) +-include (MacroEnsureVersion) + + # Version numbering - should be bumped for each release + # Note that for "beta" releases, we should start at x.90.0 -- we've +@@ -238,16 +232,21 @@ check_type_size(clock_t CLOCK_T) + + # Get the GCC version - from KDE4 cmake files + if(CMAKE_COMPILER_IS_GNUCXX) +- exec_program(${CMAKE_C_COMPILER} ARGS --version OUTPUT_VARIABLE _gcc_version_info) +- string(REGEX MATCH "[345]\\.[0-9]\\.[0-9]" _gcc_version "${_gcc_version_info}") +- # gcc on mac just reports: "gcc (GCC) 3.3 20030304 ..." without the +- # patch level, handle this here: +- if (NOT _gcc_version) +- string (REGEX REPLACE ".*\\(GCC\\).* ([34]\\.[0-9]) .*" "\\1.0" _gcc_version "${_gcc_version_info}") +- endif () +- macro_ensure_version("4.0.0" "${_gcc_version}" GCC_IS_NEWER_THAN_4_0) +- macro_ensure_version("4.1.0" "${_gcc_version}" GCC_IS_NEWER_THAN_4_1) +- macro_ensure_version("4.2.0" "${_gcc_version}" GCC_IS_NEWER_THAN_4_2) ++ if(NOT(${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 4.0.0)) ++ set(GCC_IS_NEWER_THAN_4_0 TRUE) ++ else() ++ set(GCC_IS_NEWER_THAN_4_0 FALSE) ++ endif() ++ if(NOT(${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 4.1.0)) ++ set(GCC_IS_NEWER_THAN_4_1 TRUE) ++ else() ++ set(GCC_IS_NEWER_THAN_4_1 FALSE) ++ endif() ++ if(NOT(${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 4.2.0)) ++ set(GCC_IS_NEWER_THAN_4_2 TRUE) ++ else() ++ set(GCC_IS_NEWER_THAN_4_2 FALSE) ++ endif() + endif() + + if(UNIX) diff --git a/sci-chemistry/openbabel/openbabel-2.4.1-r2.ebuild b/sci-chemistry/openbabel/openbabel-2.4.1-r2.ebuild new file mode 100644 index 000000000000..8830108275bd --- /dev/null +++ b/sci-chemistry/openbabel/openbabel-2.4.1-r2.ebuild @@ -0,0 +1,101 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +WX_GTK_VER="3.0-gtk3" + +inherit cmake-utils desktop optfeature toolchain-funcs wxwidgets + +DESCRIPTION="Interconverts file formats used in molecular modeling" +HOMEPAGE="http://openbabel.org/wiki/Main_Page" +SRC_URI=" + mirror://sourceforge/openbabel/${P}.tar.gz + https://openbabel.org/docs/dev/_static/babel130.png -> ${PN}.png +" + +# See src/CMakeLists.txt for LIBRARY_VERSION +SLOT="0/5.0.0" +LICENSE="GPL-2" +KEYWORDS="~amd64 ~arm ~x86 ~amd64-linux ~x86-linux ~ppc-macos" +IUSE="doc openmp test wxwidgets" +RESTRICT="!test? ( test )" + +RDEPEND=" + dev-cpp/eigen:3 + dev-libs/libxml2:2 + sci-libs/inchi + sys-libs/zlib + wxwidgets? ( x11-libs/wxGTK:${WX_GTK_VER}[X] ) +" +DEPEND="${RDEPEND}" +BDEPEND=" + >=dev-util/cmake-2.4.10 + doc? ( app-doc/doxygen ) +" + +DOCS=( AUTHORS NEWS.md README.md THANKS doc/dioxin.{inc,mol2} doc/README.{dioxin.pov,povray} ) + +PATCHES=( + "${FILESDIR}"/${P}-gcc10.patch +) + +pkg_setup() { + if use openmp; then + if [[ $(tc-getCC) == *gcc ]] && ! tc-has-openmp; then + ewarn "OpenMP is not available in your current selected gcc" + die "need openmp capable gcc" + fi + FORTRAN_NEED_OPENMP=1 + fi +} + +src_prepare() { + sed \ + -e '/__GNUC__/s:== 4:>= 4:g' \ + -i include/openbabel/shared_ptr.h || die + cmake-utils_src_prepare +} + +src_configure() { + use wxwidgets && setup-wxwidgets + local mycmakeargs=( + -DOPENBABEL_USE_SYSTEM_INCHI=ON + -DENABLE_OPENMP=$(usex openmp) + -DBUILD_GUI=$(usex wxwidgets) + ) + + cmake-utils_src_configure +} + +src_install() { + docinto html + dodoc doc/{*.html,*.png} + if use doc ; then + docinto html/API + dodoc -r doc/API/html/* + fi + + make_desktop_entry obgui "Open Babel" "${PN}" + doicon "${DISTDIR}/${PN}.png" + + cmake-utils_src_install +} + +src_test() { + local mycmakeargs=( + -DOPENBABEL_USE_SYSTEM_INCHI=ON + -DPYTHON_EXECUTABLE=false + -DOPENMP=$(usex openmp) + -DBUILD_GUI=$(usex wxwidgets) + -DTESTS=$(usex test) + ) + + cmake-utils_src_configure + cmake-utils_src_compile + cmake-utils_src_test -E py +} + +pkg_postinst() { + optfeature "perl support" sci-chemistry/openbabel-perl + optfeature "python support" sci-chemistry/openbabel-python +} |