/[gentoo-x86]/dev-python/numpy/numpy-1.0.4.ebuild
Gentoo

Contents of /dev-python/numpy/numpy-1.0.4.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (show annotations) (download)
Fri Dec 21 12:32:50 2007 UTC (10 years, 1 month ago) by nixnut
Branch: MAIN
Changes since 1.6: +2 -2 lines
Stable on ppc wrt bug 202202
(Portage version: 2.1.4_rc10)

1 # Copyright 1999-2007 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/dev-python/numpy/numpy-1.0.4.ebuild,v 1.6 2007/12/19 12:50:02 armin76 Exp $
4
5 NEED_PYTHON=2.3
6
7 inherit distutils eutils flag-o-matic
8
9 MY_P=${P/_beta/b}
10 MY_P=${MY_P/_}
11
12 DESCRIPTION="Python array processing for numbers, strings, records, and objects"
13 SRC_URI="mirror://sourceforge/numpy/${MY_P}.tar.gz"
14 HOMEPAGE="http://numeric.scipy.org/"
15
16 RDEPEND="!dev-python/f2py
17 lapack? ( virtual/cblas virtual/lapack )"
18 DEPEND="${RDEPEND}
19 lapack? ( dev-util/pkgconfig )"
20
21 IUSE="lapack"
22 SLOT="0"
23 KEYWORDS="alpha ~amd64 hppa ia64 ppc ~ppc64 sparc x86 ~x86-fbsd"
24 LICENSE="BSD"
25
26 S="${WORKDIR}/${MY_P}"
27
28 # whatever LDFLAGS set will break linking
29 # see progress in http://projects.scipy.org/scipy/numpy/ticket/573
30 [ -n "${LDFLAGS}" ] && append-ldflags -shared
31
32 # ex usage: pkgconf_cfg --libs-only-l cblas: ['cblas','atlas']
33 pkgconf_cfg() {
34 local cfg="["
35 for i in $(pkg-config "$1" "$2"); do
36 cfg="${cfg}'${i:2}'"
37 done
38 echo "${cfg//\'\'/','}]"
39 }
40
41 src_unpack() {
42 unpack ${A}
43 cd "${S}"
44
45 # Fix some paths and docs in f2py
46 epatch "${FILESDIR}"/${PN}-1.0.1-f2py.patch
47
48 # Patch to use feclearexcept(3) rather than fpsetsticky(3) on FreeBSD 5.3+
49 epatch "${FILESDIR}"/${P}-freebsd.patch
50
51 # Gentoo patch for ATLAS library names
52 sed -i \
53 -e "s:'f77blas':'blas':g" \
54 -e "s:'ptblas':'blas':g" \
55 -e "s:'ptcblas':'cblas':g" \
56 -e "s:'lapack_atlas':'lapack':g" \
57 numpy/distutils/system_info.py \
58 || die "sed system_info.py failed"
59
60 export BLAS=None
61 export LAPACK=None
62 export ATLAS=None
63 export PTATLAS=None
64 export MKL=None
65
66 if use lapack; then
67 unset BLAS LAPACK
68 cat > site.cfg <<-EOF
69 [blas]
70 blas_libs = $(pkgconf_cfg --libs-only-l cblas)
71 library_dirs = $(pkgconf_cfg --libs-only-L cblas)
72
73 [lapack]
74 lapack_libs = $(pkgconf_cfg --libs-only-l lapack)
75 library_dirs = $(pkgconf_cfg --libs-only-L lapack)
76 EOF
77 fi
78 }
79
80 src_test() {
81 "${python}" setup.py install \
82 --home="${S}"/test \
83 --no-compile \
84 || die "install test failed"
85
86 pushd "${S}"/test/lib*/python
87 PYTHONPATH=. "${python}" -c "import numpy; numpy.test(10,3)" 2>&1 \
88 | tee test.log
89 grep -q '^OK$' test.log || die "test failed"
90 popd
91
92 rm -rf test
93 }
94
95 src_install() {
96 distutils_src_install
97
98 docinto numpy
99 dodoc numpy/doc/*txt || die "dodoc failed"
100
101 docinto f2py
102 dodoc numpy/f2py/docs/*txt || die "dodoc f2py failed"
103 doman numpy/f2py/f2py.1 || die "doman failed"
104 }
105
106 pkg_postinst() {
107 if ! built_with_use sys-devel/gcc fortran && ! has_version dev-lang/ifc; then
108 ewarn "To use numpy's f2py you need a fortran compiler."
109 ewarn "You can either set USE=fortran flag and re-emerge gcc,"
110 ewarn "or emerge dev-lang/ifc"
111 fi
112 }

  ViewVC Help
Powered by ViewVC 1.1.20