From 029f08b12ce1f3da2f3fd70e325b0c35ce1d9753 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A5=D0=B8=D1=80=D0=B5=D1=86=D0=BA=D0=B8=D0=B9=20=D0=9C?= =?UTF-8?q?=D0=B8=D1=85=D0=B0=D0=B8=D0=BB?= Date: Fri, 29 Nov 2019 17:52:22 +0300 Subject: [PATCH] sci-chemistry/openbabel: support gcc-9 * https://bugs.gentoo.org/664506 --- sci-chemistry/openbabel/Manifest | 1 + ...openbabel-2.3.2-gcc-6_and_7-backport.patch | 13 +++ .../files/openbabel-2.4.1-gcc-8_and_9.patch | 15 +++ .../openbabel/openbabel-2.4.1-r2.ebuild | 93 +++++++++++++++++++ 4 files changed, 122 insertions(+) create mode 100644 sci-chemistry/openbabel/Manifest create mode 100644 sci-chemistry/openbabel/files/openbabel-2.3.2-gcc-6_and_7-backport.patch create mode 100644 sci-chemistry/openbabel/files/openbabel-2.4.1-gcc-8_and_9.patch create mode 100644 sci-chemistry/openbabel/openbabel-2.4.1-r2.ebuild diff --git a/sci-chemistry/openbabel/Manifest b/sci-chemistry/openbabel/Manifest new file mode 100644 index 000000000..ac268758e --- /dev/null +++ b/sci-chemistry/openbabel/Manifest @@ -0,0 +1 @@ +DIST openbabel-2.4.1.tar.gz 11618304 BLAKE2B 8fc051e83add9be6456e281a109bd6bbec282a64ffc83309819f0decbf167b4914fbb7f1966e95e103f268754045b804317f51c79a952ace707c6af2bd320125 SHA512 427e678f0a911bd27b9a8a05e60b6e09f113be4e5dd180daaf80c28d06368e52b57501261755ab3817a8d31f2754db24471fd0ceee706d029386d6f70800e9c6 diff --git a/sci-chemistry/openbabel/files/openbabel-2.3.2-gcc-6_and_7-backport.patch b/sci-chemistry/openbabel/files/openbabel-2.3.2-gcc-6_and_7-backport.patch new file mode 100644 index 000000000..e23dc6020 --- /dev/null +++ b/sci-chemistry/openbabel/files/openbabel-2.3.2-gcc-6_and_7-backport.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0ee545cf..7f4b944e 100755 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -239,7 +239,7 @@ 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}") ++ string(REGEX MATCH "[34567]\\.[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) diff --git a/sci-chemistry/openbabel/files/openbabel-2.4.1-gcc-8_and_9.patch b/sci-chemistry/openbabel/files/openbabel-2.4.1-gcc-8_and_9.patch new file mode 100644 index 000000000..a4aa3947f --- /dev/null +++ b/sci-chemistry/openbabel/files/openbabel-2.4.1-gcc-8_and_9.patch @@ -0,0 +1,15 @@ +https://bugs.gentoo.org/654800 +Fixed-by: milan hodoscek +diff --git a/../old/CMakeLists.txt b/CMakeLists.txt +index dc38d1b..801207e 100644 +--- a/../old/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -239,7 +239,7 @@ 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 "[34567]\\.[0-9]\\.[0-9]" _gcc_version "${_gcc_version_info}") ++ string(REGEX MATCH "[3456789]\\.[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) 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 000000000..a45af3177 --- /dev/null +++ b/sci-chemistry/openbabel/openbabel-2.4.1-r2.ebuild @@ -0,0 +1,93 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +WX_GTK_VER="3.0" + +inherit cmake-utils eutils wxwidgets + +DESCRIPTION="Interconverts file formats used in molecular modeling" +HOMEPAGE="http://openbabel.sourceforge.net/" +SRC_URI="mirror://sourceforge/openbabel/${P}.tar.gz" + +# 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" + +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} + >=dev-util/cmake-2.4.8 + doc? ( app-doc/doxygen )" + +DOCS=( AUTHORS NEWS.md README.md THANKS doc/dioxin.{inc,mol2} doc/README.{dioxin.pov,povray} ) + +PATCHES=( + "${FILESDIR}"/${PN}-2.3.2-gcc-6_and_7-backport.patch + "${FILESDIR}"/${P}-gcc-8_and_9.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 && need-wxwidgets unicode + local mycmakeargs=( + -DOPENBABEL_USE_SYSTEM_INCHI=ON + -DOPENMP=$(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 + + 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 +}