diff options
author | Pacho Ramos <pacho@gentoo.org> | 2019-09-29 13:26:27 +0200 |
---|---|---|
committer | Pacho Ramos <pacho@gentoo.org> | 2019-09-29 13:26:41 +0200 |
commit | 23e15c4c2d4ef0352a77c96a7aca963cd621372d (patch) | |
tree | ace3ed9043a52eaff60a1c9108cdeb34812b7828 /sci-chemistry | |
parent | net-analyzer/wireshark: USE=plugin_ifdemo => USE=plugin-ifdemo (diff) | |
download | gentoo-23e15c4c2d4ef0352a77c96a7aca963cd621372d.tar.gz gentoo-23e15c4c2d4ef0352a77c96a7aca963cd621372d.tar.bz2 gentoo-23e15c4c2d4ef0352a77c96a7aca963cd621372d.zip |
sci-chemistry/openbabel: Fix openmp support, add a desktop file.
Closes: https://bugs.gentoo.org/659148
Package-Manager: Portage-2.3.76, Repoman-2.3.17
Signed-off-by: Pacho Ramos <pacho@gentoo.org>
Diffstat (limited to 'sci-chemistry')
-rw-r--r-- | sci-chemistry/openbabel/Manifest | 1 | ||||
-rw-r--r-- | sci-chemistry/openbabel/openbabel-2.4.1-r1.ebuild | 101 |
2 files changed, 102 insertions, 0 deletions
diff --git a/sci-chemistry/openbabel/Manifest b/sci-chemistry/openbabel/Manifest index ac268758e8cb..b22751d4a860 100644 --- a/sci-chemistry/openbabel/Manifest +++ b/sci-chemistry/openbabel/Manifest @@ -1 +1,2 @@ DIST openbabel-2.4.1.tar.gz 11618304 BLAKE2B 8fc051e83add9be6456e281a109bd6bbec282a64ffc83309819f0decbf167b4914fbb7f1966e95e103f268754045b804317f51c79a952ace707c6af2bd320125 SHA512 427e678f0a911bd27b9a8a05e60b6e09f113be4e5dd180daaf80c28d06368e52b57501261755ab3817a8d31f2754db24471fd0ceee706d029386d6f70800e9c6 +DIST openbabel.png 29060 BLAKE2B 8d217d92125cc73462437411dd4e0cc05179cb0934f5ed15a307acc6b549b8ebab250a48a05ef7657f48c6df394f37da9b659de61efb1477b79b573a5b393ad3 SHA512 bbcaaa37663b526c9038ccb9edaf05ccc3ad1a861739a737f05f363098d8402a10b36e341fcc0aca636e809c6c32db99bf987b41719a0c756bf5e31444d3eb70 diff --git a/sci-chemistry/openbabel/openbabel-2.4.1-r1.ebuild b/sci-chemistry/openbabel/openbabel-2.4.1-r1.ebuild new file mode 100644 index 000000000000..0834c411ef29 --- /dev/null +++ b/sci-chemistry/openbabel/openbabel-2.4.1-r1.ebuild @@ -0,0 +1,101 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +WX_GTK_VER="3.0" + +inherit cmake-utils desktop eutils 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" + +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.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.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 +} |