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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.24 - (show annotations) (download)
Fri Dec 7 09:35:36 2012 UTC (23 months, 2 weeks ago) by jlec
Branch: MAIN
CVS Tags: HEAD
Changes since 1.23: +1 -1 lines
FILE REMOVED
dev-python/numpy: Drop old, fixes #404435, #386847

(Portage version: 2.2.0_alpha144/cvs/Linux x86_64, signed Manifest commit with key 70EB7916)

1 # Copyright 1999-2012 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.5.1.ebuild,v 1.23 2012/10/16 18:38:04 jlec Exp $
4
5 EAPI=3
6
7 PYTHON_DEPEND="*::3.2"
8 SUPPORT_PYTHON_ABIS="1"
9 RESTRICT_PYTHON_ABIS="3.3 *-jython 2.7-pypy-*"
10
11 FORTRAN_NEEDED=lapack
12
13 inherit distutils eutils fortran-2 flag-o-matic toolchain-funcs versionator
14
15 NP="${PN}-1.5"
16
17 DESCRIPTION="Fast array and numerical python library"
18 HOMEPAGE="http://numpy.scipy.org/ http://pypi.python.org/pypi/numpy"
19 SRC_URI="mirror://sourceforge/numpy/${P}.tar.gz
20 doc? (
21 http://docs.scipy.org/doc/${NP}.x/numpy-html.zip -> ${NP}-html.zip
22 http://docs.scipy.org/doc/${NP}.x/numpy-ref.pdf -> ${NP}-ref.pdf
23 http://docs.scipy.org/doc/${NP}.x/numpy-user.pdf -> ${NP}-user.pdf
24 )"
25
26 LICENSE="BSD"
27 SLOT="0"
28 KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~x86-fbsd ~x86-freebsd ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris"
29 IUSE="doc lapack test"
30
31 RDEPEND="
32 dev-python/setuptools
33 lapack? ( virtual/cblas virtual/lapack )"
34 DEPEND="${RDEPEND}
35 doc? ( app-arch/unzip )
36 lapack? ( virtual/pkgconfig )
37 test? ( >=dev-python/nose-0.10 )"
38
39 PYTHON_CFLAGS=("* + -fno-strict-aliasing")
40
41 DOCS="COMPATIBILITY DEV_README.txt THANKS.txt"
42
43 pkg_setup() {
44 fortran-2_pkg_setup
45 python_pkg_setup
46
47 # See progress in http://projects.scipy.org/scipy/numpy/ticket/573
48 # with the subtle difference that we don't want to break Darwin where
49 # -shared is not a valid linker argument
50 if [[ ${CHOST} != *-darwin* ]] ; then
51 append-ldflags -shared
52 fi
53
54 # only one fortran to link with:
55 # linking with cblas and lapack library will force
56 # autodetecting and linking to all available fortran compilers
57 use lapack || return
58 append-fflags -fPIC
59 NUMPY_FCONFIG="config_fc --noopt --noarch"
60 # workaround bug 335908
61 [[ ${FC} == *gfortran* ]] && NUMPY_FCONFIG="${NUMPY_FCONFIG} --fcompiler=gnu95"
62 export NUMPY_FCONFIG
63 }
64
65 src_unpack() {
66 unpack ${P}.tar.gz
67 if use doc; then
68 unzip -qo "${DISTDIR}"/${NP}-html.zip -d html || die
69 fi
70 }
71
72 src_prepare() {
73 epatch "${FILESDIR}/${PN}-1.1.0-f2py.patch"
74 epatch "${FILESDIR}/${PN}-1.3.0-fenv-freebsd.patch" # Bug #279487
75 epatch "${FILESDIR}/${PN}-1.4.0-interix.patch"
76 epatch "${FILESDIR}/${P}-python-3.2.patch"
77
78 # Gentoo patch for ATLAS library names
79 sed -i \
80 -e "s:'f77blas':'blas':g" \
81 -e "s:'ptf77blas':'blas':g" \
82 -e "s:'ptcblas':'cblas':g" \
83 -e "s:'lapack_atlas':'lapack':g" \
84 numpy/distutils/system_info.py \
85 || die "sed system_info.py failed"
86
87 if use lapack; then
88 append-ldflags "$(pkg-config --libs-only-other cblas lapack)"
89 sed -i -e '/NO_ATLAS_INFO/,+1d' numpy/core/setup.py || die
90 local libdir="${EPREFIX}"/usr/$(get_libdir)
91 cat >> site.cfg <<-EOF
92 [atlas]
93 include_dirs = $(pkg-config --cflags-only-I \
94 cblas | sed -e 's/^-I//' -e 's/ -I/:/g')
95 library_dirs = $(pkg-config --libs-only-L \
96 cblas blas lapack | sed -e 's/^-L//' -e 's/ -L/:/g' -e 's/ //g'):${libdir}
97 atlas_libs = $(pkg-config --libs-only-l \
98 cblas blas | sed -e 's/^-l//' -e 's/ -l/, /g' -e 's/,.pthread//g')
99 lapack_libs = $(pkg-config --libs-only-l \
100 lapack | sed -e 's/^-l//' -e 's/ -l/, /g' -e 's/,.pthread//g')
101 [blas_opt]
102 include_dirs = $(pkg-config --cflags-only-I \
103 cblas | sed -e 's/^-I//' -e 's/ -I/:/g')
104 library_dirs = $(pkg-config --libs-only-L \
105 cblas blas | sed -e 's/^-L//' -e 's/ -L/:/g' -e 's/ //g'):${libdir}
106 libraries = $(pkg-config --libs-only-l \
107 cblas blas | sed -e 's/^-l//' -e 's/ -l/, /g' -e 's/,.pthread//g')
108 [lapack_opt]
109 library_dirs = $(pkg-config --libs-only-L \
110 lapack | sed -e 's/^-L//' -e 's/ -L/:/g' -e 's/ //g'):${libdir}
111 libraries = $(pkg-config --libs-only-l \
112 lapack | sed -e 's/^-l//' -e 's/ -l/, /g' -e 's/,.pthread//g')
113 EOF
114 else
115 export {ATLAS,PTATLAS,BLAS,LAPACK,MKL}=None
116 fi
117
118 # Disable tests failing on ppc/ppc64.
119 # http://projects.scipy.org/numpy/ticket/1664
120 if use ppc || use ppc64; then
121 sed \
122 -e "s/test_nextafterl/_&/" \
123 -e "s/test_spacingl/_&/" \
124 -i numpy/core/tests/test_umath.py
125 fi
126 export CC="$(tc-getCC) ${CFLAGS}"
127 }
128
129 src_compile() {
130 distutils_src_compile ${NUMPY_FCONFIG}
131 }
132
133 src_test() {
134 testing() {
135 "$(PYTHON)" setup.py ${NUMPY_FCONFIG} build -b "build-${PYTHON_ABI}" install \
136 --home="${S}/test-${PYTHON_ABI}" --no-compile || die "install test failed"
137 pushd "${S}/test-${PYTHON_ABI}/"lib* > /dev/null
138 PYTHONPATH=python "$(PYTHON)" -c "import numpy; numpy.test()" 2>&1 | tee test.log
139 grep -Eq '^(ERROR|FAIL):' test.log && return 1
140 popd > /dev/null
141 rm -fr test-${PYTHON_ABI}
142 }
143 python_execute_function testing
144 }
145
146 src_install() {
147 distutils_src_install ${NUMPY_FCONFIG}
148
149 delete_txt() {
150 rm -f "${ED}"$(python_get_sitedir)/numpy/*.txt
151 }
152 python_execute_function -q delete_txt
153
154 docinto f2py
155 dodoc numpy/f2py/docs/*.txt || die "dodoc f2py failed"
156 doman numpy/f2py/f2py.1 || die "doman failed"
157
158 if use doc; then
159 insinto /usr/share/doc/${PF}
160 doins -r "${WORKDIR}"/html || die
161 doins "${DISTDIR}"/${NP}*pdf || die
162 fi
163 }

  ViewVC Help
Powered by ViewVC 1.1.20