summaryrefslogtreecommitdiff
path: root/dev-python/numpy
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/numpy')
-rw-r--r--dev-python/numpy/Manifest2
-rw-r--r--dev-python/numpy/files/replace_cpuflags.awk14
-rw-r--r--dev-python/numpy/numpy-1.24.4-r1.ebuild186
3 files changed, 202 insertions, 0 deletions
diff --git a/dev-python/numpy/Manifest b/dev-python/numpy/Manifest
index 92496ae84bd6..f3db27d4236f 100644
--- a/dev-python/numpy/Manifest
+++ b/dev-python/numpy/Manifest
@@ -3,6 +3,7 @@ AUX numpy-1.24.3-fix-c++-linkage.patch 993 BLAKE2B 9ad31b995b209ea0674ee144a72df
AUX numpy-1.25.0-fix-long-double-check.patch 5788 BLAKE2B c004fa342349a22dda30566d3015257146cee89e5b15c32d9b0bdbd44f4c7be76749f248e792d9ffd77ea8a674a2dfe0d183a9de48a1bb0f450e7a3f2f9688b0 SHA512 d2ecea4bc1878cb3df1b730b705bfa445f8f74356a5232de7ef5c94624847703985ac51d6b5bc3b961be6ef4b854804a531b5645e57ae4f6197d5aedb2e1c459
AUX numpy-1.25.0-skip-python3.12-irrelevant-tests.patch 7363 BLAKE2B ca4581f61fb1350803915bcc8e3198bd13c75e0c7e178c86e72682222cbafff396f23afad9d7427d9d2a4be625f84626c899493045a0b8cc7ee3d031d36712c3 SHA512 cce36c856beb2254436f2753ed94b7a933d1e4c06fe0a96c2be70d944f91bb13f3358f50981398d0b9169c0e01b64695c3adb797db15cb6b695488318e276886
AUX numpy-1.25.0_rc1-meson-pyproject.toml.patch 16917 BLAKE2B 6cdda647c1c4f003adcaff3d634cbaa2f6c1624f2e44bfff1b6542189693a1dc99bf8a3da38d5e9a5dd2b3a6382d0430f03eb3c39811cf3b72e85a1bbae9ea0e SHA512 0a51b1c84356704f373ba1188dc63152e45fdb7bc71881e8ab08b67bfbf2e8f1e9b5544eedf6e3d8b4b872e294e28233e9f059dfdad42ff835bba22ee66d0d93
+AUX replace_cpuflags.awk 405 BLAKE2B 1ac5f362a174793274a2e63fad73a7cf260b1fb139c479279c8cad7f400a376712b17312ee41defb785a7a2c84ec8e679aae48b41e88394a816f12f1cd366e56 SHA512 cce2253e00e2e56f3038782ff989703a9ef3d5f97d1b1f2570f6e23396d7abb7cff7f34588b67ec6c395cb192d7e3bfa6a8262ddf45193a2d0c91c2063efcf6d
DIST numpy-1.24.0.tar.gz 10897101 BLAKE2B 59e2b913f90de76589d8fbb2f07e2d389012c7f6ce9bd641bc4837776465ce9c41c34f19f92bee55d4bae6245c1d2c84315b359ef0b089fd68d31cd7e7ec44b1 SHA512 3b4e6255b8d39e8504a50ecd3c2ba09d5b16d3f6c70b23b67e4dbf03d1fe390c55030f46090341d39a1ee8228c61ad6212fdc6e4579fcec9e26b4dbe70268661
DIST numpy-1.24.2.tar.gz 10906862 BLAKE2B e48f65eab709f0c57ec378d813a7b65bcaca6d5960b559d6db1c60726e5cf12517f4b2e1636b0ff815a2109925edccba200270db5170fd0aff5fd635919165ac SHA512 145fd7fb3919a185f75076d51b92c54a7fb1b776b637752ca15fdee15b239d6a517ef1bb8cded7c92e059cf6cda0146c24943c042d19b791e81125bc0ad4b820
DIST numpy-1.24.3.tar.gz 10909904 BLAKE2B 3b14f8b6a7bd484de43c3b0e57f161388d6226e05ed9bc3d1edfaafc713b9597c7574b9b9c20b4e3a6bd291d32a607d95c72d6e25fa346ffdaf97c94767bc315 SHA512 d4b5841cbe68ee6653f99018e4e0182f2e5519a1cd69c14e0a95aa180f878e6a6786ccf0a7c78bf0d511c53e7535d7144fee428572dec7a4b60b25c8a1c0c9e1
@@ -12,6 +13,7 @@ EBUILD numpy-1.24.0.ebuild 4196 BLAKE2B a7359b00b007339381f458502457b2d2f9f07daf
EBUILD numpy-1.24.2.ebuild 4366 BLAKE2B a7a396b29efaf6a07bd68f76e0cae0d069f530a4d4d915b89cf5a47a42a4e9cf29215089f0a8f819fd24961280fe83f103f28b6be90758eb78f3f408ab5eb23b SHA512 b1186214bf08642b6ca267d0a84ec03c8f4b6256e728eb17d789eb34a43760bf87ea18696ef30b12494bff23a3b8b6f1980085c900c5341c8d43b8da468549f5
EBUILD numpy-1.24.3-r1.ebuild 4628 BLAKE2B f6562a9a62262c0b78105ae9033537c65ee06ba79df7fb8e7ad6ecde01c7393dfc5e13234446e1642aaa3b05b1c8e9af4c7b6854a3c3a5f85931b259fb82d574 SHA512 ace98f02994fd18fb67e2879c2bcbe6fba39ed16cc3ee43acb75f50755175b4c6dfe6d72a21eb28a86e5ec2638f07ba6506d38a89b4b3155c41ba1827459f951
EBUILD numpy-1.24.3.ebuild 4581 BLAKE2B bf5f6eebf4a61a9d6c78c1e203db03e29f53064df3edabb2e2b1a0dc44abd5a13003d1d6d85e29eac3f44a5dfaeaf690be6f014896b0eed5fb1bb47a76b56916 SHA512 8900cb724bfeb570c812f073ce4b53c5242c342183d160950cedff2ae7159638f717a8006aed7f9f451e8bb3bd48830c975b0494aebe69e0f3189340f03df22a
+EBUILD numpy-1.24.4-r1.ebuild 5143 BLAKE2B 97c445ff3e3707ca421994f7fa35b8502023ab7b6ec5fc567a2cc6b29478f67b9d3a9703bc817b36c97d0d4abbe1cf34437959dee5345041fd148348b58729eb SHA512 c5d0862c089a7503f9e1db587c2269bdc23e58085db0fdc5515e22d74c26011e80919628178f332e896b60664136053e5cdd7cb63ab8d981f78580716f14ab45
EBUILD numpy-1.24.4.ebuild 4628 BLAKE2B f6562a9a62262c0b78105ae9033537c65ee06ba79df7fb8e7ad6ecde01c7393dfc5e13234446e1642aaa3b05b1c8e9af4c7b6854a3c3a5f85931b259fb82d574 SHA512 ace98f02994fd18fb67e2879c2bcbe6fba39ed16cc3ee43acb75f50755175b4c6dfe6d72a21eb28a86e5ec2638f07ba6506d38a89b4b3155c41ba1827459f951
EBUILD numpy-1.25.0-r2.ebuild 3970 BLAKE2B 1c389a3487d90170531396cdd2c84891280724d33771e5c7e49c5eeb15bae338d1becc232f76d7183a880b633a0da6119b301e320a6f37f9a8adf5376c20115c SHA512 f3a6ec2f32237913c0ed18d829b6495dfc609824a4c89b436b67b3d4313d8fc10510f25b44741e265340dc447e696fed8d2339158c84b81259bd22a79f7240f6
MISC metadata.xml 932 BLAKE2B 7a4af31f613bab05ff542da48bf6ff1484d9df2459f559516e71329451dd739d3df0fead507c8033d94ab9ed516b68efe7f21819a8cd6ca303643d8c8bc34e86 SHA512 32cb8c1ab61521a02cbec38f6ea383f074e50d46aa3462ddcb85710f9d348e8e628cf2a5725e3cd921cc32f02885a1b5f02125639f0ec885384eeeff7f468a06
diff --git a/dev-python/numpy/files/replace_cpuflags.awk b/dev-python/numpy/files/replace_cpuflags.awk
new file mode 100644
index 000000000000..11b8bd53b2c3
--- /dev/null
+++ b/dev-python/numpy/files/replace_cpuflags.awk
@@ -0,0 +1,14 @@
+#!/usr/bin/awk -f
+
+{
+ GENTOO_ENABLE=1;
+ if (match($0, /flags="([^"=]*)"/, cflags)) {
+ split(cflags[1], fields);
+ for (i in fields) {
+ if (match(fields[i], /-m([[:graph:]]*)/, inst)) {
+ if (!index(enabled_flags, inst[1])) {
+ GENTOO_ENABLE=0;
+ }}}}
+ if (!GENTOO_ENABLE) { sub(cflags[1], "-mGENTOO_DISABLE"); }
+ print;
+}
diff --git a/dev-python/numpy/numpy-1.24.4-r1.ebuild b/dev-python/numpy/numpy-1.24.4-r1.ebuild
new file mode 100644
index 000000000000..2166e7e7a52d
--- /dev/null
+++ b/dev-python/numpy/numpy-1.24.4-r1.ebuild
@@ -0,0 +1,186 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_EXT=1
+PYTHON_COMPAT=( python3_{9..11} pypy3 )
+PYTHON_REQ_USE="threads(+)"
+
+FORTRAN_NEEDED=lapack
+
+inherit distutils-r1 flag-o-matic fortran-2 multiprocessing pypi
+inherit toolchain-funcs
+
+DOC_PV=${PV}
+DESCRIPTION="Fast array and numerical python library"
+HOMEPAGE="
+ https://numpy.org/
+ https://github.com/numpy/numpy/
+ https://pypi.org/project/numpy/
+"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris"
+CPU_FLAGS_X86=( avx avx2 avx512dq avx512f avx512vl f16c fma4 popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3 xop )
+IUSE="lapack $(printf "cpu_flags_x86_%s\n" ${CPU_FLAGS_X86[@]})"
+
+RDEPEND="
+ lapack? (
+ >=virtual/cblas-3.8
+ >=virtual/lapack-3.8
+ )
+"
+BDEPEND="
+ ${RDEPEND}
+ <dev-python/cython-3[${PYTHON_USEDEP}]
+ >=dev-python/cython-0.29.30[${PYTHON_USEDEP}]
+ lapack? (
+ virtual/pkgconfig
+ )
+ test? (
+ $(python_gen_cond_dep '
+ >=dev-python/cffi-1.14.0[${PYTHON_USEDEP}]
+ ' 'python*')
+ dev-python/charset-normalizer[${PYTHON_USEDEP}]
+ >=dev-python/hypothesis-5.8.0[${PYTHON_USEDEP}]
+ dev-python/pytest-xdist[${PYTHON_USEDEP}]
+ >=dev-python/pytz-2019.3[${PYTHON_USEDEP}]
+ )
+"
+
+PATCHES=(
+ "${FILESDIR}"/numpy-1.22.0-no-hardcode-blasv2.patch
+ "${FILESDIR}"/numpy-1.24.3-fix-c++-linkage.patch
+)
+
+distutils_enable_tests pytest
+
+python_prepare_all() {
+ # Allow use with setuptools 60.x
+ # See numpy-1.22.1-revert-setuptools-upper-bound.patch for details
+ export SETUPTOOLS_USE_DISTUTILS=stdlib
+
+ if use lapack; then
+ local incdir="${EPREFIX}"/usr/include
+ local libdir="${EPREFIX}"/usr/$(get_libdir)
+ cat >> site.cfg <<-EOF || die
+ [blas]
+ include_dirs = ${incdir}
+ library_dirs = ${libdir}
+ blas_libs = cblas,blas
+ [lapack]
+ library_dirs = ${libdir}
+ lapack_libs = lapack
+ EOF
+ else
+ export {ATLAS,PTATLAS,BLAS,LAPACK,MKL}=None
+ fi
+
+ export CC="$(tc-getCC) ${CFLAGS}"
+
+ append-flags -fno-strict-aliasing
+
+ # 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
+ append-ldflags -shared
+ fi
+
+ # only one fortran to link with:
+ # linking with cblas and lapack library will force
+ # autodetecting and linking to all available fortran compilers
+ append-fflags -fPIC
+ if use lapack; then
+ NUMPY_FCONFIG="config_fc --noopt --noarch"
+ # workaround bug 335908
+ [[ $(tc-getFC) == *gfortran* ]] && NUMPY_FCONFIG+=" --fcompiler=gnu95"
+ fi
+
+ # don't version f2py, we will handle it.
+ sed -i -e '/f2py_exe/s: + os\.path.*$::' numpy/f2py/setup.py || die
+
+ # The following has no effect on architectures other than x86 and amd64.
+ local flag enabled_flags=()
+ for flag in "${CPU_FLAGS_X86[@]}"; do
+ use cpu_flags_x86_${flag} && enabled_flags+=( ${flag/_/.} )
+ done
+ gawk -i inplace -v "enabled_flags=${enabled_flags[*]}" \
+ -f "${FILESDIR}"/replace_cpuflags.awk \
+ numpy/distutils/ccompiler_opt.py || die
+
+ distutils-r1_python_prepare_all
+}
+
+python_compile() {
+ local -x MAKEOPTS=-j1 #660754
+
+ distutils-r1_python_compile ${NUMPY_FCONFIG}
+}
+
+python_test() {
+ local EPYTEST_DESELECT=(
+ # very disk- and memory-hungry
+ numpy/lib/tests/test_histograms.py::TestHistogram::test_big_arrays
+ numpy/lib/tests/test_io.py::test_large_zip
+
+ # precision problems
+ numpy/core/tests/test_umath_accuracy.py::TestAccuracy::test_validate_transcendentals
+
+ # runs the whole test suite recursively, that's just crazy
+ numpy/core/tests/test_mem_policy.py::test_new_policy
+
+ # very slow, unlikely to be practically useful
+ numpy/typing/tests/test_typing.py
+ )
+
+ if use arm && [[ $(uname -m || echo "unknown") == "armv8l" ]] ; then
+ # Degenerate case. arm32 chroot on arm64.
+ # bug #774108
+ EPYTEST_DESELECT+=(
+ numpy/core/tests/test_cpu_features.py::Test_ARM_Features::test_features
+ )
+ fi
+
+ if use x86 ; then
+ EPYTEST_DESELECT+=(
+ # https://github.com/numpy/numpy/issues/18388
+ numpy/core/tests/test_umath.py::TestRemainder::test_float_remainder_overflow
+ # https://github.com/numpy/numpy/issues/18387
+ numpy/random/tests/test_generator_mt19937.py::TestRandomDist::test_pareto
+ # more precision problems
+ numpy/core/tests/test_einsum.py::TestEinsum::test_einsum_sums_int16
+ )
+ fi
+
+ case "${ABI}" in
+ alpha|arm|hppa|m68k|o32|ppc|s390|sh|sparc|x86)
+ EPYTEST_DESELECT+=(
+ # too large for 32-bit platforms
+ numpy/core/tests/test_ufunc.py::TestUfunc::test_identityless_reduction_huge_array
+ )
+ ;;
+ *)
+ ;;
+ esac
+
+ distutils_install_for_testing --single-version-externally-managed \
+ --record "${TMPDIR}/record.txt" ${NUMPY_FCONFIG}
+
+ cd "${TEST_DIR}/lib" || die
+ epytest -k "not _fuzz" -n "$(makeopts_jobs)"
+}
+
+python_install() {
+ # https://github.com/numpy/numpy/issues/16005
+ local mydistutilsargs=( build_src )
+ distutils-r1_python_install ${NUMPY_FCONFIG}
+ python_optimize
+}
+
+python_install_all() {
+ local DOCS=( LICENSE.txt README.md THANKS.txt )
+ distutils-r1_python_install_all
+}