1 |
commit: 477abe6228d6b1b8695f2a4ebbef3e798b53c3a2 |
2 |
Author: Justin Lecher <jlec <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Oct 11 10:40:10 2015 +0000 |
4 |
Commit: Justin Lecher <jlec <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Oct 11 11:24:29 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=477abe62 |
7 |
|
8 |
dev-python/numpy: Add python3.5 support |
9 |
|
10 |
Package-Manager: portage-2.2.23 |
11 |
Signed-off-by: Justin Lecher <jlec <AT> gentoo.org> |
12 |
|
13 |
dev-python/numpy/numpy-1.10.0_p2-r1.ebuild | 154 +++++++++++++++++++++++++++++ |
14 |
1 file changed, 154 insertions(+) |
15 |
|
16 |
diff --git a/dev-python/numpy/numpy-1.10.0_p2-r1.ebuild b/dev-python/numpy/numpy-1.10.0_p2-r1.ebuild |
17 |
new file mode 100644 |
18 |
index 0000000..dd9c6fd |
19 |
--- /dev/null |
20 |
+++ b/dev-python/numpy/numpy-1.10.0_p2-r1.ebuild |
21 |
@@ -0,0 +1,154 @@ |
22 |
+# Copyright 1999-2015 Gentoo Foundation |
23 |
+# Distributed under the terms of the GNU General Public License v2 |
24 |
+# $Id$ |
25 |
+ |
26 |
+EAPI=5 |
27 |
+ |
28 |
+PYTHON_COMPAT=( python2_7 python3_{3,4,5} ) |
29 |
+ |
30 |
+FORTRAN_NEEDED=lapack |
31 |
+ |
32 |
+inherit distutils-r1 eutils flag-o-matic fortran-2 multilib multiprocessing toolchain-funcs versionator |
33 |
+ |
34 |
+DOC_PV="1.9.1" |
35 |
+DOC_P="${PN}-${DOC_PV}" |
36 |
+ |
37 |
+DESCRIPTION="Fast array and numerical python library" |
38 |
+HOMEPAGE="http://www.numpy.org/" |
39 |
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P/_p/.post}.tar.gz |
40 |
+ doc? ( |
41 |
+ http://docs.scipy.org/doc/${DOC_P}/${PN}-html-${DOC_PV}.zip |
42 |
+ http://docs.scipy.org/doc/${DOC_P}/${PN}-ref-${DOC_PV}.pdf |
43 |
+ http://docs.scipy.org/doc/${DOC_P}/${PN}-user-${DOC_PV}.pdf |
44 |
+ )" |
45 |
+# It appears the docs haven't been upgraded, still @ 1.8.1 |
46 |
+LICENSE="BSD" |
47 |
+SLOT="0" |
48 |
+KEYWORDS="~amd64 ~x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~x86-interix ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris" |
49 |
+IUSE="doc lapack test" |
50 |
+ |
51 |
+RDEPEND=" |
52 |
+ dev-python/setuptools[${PYTHON_USEDEP}] |
53 |
+ lapack? ( virtual/cblas virtual/lapack )" |
54 |
+DEPEND="${RDEPEND} |
55 |
+ doc? ( app-arch/unzip ) |
56 |
+ lapack? ( virtual/pkgconfig ) |
57 |
+ test? ( >=dev-python/nose-1.0[${PYTHON_USEDEP}] )" |
58 |
+ |
59 |
+# Uses distutils.command.config. |
60 |
+DISTUTILS_IN_SOURCE_BUILD=1 |
61 |
+ |
62 |
+PATCHES=( |
63 |
+ "${FILESDIR}"/${PN}-1.9.2-no-hardcode-blas.patch |
64 |
+) |
65 |
+ |
66 |
+src_unpack() { |
67 |
+ default |
68 |
+ mv "${WORKDIR}"/* "${S}" || die |
69 |
+ |
70 |
+ if use doc; then |
71 |
+ unzip -qo "${DISTDIR}"/${PN}-html-${DOC_PV}.zip -d html || die |
72 |
+ fi |
73 |
+} |
74 |
+ |
75 |
+pc_incdir() { |
76 |
+ $(tc-getPKG_CONFIG) --cflags-only-I $@ | \ |
77 |
+ sed -e 's/^-I//' -e 's/[ ]*-I/:/g' -e 's/[ ]*$//' -e 's|^:||' |
78 |
+} |
79 |
+ |
80 |
+pc_libdir() { |
81 |
+ $(tc-getPKG_CONFIG) --libs-only-L $@ | \ |
82 |
+ sed -e 's/^-L//' -e 's/[ ]*-L/:/g' -e 's/[ ]*$//' -e 's|^:||' |
83 |
+} |
84 |
+ |
85 |
+pc_libs() { |
86 |
+ $(tc-getPKG_CONFIG) --libs-only-l $@ | \ |
87 |
+ sed -e 's/[ ]-l*\(pthread\|m\)\([ ]\|$\)//g' \ |
88 |
+ -e 's/^-l//' -e 's/[ ]*-l/,/g' -e 's/[ ]*$//' \ |
89 |
+ | tr ',' '\n' | sort -u | tr '\n' ',' | sed -e 's|,$||' |
90 |
+} |
91 |
+ |
92 |
+python_prepare_all() { |
93 |
+ if use lapack; then |
94 |
+ append-ldflags "$($(tc-getPKG_CONFIG) --libs-only-other cblas lapack)" |
95 |
+ local libdir="${EPREFIX}"/usr/$(get_libdir) |
96 |
+ # make sure _dotblas.so gets built |
97 |
+ sed -i -e '/NO_ATLAS_INFO/,+1d' numpy/core/setup.py || die |
98 |
+ cat >> site.cfg <<-EOF |
99 |
+ [blas] |
100 |
+ include_dirs = $(pc_incdir cblas) |
101 |
+ library_dirs = $(pc_libdir cblas blas):${libdir} |
102 |
+ blas_libs = $(pc_libs cblas blas) |
103 |
+ [lapack] |
104 |
+ library_dirs = $(pc_libdir lapack):${libdir} |
105 |
+ lapack_libs = $(pc_libs lapack) |
106 |
+ EOF |
107 |
+ else |
108 |
+ export {ATLAS,PTATLAS,BLAS,LAPACK,MKL}=None |
109 |
+ fi |
110 |
+ |
111 |
+ export CC="$(tc-getCC) ${CFLAGS}" |
112 |
+ |
113 |
+ append-flags -fno-strict-aliasing |
114 |
+ |
115 |
+ # See progress in http://projects.scipy.org/scipy/numpy/ticket/573 |
116 |
+ # with the subtle difference that we don't want to break Darwin where |
117 |
+ # -shared is not a valid linker argument |
118 |
+ if [[ ${CHOST} != *-darwin* ]]; then |
119 |
+ append-ldflags -shared |
120 |
+ fi |
121 |
+ |
122 |
+ # only one fortran to link with: |
123 |
+ # linking with cblas and lapack library will force |
124 |
+ # autodetecting and linking to all available fortran compilers |
125 |
+ append-fflags -fPIC |
126 |
+ if use lapack; then |
127 |
+ NUMPY_FCONFIG="config_fc --noopt --noarch" |
128 |
+ # workaround bug 335908 |
129 |
+ [[ $(tc-getFC) == *gfortran* ]] && NUMPY_FCONFIG+=" --fcompiler=gnu95" |
130 |
+ fi |
131 |
+ |
132 |
+ # don't version f2py, we will handle it. |
133 |
+ sed -i -e '/f2py_exe/s:+os\.path.*$::' numpy/f2py/setup.py || die |
134 |
+ |
135 |
+ # we don't have f2py-3.3 |
136 |
+ sed \ |
137 |
+ -e "/f2py_cmd/s:'f2py'.*:'f2py':g" \ |
138 |
+ -i numpy/tests/test_scripts.py || die |
139 |
+ |
140 |
+ distutils-r1_python_prepare_all |
141 |
+} |
142 |
+ |
143 |
+python_compile() { |
144 |
+ distutils-r1_python_compile -j $(makeopts_jobs) ${NUMPY_FCONFIG} |
145 |
+} |
146 |
+ |
147 |
+python_test() { |
148 |
+ distutils_install_for_testing ${NUMPY_FCONFIG} |
149 |
+ |
150 |
+ cd "${TMPDIR}" || die |
151 |
+ ${EPYTHON} -c " |
152 |
+import numpy, sys |
153 |
+r = numpy.test(label='full', verbose=3) |
154 |
+sys.exit(0 if r.wasSuccessful() else 1)" || die "Tests fail with ${EPYTHON}" |
155 |
+} |
156 |
+ |
157 |
+python_install() { |
158 |
+ distutils-r1_python_install ${NUMPY_FCONFIG} |
159 |
+} |
160 |
+ |
161 |
+python_install_all() { |
162 |
+ distutils-r1_python_install_all |
163 |
+ |
164 |
+ dodoc COMPATIBILITY DEV_README.txt THANKS.txt |
165 |
+ |
166 |
+ if use doc; then |
167 |
+ dohtml -r "${WORKDIR}"/html/* |
168 |
+ dodoc "${DISTDIR}"/${PN}-{user,ref}-${DOC_PV}.pdf |
169 |
+ fi |
170 |
+ |
171 |
+ # absent in 1.9 |
172 |
+ #docinto f2py |
173 |
+ #dodoc numpy/f2py/docs/*.txt |
174 |
+ #doman numpy/f2py/f2py.1 |
175 |
+} |