summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/python
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/python')
-rw-r--r--meta/recipes-devtools/python/python3-numpy/0001-numpy-core-Define-RISCV-32-support.patch52
-rw-r--r--meta/recipes-devtools/python/python3-numpy_2.1.3.bb (renamed from meta/recipes-devtools/python/python3-numpy_1.26.4.bb)26
2 files changed, 46 insertions, 32 deletions
diff --git a/meta/recipes-devtools/python/python3-numpy/0001-numpy-core-Define-RISCV-32-support.patch b/meta/recipes-devtools/python/python3-numpy/0001-numpy-core-Define-RISCV-32-support.patch
index 676bdbb3af..6da9047ec5 100644
--- a/meta/recipes-devtools/python/python3-numpy/0001-numpy-core-Define-RISCV-32-support.patch
+++ b/meta/recipes-devtools/python/python3-numpy/0001-numpy-core-Define-RISCV-32-support.patch
@@ -1,42 +1,50 @@
1From eb6d6579150bf4684603ce377c51e90ad3bb8109 Mon Sep 17 00:00:00 2001 1From 0e2b652a0eff85798584116c905a2d6ad8f25d5f Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Sun, 15 Nov 2020 15:32:39 -0800 3Date: Sun, 15 Nov 2020 15:32:39 -0800
4Subject: [PATCH] numpy/core: Define RISCV-32 support 4Subject: [PATCH] numpy/core: Define RISCV-32 support
5 5
6Helps compile on riscv32 6Helps compile on riscv32
7 7
8Upstream-Status: Submitted [https://github.com/numpy/numpy/pull/17780] 8Upstream-Status: Backport
9(https://github.com/numpy/numpy/pull/17780/commits/0e2b652a0eff85798584116c905a2d6ad8f25d5f)
10
9Signed-off-by: Khem Raj <raj.khem@gmail.com> 11Signed-off-by: Khem Raj <raj.khem@gmail.com>
10--- 12---
11 numpy/core/include/numpy/npy_cpu.h | 3 +++ 13 numpy/_core/include/numpy/npy_cpu.h | 9 +++++++--
12 numpy/core/include/numpy/npy_endian.h | 1 + 14 numpy/_core/include/numpy/npy_endian.h | 1 +
13 2 files changed, 4 insertions(+) 15 2 files changed, 8 insertions(+), 2 deletions(-)
14 16
15diff --git a/numpy/core/include/numpy/npy_cpu.h b/numpy/core/include/numpy/npy_cpu.h 17diff --git a/numpy/_core/include/numpy/npy_cpu.h b/numpy/_core/include/numpy/npy_cpu.h
16index 78d229e..04be511 100644 18index a19f8e6bbd..15f9f12931 100644
17--- a/numpy/core/include/numpy/npy_cpu.h 19--- a/numpy/_core/include/numpy/npy_cpu.h
18+++ b/numpy/core/include/numpy/npy_cpu.h 20+++ b/numpy/_core/include/numpy/npy_cpu.h
19@@ -19,6 +19,7 @@ 21@@ -18,6 +18,7 @@
22 * NPY_CPU_ARCEL
20 * NPY_CPU_ARCEB 23 * NPY_CPU_ARCEB
21 * NPY_CPU_RISCV64 24 * NPY_CPU_RISCV64
22 * NPY_CPU_LOONGARCH
23+ * NPY_CPU_RISCV32 25+ * NPY_CPU_RISCV32
26 * NPY_CPU_LOONGARCH
24 * NPY_CPU_WASM 27 * NPY_CPU_WASM
25 */ 28 */
26 #ifndef NUMPY_CORE_INCLUDE_NUMPY_NPY_CPU_H_ 29@@ -102,8 +103,12 @@
27@@ -104,6 +105,8 @@ 30 #define NPY_CPU_ARCEL
31 #elif defined(__arc__) && defined(__BIG_ENDIAN__)
28 #define NPY_CPU_ARCEB 32 #define NPY_CPU_ARCEB
29 #elif defined(__riscv) && defined(__riscv_xlen) && __riscv_xlen == 64 33-#elif defined(__riscv) && defined(__riscv_xlen) && __riscv_xlen == 64
30 #define NPY_CPU_RISCV64 34- #define NPY_CPU_RISCV64
31+#elif defined(__riscv) && defined(__riscv_xlen) && __riscv_xlen == 32 35+#elif defined(__riscv)
32+ #define NPY_CPU_RISCV32 36+ #if __riscv_xlen == 64
37+ #define NPY_CPU_RISCV64
38+ #elif __riscv_xlen == 32
39+ #define NPY_CPU_RISCV32
40+ #endif
33 #elif defined(__loongarch__) 41 #elif defined(__loongarch__)
34 #define NPY_CPU_LOONGARCH 42 #define NPY_CPU_LOONGARCH
35 #elif defined(__EMSCRIPTEN__) 43 #elif defined(__EMSCRIPTEN__)
36diff --git a/numpy/core/include/numpy/npy_endian.h b/numpy/core/include/numpy/npy_endian.h 44diff --git a/numpy/_core/include/numpy/npy_endian.h b/numpy/_core/include/numpy/npy_endian.h
37index 5e58a7f..0926212 100644 45index 5e58a7f52c..09262120bf 100644
38--- a/numpy/core/include/numpy/npy_endian.h 46--- a/numpy/_core/include/numpy/npy_endian.h
39+++ b/numpy/core/include/numpy/npy_endian.h 47+++ b/numpy/_core/include/numpy/npy_endian.h
40@@ -49,6 +49,7 @@ 48@@ -49,6 +49,7 @@
41 || defined(NPY_CPU_PPC64LE) \ 49 || defined(NPY_CPU_PPC64LE) \
42 || defined(NPY_CPU_ARCEL) \ 50 || defined(NPY_CPU_ARCEL) \
@@ -46,5 +54,5 @@ index 5e58a7f..0926212 100644
46 || defined(NPY_CPU_WASM) 54 || defined(NPY_CPU_WASM)
47 #define NPY_BYTE_ORDER NPY_LITTLE_ENDIAN 55 #define NPY_BYTE_ORDER NPY_LITTLE_ENDIAN
48-- 56--
492.20.1 572.39.5
50 58
diff --git a/meta/recipes-devtools/python/python3-numpy_1.26.4.bb b/meta/recipes-devtools/python/python3-numpy_2.1.3.bb
index fa78b07f48..da75dff1e0 100644
--- a/meta/recipes-devtools/python/python3-numpy_1.26.4.bb
+++ b/meta/recipes-devtools/python/python3-numpy_2.1.3.bb
@@ -3,7 +3,7 @@ HOMEPAGE = "https://numpy.org/"
3DESCRIPTION = "NumPy is the fundamental package needed for scientific computing with Python." 3DESCRIPTION = "NumPy is the fundamental package needed for scientific computing with Python."
4SECTION = "devel/python" 4SECTION = "devel/python"
5LICENSE = "BSD-3-Clause & BSD-2-Clause & PSF-2.0 & Apache-2.0 & MIT" 5LICENSE = "BSD-3-Clause & BSD-2-Clause & PSF-2.0 & Apache-2.0 & MIT"
6LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=a752eb20459cf74a9d84ee4825e8317c" 6LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=1de863c37a83e71b1e97b64d036ea78b"
7 7
8SRCNAME = "numpy" 8SRCNAME = "numpy"
9 9
@@ -13,22 +13,31 @@ SRC_URI = "${GITHUB_BASE_URI}/download/v${PV}/${SRCNAME}-${PV}.tar.gz \
13 file://fix_reproducibility.patch \ 13 file://fix_reproducibility.patch \
14 file://run-ptest \ 14 file://run-ptest \
15 " 15 "
16SRC_URI[sha256sum] = "2a02aba9ed12e4ac4eb3ea9421c420301a0c6460d9830d74a9df87efa4912010" 16SRC_URI[sha256sum] = "aa08e04e08aaf974d4458def539dece0d28146d866a39da5639596f4921fd761"
17 17
18GITHUB_BASE_URI = "https://github.com/numpy/numpy/releases" 18GITHUB_BASE_URI = "https://github.com/numpy/numpy/releases"
19UPSTREAM_CHECK_REGEX = "releases/tag/v?(?P<pver>\d+(\.\d+)+)$" 19UPSTREAM_CHECK_REGEX = "releases/tag/v?(?P<pver>\d+(\.\d+)+)$"
20 20
21inherit ptest setuptools3 github-releases cython 21inherit ptest python_mesonpy github-releases cython
22 22
23S = "${WORKDIR}/numpy-${PV}" 23S = "${WORKDIR}/numpy-${PV}"
24 24
25CLEANBROKEN = "1" 25# Remove references to buildpaths from numpy's __config__.py
26do_install:append() {
27 sed -i \
28 -e 's|${S}=||g' \
29 -e 's|${B}=||g' \
30 -e 's|${RECIPE_SYSROOT_NATIVE}=||g' \
31 -e 's|${RECIPE_SYSROOT_NATIVE}||g' \
32 -e 's|${RECIPE_SYSROOT}=||g' \
33 -e 's|${RECIPE_SYSROOT}||g' ${D}${PYTHON_SITEPACKAGES_DIR}/numpy/__config__.py
26 34
27do_compile:prepend() { 35 nativepython3 -mcompileall -s ${D} ${D}${PYTHON_SITEPACKAGES_DIR}/numpy/__config__.py
28 export NPY_DISABLE_SVML=1
29} 36}
30 37
31FILES:${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/numpy/core/lib/*.a ${PYTHON_SITEPACKAGES_DIR}/numpy/random/lib/*.a" 38FILES:${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/numpy/_core/lib/*.a \
39 ${PYTHON_SITEPACKAGES_DIR}/numpy/random/lib/*.a \
40"
32 41
33# install what is needed for numpy.test() 42# install what is needed for numpy.test()
34RDEPENDS:${PN} = "python3-unittest \ 43RDEPENDS:${PN} = "python3-unittest \
@@ -59,7 +68,4 @@ RDEPENDS:${PN}-ptest += "python3-pytest \
59 ldd \ 68 ldd \
60" 69"
61 70
62# Upstream has a pyproject.toml but as of 1.26.4 it's marked as experimental
63INSANE_SKIP = "pep517-backend"
64
65BBCLASSEXTEND = "native nativesdk" 71BBCLASSEXTEND = "native nativesdk"