diff options
author | Michael Palimaka <kensington@gentoo.org> | 2017-10-05 23:04:34 +1100 |
---|---|---|
committer | Michael Palimaka <kensington@gentoo.org> | 2017-10-05 23:04:47 +1100 |
commit | 5d502a9acdaaa6410a786a6d5f7b3138aa0da80c (patch) | |
tree | 35a4adf3efa8c9bdc413788f67da85085ea5d02e /sci-chemistry/openbabel-python/openbabel-python-2.4.1-r1.ebuild | |
parent | sci-chemistry/openbabel-perl: stabilise 2.4.11 for x86 (diff) | |
download | gentoo-5d502a9acdaaa6410a786a6d5f7b3138aa0da80c.tar.gz gentoo-5d502a9acdaaa6410a786a6d5f7b3138aa0da80c.tar.bz2 gentoo-5d502a9acdaaa6410a786a6d5f7b3138aa0da80c.zip |
sci-chemistry/openbabel-python: avoid installing python modules to /lib/
Package-Manager: Portage-2.3.8, Repoman-2.3.3
Diffstat (limited to 'sci-chemistry/openbabel-python/openbabel-python-2.4.1-r1.ebuild')
-rw-r--r-- | sci-chemistry/openbabel-python/openbabel-python-2.4.1-r1.ebuild | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/sci-chemistry/openbabel-python/openbabel-python-2.4.1-r1.ebuild b/sci-chemistry/openbabel-python/openbabel-python-2.4.1-r1.ebuild new file mode 100644 index 000000000000..84f9aa89e74b --- /dev/null +++ b/sci-chemistry/openbabel-python/openbabel-python-2.4.1-r1.ebuild @@ -0,0 +1,91 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +PYTHON_COMPAT=( python2_7 python3_{4,5,6} ) + +inherit cmake-utils python-r1 + +DESCRIPTION="Python bindings for OpenBabel (including Pybel)" +HOMEPAGE="http://openbabel.sourceforge.net/" +SRC_URI="mirror://sourceforge/openbabel/openbabel-${PV}.tar.gz" + +KEYWORDS="amd64 ~arm x86 ~amd64-linux ~x86-linux" +SLOT="0/5" +LICENSE="GPL-2" +IUSE="" + +REQUIRED_USE="${PYTHON_REQUIRED_USE}" + +RDEPEND="${PYTHON_DEPS} + ~sci-chemistry/openbabel-${PV} + sys-libs/zlib" +DEPEND="${RDEPEND} + >=dev-lang/swig-2" + +S="${WORKDIR}"/openbabel-${PV} + +PATCHES=( + "${FILESDIR}"/${PN}-2.3.2-gcc-6_and_7-backport.patch + ) + +src_prepare() { + cmake-utils_src_prepare + sed \ + -e "s:\"\.\.\":\"${EPREFIX}/usr\":g" \ + -i test/testbabel.py || die + swig -python -c++ -small -O -templatereduce -naturalvar \ + -I"${EPREFIX}/usr/include/openbabel-2.0" \ + -o scripts/python/openbabel-python.cpp \ + -DHAVE_EIGEN \ + -outdir scripts/python \ + scripts/openbabel-python.i \ + || die "Regeneration of openbabel-python.cpp failed" + sed \ + -e '/__GNUC__/s:== 4:>= 4:g' \ + -i include/openbabel/shared_ptr.h || die +} + +src_configure() { + my_impl_src_configure() { + local mycmakeargs=( + -DCMAKE_INSTALL_RPATH= + -DBINDINGS_ONLY=ON + -DBABEL_SYSTEM_LIBRARY="${EPREFIX}/usr/$(get_libdir)/libopenbabel.so" + -DOB_MODULE_PATH="${EPREFIX}/usr/$(get_libdir)/openbabel/${PV}" + -DLIB_INSTALL_DIR="${D}$(python_get_sitedir)" + -DPYTHON_BINDINGS=ON + -DPYTHON_EXECUTABLE=${PYTHON} + -DPYTHON_INCLUDE_DIR="$(python_get_includedir)" + -DPYTHON_INCLUDE_PATH="$(python_get_includedir)" + -DPYTHON_LIBRARY="$(python_get_library_path)" + -DENABLE_TESTS=ON + -DCMAKE_INSTALL_PREFIX="${ED%/}/usr" + ) + + cmake-utils_src_configure + } + + python_foreach_impl my_impl_src_configure +} + +src_compile() { + python_foreach_impl cmake-utils_src_make bindings_python +} + +src_test() { + python_foreach_impl cmake-utils_src_test -R py +} + +src_install() { + my_impl_src_install() { + cd "${BUILD_DIR}" || die + + cmake -DCOMPONENT=bindings_python -P cmake_install.cmake + + python_optimize + } + + python_foreach_impl my_impl_src_install +} |