diff options
author | Fabian Groffen <grobian@gentoo.org> | 2009-11-20 11:55:02 +0000 |
---|---|---|
committer | Fabian Groffen <grobian@gentoo.org> | 2009-11-20 11:55:02 +0000 |
commit | 0aded39491848b8042ac133fa854b89bd85d00c5 (patch) | |
tree | 714d80305118d075f4420bfb5deac6d0d41d6b1b /dev-python/numpy | |
parent | Patch out failures on memory leak tests. Calling gc() does not guarantee that... (diff) | |
download | historical-0aded39491848b8042ac133fa854b89bd85d00c5.tar.gz historical-0aded39491848b8042ac133fa854b89bd85d00c5.tar.bz2 historical-0aded39491848b8042ac133fa854b89bd85d00c5.zip |
Add patch to prevent numpy's distutils from injecting -arch flags on Darwin, while this never works (http://projects.scipy.org/numpy/ticket/1087)
Package-Manager: portage-2.2.00.14850-prefix/cvs/Darwin powerpc
Diffstat (limited to 'dev-python/numpy')
-rw-r--r-- | dev-python/numpy/ChangeLog | 10 | ||||
-rw-r--r-- | dev-python/numpy/Manifest | 4 | ||||
-rw-r--r-- | dev-python/numpy/files/numpy-1.3.0-darwin-no-arch.patch | 83 | ||||
-rw-r--r-- | dev-python/numpy/numpy-1.3.0-r2.ebuild | 131 |
4 files changed, 226 insertions, 2 deletions
diff --git a/dev-python/numpy/ChangeLog b/dev-python/numpy/ChangeLog index 6d9cf7c29b9a..b202f063ba11 100644 --- a/dev-python/numpy/ChangeLog +++ b/dev-python/numpy/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for dev-python/numpy # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-python/numpy/ChangeLog,v 1.101 2009/11/16 20:15:21 armin76 Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-python/numpy/ChangeLog,v 1.102 2009/11/20 11:55:02 grobian Exp $ + +*numpy-1.3.0-r2 (20 Nov 2009) + + 20 Nov 2009; Fabian Groffen <grobian@gentoo.org> +numpy-1.3.0-r2.ebuild, + +files/numpy-1.3.0-darwin-no-arch.patch: + Add patch to prevent numpy's distutils from injecting -arch flags on + Darwin, while this never works + (http://projects.scipy.org/numpy/ticket/1087) 16 Nov 2009; Raúl Porcel <armin76@gentoo.org> numpy-1.3.0-r1.ebuild: ia64/s390/sh/sparc stable wrt #287575 diff --git a/dev-python/numpy/Manifest b/dev-python/numpy/Manifest index 1586468ca78a..3946058a1e8e 100644 --- a/dev-python/numpy/Manifest +++ b/dev-python/numpy/Manifest @@ -1,12 +1,14 @@ AUX numpy-1.1.0-f2py.patch 1123 RMD160 ff90313cbe8282ac37b0cb98effa0ff6a03760c2 SHA1 5c37ea9be68782e533c7c2d64ca00e8e8ae648ea SHA256 cc67bc8ab7dba2febb91ba15cc51933021743a286c980e0068afd6fabdd065e7 AUX numpy-1.3.0-alpha.patch 1210 RMD160 d92ca3fa7d671da1ff8e3e2e1a6b64469cf7142b SHA1 0a8740710d7b2e40b1a8899771b641999440558b SHA256 ea0da717e694338a1bca72f1b635309be15af2cdee206b50de4b38ce95701c64 AUX numpy-1.3.0-arm-sh.patch 2166 RMD160 cc60f574ab7fe29968ebc56f9018c2427f01f6cc SHA1 59b4751c26abf837a69d8bd637bd9abb89344f72 SHA256 9b373c5b8886df971c350c44766ccdf165ffec6c2082f68704121965ad7a2f37 +AUX numpy-1.3.0-darwin-no-arch.patch 3016 RMD160 a35968a68fac400e14d5eeafb44e058825c17ed5 SHA1 35b3fa3b0ed149f2f9f906e7a81d7f3cd0260d58 SHA256 9058cb30c54314e4e8dc5e4c0e4be3178664067d1ae71b0bee9576293f8cd71d AUX numpy-1.3.0-fenv-freebsd.patch 1177 RMD160 78a84e18836472bd9c657771c43a44e417ec3e19 SHA1 4dba898255df4784eac9e52633307991c12029de SHA256 2fa3ed9fdeb9dc529d51da4ba8a3a7ea4cc4bb9998fffa66426b1606f2c637b5 AUX numpy-1.3.0-parisc.patch 474 RMD160 682971d65894aeb2e87de5f8eac717a8f7803318 SHA1 da6067bd782604119111d69fce06b7536d59f6ca SHA256 413af76d3b5518d2f544c4497110a3401d40a7ea713a7449ea8826facddbf225 DIST numpy-1.2.1.tar.gz 1448933 RMD160 7eb721d0d853f3b0b9b04a4f447353873d6c0997 SHA1 1aa706e733aea18eaffa70d93c0105718acb66c5 SHA256 4392b4b78eb503b187a6004468d2dd14d976c4b30a327e51f2277730c415003e DIST numpy-1.3.0.tar.gz 1995868 RMD160 a75155d2014204e16c59857b92356353505c39b9 SHA1 c04998a1fbf7d990c9a2b99a7b62486012c570ac SHA256 7524687cce85aa78103046db5e617c626b0ef871a203a049159f88f35647c90d EBUILD numpy-1.2.1.ebuild 4237 RMD160 523240c56efc80b8fdc32a7a0356d7bbb7d02059 SHA1 531b4656bfd3077d761c0e5074bf19cc033067cd SHA256 18d23bb2e7a8d9cc8c24e039a00b8004773f492af7ce6cd070bc6d1acdb28bc7 EBUILD numpy-1.3.0-r1.ebuild 4342 RMD160 39539db526765f240f2d613a1404fcb1339520e7 SHA1 fe2338cf12b297e30048c67306282dfbe1925317 SHA256 47f17d3a2239e0e786c523c001b09df34aa0f2a681e54515a77ffac91013b749 +EBUILD numpy-1.3.0-r2.ebuild 4400 RMD160 f9d6fbef78668742ed7801b782d7556b1ad7ca8d SHA1 175271b770ffca38ced7aa8c51a8225ddad788b5 SHA256 6df11cb0b8ac4456a5fad10f0b5ae8fe9883e9dee584e3aa5f178c8965b52350 EBUILD numpy-1.3.0.ebuild 3730 RMD160 c0d829ee7118786377feafc13bee29fd87607bce SHA1 74b47ee040e480a28e37ff3c14fa4f4ffc08f95e SHA256 03726529570ea97cc39867718c5f24e5d020425628eaa7a15210318b19fbfe09 -MISC ChangeLog 14195 RMD160 1efad2e0a215b2e1514712eeca8ca0f059ecc354 SHA1 83431dfb70dbe0221ff94266aed3ee5ed89a3124 SHA256 672b76c6619620fbd3611bf2b817e962050196177b460ace2bacf04e58502d73 +MISC ChangeLog 14497 RMD160 26e02299847c35df2b71af05323207f6da547069 SHA1 021b6140996675fa11af13e90232ebd1dfe37751 SHA256 8b79b599cf8dda67601d558435efda141e7d6e3478b950db56b7777bee28516e MISC metadata.xml 612 RMD160 efd564f99da25694c47f63432d18f5a847a65cd8 SHA1 e765c10b67fe1d43fe5bc79e56b72d2ae2b133ad SHA256 272f018a6889de8fcded00da2ced5b11549d4e455aaf8107d20e74f13bf98ce1 diff --git a/dev-python/numpy/files/numpy-1.3.0-darwin-no-arch.patch b/dev-python/numpy/files/numpy-1.3.0-darwin-no-arch.patch new file mode 100644 index 000000000000..e96611df13ff --- /dev/null +++ b/dev-python/numpy/files/numpy-1.3.0-darwin-no-arch.patch @@ -0,0 +1,83 @@ +gfortran -v happily accepts any -arch X argument, but also happily dies +during compilation that it doesn't understand -arch argument. Hence, +testing if -arch is supported like this is kind of not working well. + +Since Apple does not officially ship fortran support (any), I wonder how +universal support could have crept into this piece of code all. They +don't even have an Apple GCC compiler with fortran support (like we do +with Gentoo Prefix). + +http://projects.scipy.org/numpy/ticket/1087 + + +--- numpy/distutils/fcompiler/gnu.py ++++ numpy/distutils/fcompiler/gnu.py +@@ -12,13 +12,6 @@ + + TARGET_R = re.compile("Target: ([a-zA-Z0-9_\-]*)") + +-# XXX: do we really need to check for target ? If the arch is not supported, +-# the return code should be != 0 +-_R_ARCHS = {"ppc": r"^Target: (powerpc-.*)$", +- "i686": r"^Target: (i686-.*)$", +- "x86_64": r"^Target: (i686-.*)$", +- "ppc64": r"^Target: (powerpc-.*)$",} +- + class GnuFCompiler(FCompiler): + compiler_type = 'gnu' + compiler_aliases = ('g77',) +@@ -215,6 +208,7 @@ + # OS X: GNU Fortran 95 (GCC) 4.1.0 + # GNU Fortran 95 (GCC) 4.2.0 20060218 (experimental) + # GNU Fortran (GCC) 4.3.0 20070316 (experimental) ++ # GNU Fortran (GCC) 4.2.1 (Apple Inc. build 5574) + + possible_executables = ['gfortran', 'f95'] + executables = { +@@ -241,46 +235,6 @@ + + g2c = 'gfortran' + +- # Note that this is here instead of GnuFCompiler as gcc < 4 uses a +- # different output format (which isn't as useful) than gcc >= 4, +- # and we don't have to worry about g77 being universal (as it can't be). +- def _can_target(self, cmd, arch): +- """Return true is the compiler support the -arch flag for the given +- architecture.""" +- newcmd = cmd[:] +- newcmd.extend(["-arch", arch, "-v"]) +- st, out = exec_command(" ".join(newcmd)) +- if st == 0: +- for line in out.splitlines(): +- m = re.search(_R_ARCHS[arch], line) +- if m: +- return True +- return False +- +- def _universal_flags(self, cmd): +- """Return a list of -arch flags for every supported architecture.""" +- if not sys.platform == 'darwin': +- return [] +- arch_flags = [] +- for arch in ["ppc", "i686"]: +- if self._can_target(cmd, arch): +- arch_flags.extend(["-arch", arch]) +- return arch_flags +- +- def get_flags(self): +- flags = GnuFCompiler.get_flags(self) +- arch_flags = self._universal_flags(self.compiler_f90) +- if arch_flags: +- flags[:0] = arch_flags +- return flags +- +- def get_flags_linker_so(self): +- flags = GnuFCompiler.get_flags_linker_so(self) +- arch_flags = self._universal_flags(self.linker_so) +- if arch_flags: +- flags[:0] = arch_flags +- return flags +- + def get_library_dirs(self): + opt = GnuFCompiler.get_library_dirs(self) + if sys.platform == 'win32': diff --git a/dev-python/numpy/numpy-1.3.0-r2.ebuild b/dev-python/numpy/numpy-1.3.0-r2.ebuild new file mode 100644 index 000000000000..90c2f1d7c779 --- /dev/null +++ b/dev-python/numpy/numpy-1.3.0-r2.ebuild @@ -0,0 +1,131 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-python/numpy/numpy-1.3.0-r2.ebuild,v 1.1 2009/11/20 11:55:02 grobian Exp $ + +EAPI="2" + +NEED_PYTHON="2.4" +SUPPORT_PYTHON_ABIS="1" + +inherit distutils eutils flag-o-matic toolchain-funcs + +DESCRIPTION="Fast array and numerical python library" +SRC_URI="mirror://sourceforge/numpy/${P}.tar.gz" +HOMEPAGE="http://numpy.scipy.org/" + +RDEPEND="dev-python/setuptools + lapack? ( virtual/cblas virtual/lapack )" +DEPEND="${RDEPEND} + lapack? ( dev-util/pkgconfig ) + test? ( >=dev-python/nose-0.10 )" + +IUSE="lapack test" +SLOT="0" +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" +LICENSE="BSD" + +RESTRICT_PYTHON_ABIS="3*" + +pkg_setup() { + # whatever LDFLAGS set will break linking + # see progress in http://projects.scipy.org/scipy/numpy/ticket/573 + # with the subtle difference that we don't want to break Darwin where + # -shared is not a valid linker argument + if [[ ${CHOST} != *-darwin* ]] ; then + if [[ -n "${LDFLAGS}" ]]; then + append-ldflags -shared + else + LDFLAGS="-shared" + fi + fi + + # only one fortran to link with: + # linking with cblas and lapack library will force + # autodetecting and linking to all available fortran compilers + use lapack || return + [[ -z ${FC} ]] && FC=$(tc-getFC) + # when fortran flags are set, pic is removed. + FFLAGS="${FFLAGS} -fPIC" + export NUMPY_FCONFIG="config_fc --noopt --noarch" +} + +src_prepare() { + # Fix some paths and docs in f2py + epatch "${FILESDIR}"/${PN}-1.1.0-f2py.patch + + epatch "${FILESDIR}/${P}-parisc.patch" # bug 277438 + epatch "${FILESDIR}/${P}-alpha.patch" # bug 277438 + epatch "${FILESDIR}/${P}-arm-sh.patch" + + epatch "${FILESDIR}"/${P}-fenv-freebsd.patch # bug 279487 + epatch "${FILESDIR}"/${P}-darwin-no-arch.patch + + # Gentoo patch for ATLAS library names + sed -i \ + -e "s:'f77blas':'blas':g" \ + -e "s:'ptf77blas':'blas':g" \ + -e "s:'ptcblas':'cblas':g" \ + -e "s:'lapack_atlas':'lapack':g" \ + numpy/distutils/system_info.py \ + || die "sed system_info.py failed" + + if use lapack; then + append-ldflags "$(pkg-config --libs-only-other cblas lapack)" + sed -i -e '/NO_ATLAS_INFO/,+1d' numpy/core/setup.py || die + cat >> site.cfg <<-EOF + [atlas] + include_dirs = $(pkg-config --cflags-only-I \ + cblas | sed -e 's/^-I//' -e 's/ -I/:/g') + library_dirs = $(pkg-config --libs-only-L \ + cblas blas lapack | sed -e \ + 's/^-L//' -e 's/ -L/:/g' -e 's/ //g'):"${EPREFIX}"/usr/$(get_libdir) + atlas_libs = $(pkg-config --libs-only-l \ + cblas blas | sed -e 's/^-l//' -e 's/ -l/, /g' -e 's/,.pthread//g') + lapack_libs = $(pkg-config --libs-only-l \ + lapack | sed -e 's/^-l//' -e 's/ -l/, /g' -e 's/,.pthread//g') + [blas_opt] + include_dirs = $(pkg-config --cflags-only-I \ + cblas | sed -e 's/^-I//' -e 's/ -I/:/g') + library_dirs = $(pkg-config --libs-only-L \ + cblas blas | sed -e 's/^-L//' -e 's/ -L/:/g' \ + -e 's/ //g'):"${EPREFIX}"/usr/$(get_libdir) + libraries = $(pkg-config --libs-only-l \ + cblas blas | sed -e 's/^-l//' -e 's/ -l/, /g' -e 's/,.pthread//g') + [lapack_opt] + library_dirs = $(pkg-config --libs-only-L \ + lapack | sed -e 's/^-L//' -e 's/ -L/:/g' \ + -e 's/ //g'):"${EPREFIX}"/usr/$(get_libdir) + libraries = $(pkg-config --libs-only-l \ + lapack | sed -e 's/^-l//' -e 's/ -l/, /g' -e 's/,.pthread//g') + EOF + else + export {ATLAS,PTATLAS,BLAS,LAPACK,MKL}=None + fi +} + +src_compile() { + distutils_src_compile ${NUMPY_FCONFIG} +} + +src_test() { + testing() { + "$(PYTHON)" setup.py ${NUMPY_FCONFIG} build -b "build-${PYTHON_ABI}" install \ + --home="${S}/test-${PYTHON_ABI}" --no-compile || die "install test failed" + pushd "${S}/test-${PYTHON_ABI}/"lib* > /dev/null + PYTHONPATH=python "$(PYTHON)" -c "import numpy; numpy.test()" 2>&1 | tee test.log + grep -q '^ERROR' test.log && die "test failed" + popd > /dev/null + rm -fr test-${PYTHON_ABI} + } + python_execute_function testing +} + +src_install() { + [[ -z ${ED} ]] && local ED=${D} + distutils_src_install ${NUMPY_FCONFIG} + dodoc THANKS.txt DEV_README.txt COMPATIBILITY + rm -f "${ED}"/usr/lib/python*/site-packages/numpy/*.txt || die + docinto f2py + dodoc numpy/f2py/docs/*.txt || die "dodoc f2py failed" + doman numpy/f2py/f2py.1 || die "doman failed" +} |