blob: 3a2b0483fe044170458210de074b17b7393a29b1 (
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-python/numarray/numarray-1.5.2-r1.ebuild,v 1.3 2007/03/18 00:20:10 marienz Exp $
NEED_PYTHON=2.3
inherit distutils fortran
DOC_PV=1.5
DESCRIPTION="Large array processing extension module for Python"
SRC_URI="mirror://sourceforge/numpy/${P}.tar.gz
doc? ( mirror://sourceforge/numpy/${PN}-${DOC_PV}.html.tar.gz )"
HOMEPAGE="http://www.stsci.edu/resources/software_hardware/numarray"
# numarray does not work yet with other cblas implementations
# than cblas-reference or blas-atlas
RDEPEND="lapack? ( || ( >=sci-libs/blas-atlas-3.7.11-r1
>=sci-libs/cblas-reference-20030223-r3 )
virtual/lapack )"
DEPEND="${RDEPEND}
lapack? ( app-admin/eselect-cblas )"
IUSE="doc lapack"
SLOT="0"
KEYWORDS="~amd64 ~x86"
LICENSE="BSD"
DOCS="LICENSE.txt Doc/*.txt Doc/release_notes/ANNOUNCE-${PV:0:3}"
# test with lapack buggy
RESTRICT="lapack? ( test )"
pkg_setup() {
if use lapack; then
FORTRAN="gfortran g77"
fortran_pkg_setup
for d in $(eselect cblas show); do mycblas=${d}; done
if [[ -z "${mycblas/reference/}" ]] && [[ -z "${mycblas/atlas/}" ]]; then
ewarn "You need to set cblas to atlas or reference. Do:"
ewarn " eselect cblas set <impl>"
ewarn "where <impl> is atlas, threaded-atlas or reference"
die "setup failed"
fi
fi
}
src_unpack() {
if use lapack; then
fortran_src_unpack
else
unpack ${A}
fi
cd "${S}"
# include Python.h from header files using the PyObject_HEAD macro.
epatch "${FILESDIR}"/${P}-includes.patch
# fix refcount problem from a debian bug
epatch "${FILESDIR}"/${P}-refcount.patch
# fix hard-coded path in numinclude
sed -i \
-e "s:/home/jmiller/work/debug/include/python2.5:/usr/include/python${PYVER}:" \
Lib/numinclude.py || die "sed failed"
# configure cfg_packages.py for lapack
if use lapack; then
sed -i \
-e '/^if USE_LAPACK:/iUSE_LAPACK=True' \
-e 's:/usr/local/include/atlas:/usr/include/atlas:g' \
-e "s:/usr/local/lib/atlas:/usr/$(get_libdir):g" \
-e 's:f77blas:blas:g' \
cfg_packages.py
# fix gfortran for > gcc-4
if [[ "${FORTRANC}" == gfortran ]]; then
sed -i \
-e "s:g2c:gfortran:g" \
cfg_packages.py
fi
[[ "${mycblas}" == reference ]] && \
sed -i \
-e "s:'atlas',::g" \
-e "s:include/atlas:include/cblas:g" \
cfg_packages.py
fi
${python} setup.py config --gencode || die "API code generation failed"
}
src_test() {
cd build/lib*
cp "${S}"/Lib/testdata.fits numarray
PYTHONPATH=. "${python}" -c \
"from numarray.testall import test;import sys;sys.exit(test())" \
> test.log
grep -q -i failed test.log && die "failed tests in ${PWD}/test.log"
rm -f numarray/testdata.fits test*.*
}
src_install() {
distutils_src_install
if use doc; then
insinto /usr/share/doc/${PF}
doins -r Examples
dohtml ${WORKDIR}/${PN}-${DOC_PV}/* || die "dohtml failed"
fi
}
|