aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReinis Danne <rei4dan@gmail.com>2013-09-26 23:22:25 +0300
committerReinis Danne <rei4dan@gmail.com>2013-09-26 23:25:20 +0300
commitf48385ab3ce9f8d2a166c2c0b021772d790e8476 (patch)
treefc4e3c0c7e2ee0ca239658c0c463e74cdb695cd8
parentAdd sci-chemistry/openbabel-python live ebuild (diff)
downloadsci-f48385ab3ce9f8d2a166c2c0b021772d790e8476.tar.gz
sci-f48385ab3ce9f8d2a166c2c0b021772d790e8476.tar.bz2
sci-f48385ab3ce9f8d2a166c2c0b021772d790e8476.zip
Add sci-chemistry/openbabel-ruby live ebuild
-rw-r--r--sci-chemistry/openbabel-ruby/ChangeLog10
-rw-r--r--sci-chemistry/openbabel-ruby/metadata.xml12
-rw-r--r--sci-chemistry/openbabel-ruby/openbabel-ruby-9999.ebuild78
3 files changed, 100 insertions, 0 deletions
diff --git a/sci-chemistry/openbabel-ruby/ChangeLog b/sci-chemistry/openbabel-ruby/ChangeLog
new file mode 100644
index 000000000..6ee5574ab
--- /dev/null
+++ b/sci-chemistry/openbabel-ruby/ChangeLog
@@ -0,0 +1,10 @@
+# ChangeLog for sci-chemistry/openbabel-ruby
+# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
+# $Header: $
+
+*openbabel-ruby-9999 (26 Sep 2013)
+
+ 26 Sep 2013; Reinis Danne <rei4dan@gmail.com> +openbabel-ruby-9999.ebuild,
+ +metadata.xml:
+ Add live ebuild.
+
diff --git a/sci-chemistry/openbabel-ruby/metadata.xml b/sci-chemistry/openbabel-ruby/metadata.xml
new file mode 100644
index 000000000..e787ba02a
--- /dev/null
+++ b/sci-chemistry/openbabel-ruby/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 Ruby programs.
+ </longdescription>
+</pkgmetadata>
diff --git a/sci-chemistry/openbabel-ruby/openbabel-ruby-9999.ebuild b/sci-chemistry/openbabel-ruby/openbabel-ruby-9999.ebuild
new file mode 100644
index 000000000..28aa2a409
--- /dev/null
+++ b/sci-chemistry/openbabel-ruby/openbabel-ruby-9999.ebuild
@@ -0,0 +1,78 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=5
+
+USE_RUBY="ruby18 ruby19"
+
+inherit cmake-utils eutils ruby-ng git-2
+
+DESCRIPTION="Ruby bindings for OpenBabel"
+HOMEPAGE="http://openbabel.sourceforge.net/"
+EGIT_REPO_URI="https://github.com/openbabel/openbabel.git"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS=""
+IUSE=""
+
+DEPEND="${DEPEND}
+ ~sci-chemistry/openbabel-${PV}
+ >=dev-lang/swig-1.3.29"
+RDEPEND="${RDEPEND}
+ ~sci-chemistry/openbabel-${PV}"
+
+CMAKE_IN_SOURCE_BUILD=1
+
+src_unpack() {
+ all_ruby_unpack() {
+ git-2_src_unpack
+ }
+
+ ruby-ng_src_unpack
+}
+
+all_ruby_prepare() {
+ swig -ruby -c++ -small -O -templatereduce -naturalvar -autorename \
+ -I"${EPREFIX}/usr/include/openbabel-2.0" \
+ -o scripts/ruby/openbabel-ruby.cpp \
+ -outdir scripts/ruby \
+ scripts/openbabel-ruby.i \
+ || die "Generation of openbabel-ruby.cpp failed"
+ sed 's/void Init_OpenBabel/void Init_openbabel/' -i scripts/ruby/openbabel-ruby.cpp
+}
+
+each_ruby_configure() {
+ CMAKE_USE_DIR="${WORKDIR}/${environment}/${P}"
+ 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}/$(ruby_rbconfig_value sitearchdir)
+ -DRUBY_BINDINGS=ON
+ -DRUBY_EXECUTABLE=${RUBY}
+ -DRUBY_INCLUDE_DIR=$(ruby_get_hdrdir) -I$(ruby_get_hdrdir)/$(ruby_rbconfig_value sitearch)
+ -DRUBY_LIBRARY=$(ruby_get_libruby)"
+
+ cmake-utils_src_configure
+}
+
+each_ruby_compile() {
+ CMAKE_USE_DIR="${WORKDIR}/${environment}/${P}"
+ cmake-utils_src_make bindings_ruby
+}
+
+each_ruby_test() {
+ for i in scripts/ruby/examples/*
+ do
+ einfo "Running test: ${WORKDIR}/${environment}/${P}/${i}"
+ ${RUBY} -I"${WORKDIR}/${environment}/${P}/$(get_libdir)" "${i}" || die
+ done
+}
+
+each_ruby_install() {
+ CMAKE_USE_DIR="${WORKDIR}/${environment}/${P}"
+ cmake -DCOMPONENT=bindings_ruby -P cmake_install.cmake
+}