summaryrefslogtreecommitdiff
blob: d5cb47925d3f9af796eba2acbf0693eee58c3ade (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
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-python/rpy/rpy-1.0.1.ebuild,v 1.2 2008/02/26 20:06:19 bicatali Exp $

inherit distutils eutils

DESCRIPTION="Python interface to the R Programming Language"
HOMEPAGE="http://rpy.sourceforge.net/"
SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"

LICENSE="GPL-2 LGPL-2.1 MPL-1.1"
SLOT="0"
KEYWORDS="~amd64 ~ia64 ~x86"
IUSE="doc examples lapack"

RDEPEND=">=dev-lang/R-2.6.1
	lapack? ( virtual/lapack )
	dev-python/numpy"
DEPEND="${RDEPEND}
	doc? ( || ( virtual/tetex  dev-texlive/texlive-texinfo ) )"

pkg_setup() {
	if use lapack && ! built_with_use dev-lang/R lapack; then
		eerror "If you want ${PN} with lapack bindings,"
		eerror "you also need dev-lang/R with lapack"
		die "need dev-lang/R compiled with lapack"
	fi
}

src_unpack() {
	distutils_src_unpack
	# Fix lapack linking issue, bug 143396
	if use lapack; then
		sed -i \
			-e 's:Rlapack:lapack:g' \
			setup.py || die "sed in setup.py failed"
	fi
	epatch "${FILESDIR}"/${PN}-1.0_rc3-version-detect.patch
	epatch "${FILESDIR}"/${PN}-testfiles.patch
}

src_test() {
	cd tests
	PYTHONPATH=$(ls -d ../build/lib.*) \
		"${python}" testall.py || die "tests failed"
}

src_install() {
	distutils_src_install

	if use examples; then
		insinto /usr/share/doc/${PF}
		doins -r examples || die
	fi

	if use doc; then
		cd doc
		emake html pdf || die "emake docs failed"
		dohtml rpy_html/* || die
		insinto /usr/share/doc/${PF}
		doins rpy.pdf || die
	fi
}