diff options
author | Justin Bronder <jsbronder@gentoo.org> | 2008-01-11 17:06:19 +0000 |
---|---|---|
committer | Justin Bronder <jsbronder@gentoo.org> | 2008-01-11 17:06:19 +0000 |
commit | dc67c4e9abb2f6b0b86085ace2ae59a712570910 (patch) | |
tree | 5d191640b9be4ed7027ca1529889a5e802d500f6 /dev-python | |
parent | this revision removes cairo and X USE-fag as they are pretty redundant and sh... (diff) | |
download | gentoo-2-dc67c4e9abb2f6b0b86085ace2ae59a712570910.tar.gz gentoo-2-dc67c4e9abb2f6b0b86085ace2ae59a712570910.tar.bz2 gentoo-2-dc67c4e9abb2f6b0b86085ace2ae59a712570910.zip |
Fix cpuinfo to correctly detect nocona-based hardware. Bug 183236.
(Portage version: 2.1.3.19)
Diffstat (limited to 'dev-python')
-rw-r--r-- | dev-python/numpy/ChangeLog | 8 | ||||
-rw-r--r-- | dev-python/numpy/files/digest-numpy-1.0.4-r1 | 3 | ||||
-rw-r--r-- | dev-python/numpy/files/numpy-1.0.4-nocona-cpuinfo.patch | 26 | ||||
-rw-r--r-- | dev-python/numpy/numpy-1.0.4-r1.ebuild | 115 |
4 files changed, 151 insertions, 1 deletions
diff --git a/dev-python/numpy/ChangeLog b/dev-python/numpy/ChangeLog index b58be917ce22..a7e76b8b2fe0 100644 --- a/dev-python/numpy/ChangeLog +++ b/dev-python/numpy/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for dev-python/numpy # Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-python/numpy/ChangeLog,v 1.48 2008/01/04 14:16:44 bicatali Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-python/numpy/ChangeLog,v 1.49 2008/01/11 17:06:18 jsbronder Exp $ + +*numpy-1.0.4-r1 (11 Jan 2008) + + 11 Jan 2008; Justin Bronder <jsbronder@gentoo.org> + +files/numpy-1.0.4-nocona-cpuinfo.patch, +numpy-1.0.4-r1.ebuild: + Fix cpuinfo to correctly detect nocona-based hardware. Bug 183236. 04 Jan 2008; Sébastien Fabbro <bicatali@gentoo.org> -numpy-1.0.3.ebuild, -numpy-1.0.3.1.ebuild: diff --git a/dev-python/numpy/files/digest-numpy-1.0.4-r1 b/dev-python/numpy/files/digest-numpy-1.0.4-r1 new file mode 100644 index 000000000000..2abfed99cb45 --- /dev/null +++ b/dev-python/numpy/files/digest-numpy-1.0.4-r1 @@ -0,0 +1,3 @@ +MD5 8f011e9d7697da570efaac61c51725e0 numpy-1.0.4.tar.gz 1547541 +RMD160 8ac192ad3f36a94a45c26e0c4028fdbb744881f5 numpy-1.0.4.tar.gz 1547541 +SHA256 b993ecc060aa2bdca9a45a552f4ea77d96959ce0f429d5f9019e05738d68c9bd numpy-1.0.4.tar.gz 1547541 diff --git a/dev-python/numpy/files/numpy-1.0.4-nocona-cpuinfo.patch b/dev-python/numpy/files/numpy-1.0.4-nocona-cpuinfo.patch new file mode 100644 index 000000000000..7b344ad8f9f5 --- /dev/null +++ b/dev-python/numpy/files/numpy-1.0.4-nocona-cpuinfo.patch @@ -0,0 +1,26 @@ +diff -urN numpy-1.0.4/numpy/distutils/cpuinfo.py numpy-1.0.4-patched/numpy/distutils/cpuinfo.py +--- numpy-1.0.4/numpy/distutils/cpuinfo.py 2007-11-07 17:05:15.000000000 -0500 ++++ numpy-1.0.4-patched/numpy/distutils/cpuinfo.py 2008-01-11 11:44:23.000000000 -0500 +@@ -222,7 +222,12 @@ + return self.is_PentiumIV() and self.has_sse3() + + def _is_Nocona(self): +- return self.is_64bit() and self.is_PentiumIV() ++ return self.is_Intel() \ ++ and ( self.info[0]['cpu family'] == '6' \ ++ or self.info[0]['cpu family'] == '15' ) \ ++ and self.has_sse3() \ ++ and re.match(r'.*?\blm\b',self.info[0]['flags']) is not None ++ + + def _is_Core2(self): + return self.is_64bit() and self.is_Intel() and \ +@@ -263,7 +268,7 @@ + return re.match(r'.*?\bsse2\b',self.info[0]['flags']) is not None + + def _has_sse3(self): +- return re.match(r'.*?\bsse3\b',self.info[0]['flags']) is not None ++ return re.match(r'.*?\bsss?e3\b',self.info[0]['flags']) is not None + + def _has_3dnow(self): + return re.match(r'.*?\b3dnow\b',self.info[0]['flags']) is not None diff --git a/dev-python/numpy/numpy-1.0.4-r1.ebuild b/dev-python/numpy/numpy-1.0.4-r1.ebuild new file mode 100644 index 000000000000..7c52a81ff9f6 --- /dev/null +++ b/dev-python/numpy/numpy-1.0.4-r1.ebuild @@ -0,0 +1,115 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-python/numpy/numpy-1.0.4-r1.ebuild,v 1.1 2008/01/11 17:06:18 jsbronder Exp $ + +NEED_PYTHON=2.3 + +inherit distutils eutils flag-o-matic + +MY_P=${P/_beta/b} +MY_P=${MY_P/_} + +DESCRIPTION="Python array processing for numbers, strings, records, and objects" +SRC_URI="mirror://sourceforge/numpy/${MY_P}.tar.gz" +HOMEPAGE="http://numeric.scipy.org/" + +RDEPEND="!dev-python/f2py + lapack? ( virtual/cblas virtual/lapack )" +DEPEND="${RDEPEND} + lapack? ( dev-util/pkgconfig )" + +IUSE="lapack" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd" +LICENSE="BSD" + +S="${WORKDIR}/${MY_P}" + +# whatever LDFLAGS set will break linking +# see progress in http://projects.scipy.org/scipy/numpy/ticket/573 +[ -n "${LDFLAGS}" ] && append-ldflags -shared + +# ex usage: pkgconf_cfg --libs-only-l cblas: ['cblas','atlas'] +pkgconf_cfg() { + local cfg="[" + for i in $(pkg-config "$1" "$2"); do + cfg="${cfg}'${i:2}'" + done + echo "${cfg//\'\'/','}]" +} + +src_unpack() { + unpack ${A} + cd "${S}" + + # Fix some paths and docs in f2py + epatch "${FILESDIR}"/${PN}-1.0.1-f2py.patch + + # Patch to use feclearexcept(3) rather than fpsetsticky(3) on FreeBSD 5.3+ + epatch "${FILESDIR}"/${P}-freebsd.patch + + # Detect nocona hardware correctly. Bug #183236. + epatch "${FILESDIR}"/${PN}-1.0.4-nocona-cpuinfo.patch + + # Gentoo patch for ATLAS library names + sed -i \ + -e "s:'f77blas':'blas':g" \ + -e "s:'ptblas':'blas':g" \ + -e "s:'ptcblas':'cblas':g" \ + -e "s:'lapack_atlas':'lapack':g" \ + numpy/distutils/system_info.py \ + || die "sed system_info.py failed" + + export BLAS=None + export LAPACK=None + export ATLAS=None + export PTATLAS=None + export MKL=None + + if use lapack; then + unset BLAS LAPACK + cat > site.cfg <<-EOF + [blas] + blas_libs = $(pkgconf_cfg --libs-only-l cblas) + library_dirs = $(pkgconf_cfg --libs-only-L cblas) + + [lapack] + lapack_libs = $(pkgconf_cfg --libs-only-l lapack) + library_dirs = $(pkgconf_cfg --libs-only-L lapack) + EOF + fi +} + +src_test() { + "${python}" setup.py install \ + --home="${S}"/test \ + --no-compile \ + || die "install test failed" + + pushd "${S}"/test/lib*/python + PYTHONPATH=. "${python}" -c "import numpy; numpy.test(10,3)" 2>&1 \ + | tee test.log + grep -q '^OK$' test.log || die "test failed" + popd + + rm -rf test +} + +src_install() { + distutils_src_install + + docinto numpy + dodoc numpy/doc/*txt || die "dodoc failed" + + docinto f2py + dodoc numpy/f2py/docs/*txt || die "dodoc f2py failed" + doman numpy/f2py/f2py.1 || die "doman failed" +} + +pkg_postinst() { + if ! built_with_use sys-devel/gcc fortran && ! has_version dev-lang/ifc; then + ewarn "To use numpy's f2py you need a fortran compiler." + ewarn "You can either set USE=fortran flag and re-emerge gcc," + ewarn "or emerge dev-lang/ifc" + fi +} |