summaryrefslogtreecommitdiff
blob: 9356fe1c97adb645175fffd46fa5f3328ae5b6d3 (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
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=4

SUPPORT_PYTHON_ABIS="1"
DISTUTILS_SRC_TEST=setup.py

inherit eutils distutils

DESCRIPTION="Collection of common tools needed for performing astronomy and astrophysics"
HOMEPAGE="http://astropy.org/ https://github.com/astropy/astropy"
SRC_URI="http://github.com/downloads/${PN}/${PN}/${P}.tar.gz"

LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64"
IUSE="doc test"

RDEPEND="dev-libs/expat
	dev-python/numpy"
DEPEND="${RDEPEND}
	dev-python/configobj
	doc? ( dev-python/sphinx )
	test? ( dev-python/pytest )"

src_prepare() {
	# Upstream likes to bundle everythin
	rm -rf cextern ${PN}/extern
	export ASTROPY_USE_SYSTEM_PYTEST=1
	epatch "${FILESDIR}"/${P}-expat.patch
	sed -e 's/from ..extern.configobj //g' \
		-i astropy/config/configuration.py || die
	distutils_src_prepare
}

src_compile() {
	distutils_src_compile
	if use doc; then
		PYTHONPATH=$(ls -d "${S}"/build-$(PYTHON -f --ABI)/lib*) emake html -C docs
	fi
}

src_install() {
	distutils_src_install
	use doc && dohtml -r docs/_build/html/
}