Gentoo Archives: gentoo-commits

From: "Kacper Kowalik (xarthisius)" <xarthisius@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-python/numpy: numpy-1.5.0-r1.ebuild ChangeLog numpy-1.2.1.ebuild numpy-1.5.0.ebuild
Date: Thu, 09 Sep 2010 07:25:41
Message-Id: 20100909072531.D343120051@flycatcher.gentoo.org
1 xarthisius 10/09/09 07:25:31
2
3 Modified: ChangeLog
4 Added: numpy-1.5.0-r1.ebuild
5 Removed: numpy-1.2.1.ebuild numpy-1.5.0.ebuild
6 Log:
7 Force numpy to use GNU compilers for linking when FC is set to gfortran, wrt bug 335908. Drop old.
8
9 (Portage version: 2.2_rc77/cvs/Linux x86_64)
10
11 Revision Changes Path
12 1.117 dev-python/numpy/ChangeLog
13
14 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/numpy/ChangeLog?rev=1.117&view=markup
15 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/numpy/ChangeLog?rev=1.117&content-type=text/plain
16 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/numpy/ChangeLog?r1=1.116&r2=1.117
17
18 Index: ChangeLog
19 ===================================================================
20 RCS file: /var/cvsroot/gentoo-x86/dev-python/numpy/ChangeLog,v
21 retrieving revision 1.116
22 retrieving revision 1.117
23 diff -u -r1.116 -r1.117
24 --- ChangeLog 2 Sep 2010 13:25:02 -0000 1.116
25 +++ ChangeLog 9 Sep 2010 07:25:31 -0000 1.117
26 @@ -1,6 +1,13 @@
27 # ChangeLog for dev-python/numpy
28 # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
29 -# $Header: /var/cvsroot/gentoo-x86/dev-python/numpy/ChangeLog,v 1.116 2010/09/02 13:25:02 djc Exp $
30 +# $Header: /var/cvsroot/gentoo-x86/dev-python/numpy/ChangeLog,v 1.117 2010/09/09 07:25:31 xarthisius Exp $
31 +
32 +*numpy-1.5.0-r1 (09 Sep 2010)
33 +
34 + 09 Sep 2010; Kacper Kowalik <xarthisius@g.o> -numpy-1.2.1.ebuild,
35 + -numpy-1.5.0.ebuild, +numpy-1.5.0-r1.ebuild:
36 + Force numpy to use GNU compilers for linking when FC is set to gfortran,
37 + wrt bug 335908. Drop old.
38
39 *numpy-1.5.0 (02 Sep 2010)
40
41
42
43
44 1.1 dev-python/numpy/numpy-1.5.0-r1.ebuild
45
46 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/numpy/numpy-1.5.0-r1.ebuild?rev=1.1&view=markup
47 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/numpy/numpy-1.5.0-r1.ebuild?rev=1.1&content-type=text/plain
48
49 Index: numpy-1.5.0-r1.ebuild
50 ===================================================================
51 # Copyright 1999-2010 Gentoo Foundation
52 # Distributed under the terms of the GNU General Public License v2
53 # $Header: /var/cvsroot/gentoo-x86/dev-python/numpy/numpy-1.5.0-r1.ebuild,v 1.1 2010/09/09 07:25:31 xarthisius Exp $
54
55 EAPI="3"
56 PYTHON_DEPEND="2"
57 SUPPORT_PYTHON_ABIS="1"
58 RESTRICT_PYTHON_ABIS="3.*"
59
60 inherit distutils eutils flag-o-matic toolchain-funcs versionator
61
62 NP="${PN}-1.3"
63
64 DESCRIPTION="Fast array and numerical python library"
65 HOMEPAGE="http://numpy.scipy.org/ http://pypi.python.org/pypi/numpy"
66 SRC_URI="mirror://sourceforge/numpy/${P}.tar.gz
67 doc? (
68 http://docs.scipy.org/doc/${NP}.x/numpy-html.zip -> ${NP}-html.zip
69 http://docs.scipy.org/doc/${NP}.x/numpy-ref.pdf -> ${NP}-ref.pdf
70 http://docs.scipy.org/doc/${NP}.x/numpy-user.pdf -> ${NP}-user.pdf
71 )"
72
73 LICENSE="BSD"
74 SLOT="0"
75 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 -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"
76 IUSE="doc lapack test"
77
78 RDEPEND="dev-python/setuptools
79 lapack? ( virtual/cblas virtual/lapack )"
80 DEPEND="${RDEPEND}
81 lapack? ( dev-util/pkgconfig )
82 test? ( >=dev-python/nose-0.10 )
83 doc? ( app-arch/unzip )"
84
85 pkg_setup() {
86 # See progress in http://projects.scipy.org/scipy/numpy/ticket/573
87 # with the subtle difference that we don't want to break Darwin where
88 # -shared is not a valid linker argument
89 if [[ ${CHOST} != *-darwin* ]] ; then
90 append-ldflags -shared
91 fi
92
93 # only one fortran to link with:
94 # linking with cblas and lapack library will force
95 # autodetecting and linking to all available fortran compilers
96 use lapack || return
97 [[ -z ${FC} ]] && FC=$(tc-getFC)
98 # when fortran flags are set, pic is removed.
99 FFLAGS="${FFLAGS} -fPIC"
100 NUMPY_FCONFIG="config_fc --noopt --noarch"
101 # workaround bug 335908
102 [[ ${FC} == *gfortran* ]] && NUMPY_FCONFIG="${NUMPY_FCONFIG} --fcompiler=gnu95"
103 export NUMPY_FCONFIG
104 }
105
106 src_unpack() {
107 unpack ${P}.tar.gz
108 if use doc; then
109 unzip -qo "${DISTDIR}"/${NP}-html.zip -d html || die
110 fi
111 }
112
113 src_prepare() {
114 epatch "${FILESDIR}"/${PN}-1.1.0-f2py.patch
115 epatch "${FILESDIR}"/${PN}-1.3.0-fenv-freebsd.patch # bug 279487
116
117 # Gentoo patch for ATLAS library names
118 sed -i \
119 -e "s:'f77blas':'blas':g" \
120 -e "s:'ptf77blas':'blas':g" \
121 -e "s:'ptcblas':'cblas':g" \
122 -e "s:'lapack_atlas':'lapack':g" \
123 numpy/distutils/system_info.py \
124 || die "sed system_info.py failed"
125
126 if use lapack; then
127 append-ldflags "$(pkg-config --libs-only-other cblas lapack)"
128 sed -i -e '/NO_ATLAS_INFO/,+1d' numpy/core/setup.py || die
129 local libdir="${EPREFIX}"/usr/$(get_libdir)
130 cat >> site.cfg <<-EOF
131 [atlas]
132 include_dirs = $(pkg-config --cflags-only-I \
133 cblas | sed -e 's/^-I//' -e 's/ -I/:/g')
134 library_dirs = $(pkg-config --libs-only-L \
135 cblas blas lapack | sed -e 's/^-L//' -e 's/ -L/:/g' -e 's/ //g'):${libdir}
136 atlas_libs = $(pkg-config --libs-only-l \
137 cblas blas | sed -e 's/^-l//' -e 's/ -l/, /g' -e 's/,.pthread//g')
138 lapack_libs = $(pkg-config --libs-only-l \
139 lapack | sed -e 's/^-l//' -e 's/ -l/, /g' -e 's/,.pthread//g')
140 [blas_opt]
141 include_dirs = $(pkg-config --cflags-only-I \
142 cblas | sed -e 's/^-I//' -e 's/ -I/:/g')
143 library_dirs = $(pkg-config --libs-only-L \
144 cblas blas | sed -e 's/^-L//' -e 's/ -L/:/g' -e 's/ //g'):${libdir}
145 libraries = $(pkg-config --libs-only-l \
146 cblas blas | sed -e 's/^-l//' -e 's/ -l/, /g' -e 's/,.pthread//g')
147 [lapack_opt]
148 library_dirs = $(pkg-config --libs-only-L \
149 lapack | sed -e 's/^-L//' -e 's/ -L/:/g' -e 's/ //g'):${libdir}
150 libraries = $(pkg-config --libs-only-l \
151 lapack | sed -e 's/^-l//' -e 's/ -l/, /g' -e 's/,.pthread//g')
152 EOF
153 else
154 export {ATLAS,PTATLAS,BLAS,LAPACK,MKL}=None
155 fi
156
157 epatch "${FILESDIR}"/${PN}-1.4.0-interix.patch
158 }
159
160 src_compile() {
161 distutils_src_compile ${NUMPY_FCONFIG}
162 }
163
164 src_test() {
165 testing() {
166 "$(PYTHON)" setup.py ${NUMPY_FCONFIG} build -b "build-${PYTHON_ABI}" install \
167 --home="${S}/test-${PYTHON_ABI}" --no-compile || die "install test failed"
168 pushd "${S}/test-${PYTHON_ABI}/"lib* > /dev/null
169 PYTHONPATH=python "$(PYTHON)" -c "import numpy; numpy.test()" 2>&1 | tee test.log
170 grep -q '^ERROR' test.log && die "test failed"
171 popd > /dev/null
172 rm -fr test-${PYTHON_ABI}
173 }
174 python_execute_function testing
175 }
176
177 src_install() {
178 [[ -z ${ED} ]] && local ED=${D}
179 distutils_src_install ${NUMPY_FCONFIG}
180 dodoc THANKS.txt DEV_README.txt COMPATIBILITY
181 rm -f "${ED}"/usr/lib/python*/site-packages/numpy/*.txt || die
182 docinto f2py
183 dodoc numpy/f2py/docs/*.txt || die "dodoc f2py failed"
184 doman numpy/f2py/f2py.1 || die "doman failed"
185 if use doc; then
186 insinto /usr/share/doc/${PF}
187 doins -r "${WORKDIR}"/html || die
188 doins "${DISTDIR}"/${NP}*pdf || die
189 fi
190 }