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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.17 - (show annotations) (download)
Fri Dec 7 09:35:36 2012 UTC (2 years ago) by jlec
Branch: MAIN
CVS Tags: HEAD
Changes since 1.16: +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.6.0.ebuild,v 1.16 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 flag-o-matic fortran-2 toolchain-funcs versionator
14
15 DOC_P="${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/${DOC_P}.x/numpy-html.zip -> ${DOC_P}-html.zip
22 http://docs.scipy.org/doc/${DOC_P}.x/numpy-ref.pdf -> ${DOC_P}-ref.pdf
23 http://docs.scipy.org/doc/${DOC_P}.x/numpy-user.pdf -> ${DOC_P}-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 # Build system installs f2py${Python_version} scripts.
42 PYTHON_NONVERSIONED_EXECUTABLES=("/usr/bin/f2py[[:digit:]]+\.[[:digit:]]+")
43
44 DOCS="COMPATIBILITY DEV_README.txt THANKS.txt"
45
46 pkg_setup() {
47 fortran-2_pkg_setup
48 python_pkg_setup
49
50 # See progress in http://projects.scipy.org/scipy/numpy/ticket/573
51 # with the subtle difference that we don't want to break Darwin where
52 # -shared is not a valid linker argument
53 if [[ ${CHOST} != *-darwin* ]]; then
54 append-ldflags -shared
55 fi
56
57 # only one fortran to link with:
58 # linking with cblas and lapack library will force
59 # autodetecting and linking to all available fortran compilers
60 if use lapack; then
61 append-fflags -fPIC
62 NUMPY_FCONFIG="config_fc --noopt --noarch"
63 # workaround bug 335908
64 [[ ${FC} == *gfortran* ]] && NUMPY_FCONFIG+=" --fcompiler=gnu95"
65 fi
66 }
67
68 src_unpack() {
69 unpack ${P}.tar.gz
70 if use doc; then
71 unzip -qo "${DISTDIR}"/${DOC_P}-html.zip -d html || die
72 fi
73 }
74
75 src_prepare() {
76 # Gentoo patch for ATLAS library names
77 sed -i \
78 -e "s:'f77blas':'blas':g" \
79 -e "s:'ptf77blas':'blas':g" \
80 -e "s:'ptcblas':'cblas':g" \
81 -e "s:'lapack_atlas':'lapack':g" \
82 numpy/distutils/system_info.py \
83 || die "sed system_info.py failed"
84
85 if use lapack; then
86 append-ldflags "$(pkg-config --libs-only-other cblas lapack)"
87 sed -i -e '/NO_ATLAS_INFO/,+1d' numpy/core/setup.py || die
88 local libdir="${EPREFIX}"/usr/$(get_libdir)
89 cat >> site.cfg <<-EOF
90 [atlas]
91 include_dirs = $(pkg-config --cflags-only-I \
92 cblas | sed -e 's/^-I//' -e 's/ -I/:/g')
93 library_dirs = $(pkg-config --libs-only-L \
94 cblas blas lapack | sed -e 's/^-L//' -e 's/ -L/:/g' -e 's/ //g'):${libdir}
95 atlas_libs = $(pkg-config --libs-only-l \
96 cblas blas | sed -e 's/^-l//' -e 's/ -l/, /g' -e 's/,.pthread//g')
97 lapack_libs = $(pkg-config --libs-only-l \
98 lapack | sed -e 's/^-l//' -e 's/ -l/, /g' -e 's/,.pthread//g')
99 [blas_opt]
100 include_dirs = $(pkg-config --cflags-only-I \
101 cblas | sed -e 's/^-I//' -e 's/ -I/:/g')
102 library_dirs = $(pkg-config --libs-only-L \
103 cblas blas | sed -e 's/^-L//' -e 's/ -L/:/g' -e 's/ //g'):${libdir}
104 libraries = $(pkg-config --libs-only-l \
105 cblas blas | sed -e 's/^-l//' -e 's/ -l/, /g' -e 's/,.pthread//g')
106 [lapack_opt]
107 library_dirs = $(pkg-config --libs-only-L \
108 lapack | sed -e 's/^-L//' -e 's/ -L/:/g' -e 's/ //g'):${libdir}
109 libraries = $(pkg-config --libs-only-l \
110 lapack | sed -e 's/^-l//' -e 's/ -l/, /g' -e 's/,.pthread//g')
111 EOF
112 else
113 export {ATLAS,PTATLAS,BLAS,LAPACK,MKL}=None
114 fi
115
116 export CC="$(tc-getCC) ${CFLAGS}"
117 }
118
119 src_compile() {
120 distutils_src_compile ${NUMPY_FCONFIG}
121 }
122
123 src_test() {
124 testing() {
125 "$(PYTHON)" setup.py ${NUMPY_FCONFIG} build -b "build-${PYTHON_ABI}" install \
126 --home="${S}/test-${PYTHON_ABI}" --no-compile || die "install test failed"
127 pushd "${S}/test-${PYTHON_ABI}/"lib* > /dev/null
128 PYTHONPATH=python "$(PYTHON)" -c "import numpy; numpy.test()" 2>&1 | tee test.log
129 grep -Eq "^(ERROR|FAIL):" test.log && return 1
130 popd > /dev/null
131 rm -fr test-${PYTHON_ABI}
132 }
133 python_execute_function testing
134 }
135
136 src_install() {
137 distutils_src_install ${NUMPY_FCONFIG}
138
139 delete_txt() {
140 rm -f "${ED}"$(python_get_sitedir)/numpy/*.txt
141 }
142 python_execute_function -q delete_txt
143
144 docinto f2py
145 dodoc numpy/f2py/docs/*.txt || die "dodoc f2py failed"
146 doman numpy/f2py/f2py.1 || die "doman failed"
147
148 if use doc; then
149 insinto /usr/share/doc/${PF}
150 doins -r "${WORKDIR}"/html || die
151 doins "${DISTDIR}"/${DOC_P}*pdf || die
152 fi
153 }

  ViewVC Help
Powered by ViewVC 1.1.20