aboutsummaryrefslogtreecommitdiff
blob: 2eac693bdd48d8fe6b444069441b4c4aa9c9003e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

inherit eutils perl-module

DESCRIPTION="Perl bindings for OpenBabel"
HOMEPAGE="http://openbabel.sourceforge.net/"
SRC_URI="mirror://sourceforge/openbabel/openbabel-${PV}.tar.gz"

KEYWORDS="~amd64"
SLOT="0"
LICENSE="GPL-2"
IUSE="swig"

RDEPEND="~sci-chemistry/openbabel-${PV}
	dev-lang/perl"

DEPEND="${RDEPEND}
	swig? ( >=dev-lang/swig-1.3.39 )"

src_unpack() {
	unpack ${A}
	S="${WORKDIR}/openbabel-${PV}"
	cd "${S}"

	econf \
		$(use_enable swig maintainer-mode) \
		--enable-static \
			|| die "econf failed"
	S="${S}/scripts"
	cd "${S}"
	if use swig ; then
		emake -W openbabel-perl.i perl/openbabel_perl.cpp \
			|| die "Failed to make SWIG perl bindings"
	fi
	S="${S}/perl"
	cd "${S}"
	epatch "${FILESDIR}/${P}-makefile.patch" \
		|| die "Failed to apply ${P}-makefile.patch"
}

src_compile() {
	perl-module_src_prep
	perl-module_src_compile
}

src_test() {
	emake test || die "make test failed"
}

src_install() {
	perl-module_src_install
}

pkg_preinst() {
	perl-module_pkg_preinst
}

pkg_postinst() {
	perl-module_pkg_postinst
}

pkg_prerm() {
	perl-module_pkg_prerm
}

pkg_postrm() {
	perl-module_pkg_postrm
}