aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReinis Danne <rei4dan@gmail.com>2013-09-26 23:19:57 +0300
committerReinis Danne <rei4dan@gmail.com>2013-09-26 23:25:20 +0300
commit331fd5e22b676cf9fc135ca0bf9e956c056dd669 (patch)
treefa890d82d9df28d5529f0aabe0f414cfa93f68ad /sci-chemistry
parentAdd sci-chemistry/openbabel-perl live ebuild (diff)
downloadsci-331fd5e22b676cf9fc135ca0bf9e956c056dd669.tar.gz
sci-331fd5e22b676cf9fc135ca0bf9e956c056dd669.tar.bz2
sci-331fd5e22b676cf9fc135ca0bf9e956c056dd669.zip
Add sci-chemistry/openbabel-python live ebuild
Diffstat (limited to 'sci-chemistry')
-rw-r--r--sci-chemistry/openbabel-python/ChangeLog10
-rw-r--r--sci-chemistry/openbabel-python/metadata.xml12
-rw-r--r--sci-chemistry/openbabel-python/openbabel-python-9999.ebuild84
3 files changed, 106 insertions, 0 deletions
diff --git a/sci-chemistry/openbabel-python/ChangeLog b/sci-chemistry/openbabel-python/ChangeLog
new file mode 100644
index 000000000..0f52b419e
--- /dev/null
+++ b/sci-chemistry/openbabel-python/ChangeLog
@@ -0,0 +1,10 @@
+# ChangeLog for sci-chemistry/openbabel-python
+# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
+# $Header: $
+
+*openbabel-python-9999 (26 Sep 2013)
+
+ 26 Sep 2013; Reinis Danne <rei4dan@gmail.com> +openbabel-python-9999.ebuild,
+ +metadata.xml:
+ Add live ebuild.
+
diff --git a/sci-chemistry/openbabel-python/metadata.xml b/sci-chemistry/openbabel-python/metadata.xml
new file mode 100644
index 000000000..f85780135
--- /dev/null
+++ b/sci-chemistry/openbabel-python/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-chemistry</herd>
+ <longdescription>
+ Open Babel is a chemical toolbox designed to speak the many languages of
+ chemical data. It's an open, collaborative project allowing anyone to
+ search, convert, analyze, or store data from molecular modeling, chemistry,
+ solid-state materials, biochemistry, or related areas. This package enables
+ to access Open Babel library from Python programs.
+ </longdescription>
+</pkgmetadata>
diff --git a/sci-chemistry/openbabel-python/openbabel-python-9999.ebuild b/sci-chemistry/openbabel-python/openbabel-python-9999.ebuild
new file mode 100644
index 000000000..f0b113268
--- /dev/null
+++ b/sci-chemistry/openbabel-python/openbabel-python-9999.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=5
+
+PYTHON_COMPAT=( python{2_6,2_7,3_2,3_3} )
+
+inherit cmake-utils eutils git-2 multilib python-r1
+
+DESCRIPTION="Python bindings for OpenBabel (including Pybel)"
+HOMEPAGE="http://openbabel.sourceforge.net/"
+EGIT_REPO_URI="https://github.com/openbabel/openbabel.git"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS=""
+IUSE=""
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="${PYTHON_DEPS}
+ !sci-chemistry/babel
+ ~sci-chemistry/openbabel-${PV}
+ sys-libs/zlib"
+DEPEND="${RDEPEND}
+ >=dev-util/cmake-2.4.8
+ >=dev-lang/swig-2"
+
+S="${WORKDIR}"/openbabel-${PV}
+
+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"
+}
+
+src_configure() {
+ my_impl_src_configure() {
+ local mycmakeargs="${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=${ED}/usr/$(get_libdir)/${EPYTHON}/site-packages
+ -DPYTHON_BINDINGS=ON
+ -DPYTHON_EXECUTABLE=${PYTHON}
+ -DPYTHON_INCLUDE_DIR=${EPREFIX}/usr/include/${EPYTHON}
+ -DPYTHON_LIBRARY=${EPREFIX}/usr/$(get_libdir)/lib${EPYTHON}.so
+ -DENABLE_TESTS=ON"
+
+ cmake-utils_src_configure
+ }
+
+ python_foreach_impl my_impl_src_configure
+}
+
+src_compile() {
+ python_parallel_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
+}