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-Don-t-search-usr-and-so-on-for-libraries-by-default-.patch72
-rw-r--r--meta/recipes-devtools/python/python3-numpy/0001-numpy-core-Define-RISCV-32-support.patch56
-rw-r--r--meta/recipes-devtools/python/python3-numpy/run-ptest5
-rw-r--r--meta/recipes-devtools/python/python3-numpy_1.21.4.bb58
4 files changed, 191 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python3-numpy/0001-Don-t-search-usr-and-so-on-for-libraries-by-default-.patch b/meta/recipes-devtools/python/python3-numpy/0001-Don-t-search-usr-and-so-on-for-libraries-by-default-.patch
new file mode 100644
index 0000000000..9f5f25f9b5
--- /dev/null
+++ b/meta/recipes-devtools/python/python3-numpy/0001-Don-t-search-usr-and-so-on-for-libraries-by-default-.patch
@@ -0,0 +1,72 @@
1From 27f6687e49bf555fc494d2f14bae6ecd0fa30f14 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Thu, 10 Dec 2015 13:20:30 +0200
4Subject: [PATCH] Don't search /usr and so on for libraries by default to
5
6 avoid host contamination.
7
8Upstream-Status: Inappropriate (As the code stands, this is a hack)
9Signed-off-by: Ross Burton <ross.burton@intel.com>
10Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
11---
12 numpy/distutils/system_info.py | 42 +++++-----------------------------
13 1 file changed, 6 insertions(+), 36 deletions(-)
14
15diff --git a/numpy/distutils/system_info.py b/numpy/distutils/system_info.py
16index 82e864a..135246d 100644
17--- a/numpy/distutils/system_info.py
18+++ b/numpy/distutils/system_info.py
19@@ -323,44 +323,14 @@ if sys.platform == 'win32':
20 add_system_root(os.path.join(conda_dir, 'Library'))
21
22 else:
23- default_lib_dirs = libpaths(['/usr/local/lib', '/opt/lib', '/usr/lib',
24- '/opt/local/lib', '/sw/lib'], platform_bits)
25 default_runtime_dirs = []
26- default_include_dirs = ['/usr/local/include',
27- '/opt/include',
28- # path of umfpack under macports
29- '/opt/local/include/ufsparse',
30- '/opt/local/include', '/sw/include',
31- '/usr/include/suitesparse']
32- default_src_dirs = ['.', '/usr/local/src', '/opt/src', '/sw/src']
33-
34- default_x11_lib_dirs = libpaths(['/usr/X11R6/lib', '/usr/X11/lib',
35- '/usr/lib'], platform_bits)
36- default_x11_include_dirs = ['/usr/X11R6/include', '/usr/X11/include']
37-
38- if os.path.exists('/usr/lib/X11'):
39- globbed_x11_dir = glob('/usr/lib/*/libX11.so')
40- if globbed_x11_dir:
41- x11_so_dir = os.path.split(globbed_x11_dir[0])[0]
42- default_x11_lib_dirs.extend([x11_so_dir, '/usr/lib/X11'])
43- default_x11_include_dirs.extend(['/usr/lib/X11/include',
44- '/usr/include/X11'])
45-
46- with open(os.devnull, 'w') as tmp:
47- try:
48- p = subprocess.Popen(["gcc", "-print-multiarch"], stdout=subprocess.PIPE,
49- stderr=tmp)
50- except (OSError, DistutilsError):
51- # OSError if gcc is not installed, or SandboxViolation (DistutilsError
52- # subclass) if an old setuptools bug is triggered (see gh-3160).
53- pass
54- else:
55- triplet = str(p.communicate()[0].decode().strip())
56- if p.returncode == 0:
57- # gcc supports the "-print-multiarch" option
58- default_x11_lib_dirs += [os.path.join("/usr/lib/", triplet)]
59- default_lib_dirs += [os.path.join("/usr/lib/", triplet)]
60
61+ default_lib_dirs = libpaths(['/deadir/lib'], platform_bits)
62+ default_include_dirs = ['/deaddir/include']
63+ default_src_dirs = ['.', '/deaddir/src']
64+
65+ default_x11_lib_dirs = libpaths(['/deaddir/lib'], platform_bits)
66+ default_x11_include_dirs = ['/deaddir/include']
67
68 if os.path.join(sys.prefix, 'lib') not in default_lib_dirs:
69 default_lib_dirs.insert(0, os.path.join(sys.prefix, 'lib'))
70--
712.25.1
72
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
new file mode 100644
index 0000000000..b60ca1d216
--- /dev/null
+++ b/meta/recipes-devtools/python/python3-numpy/0001-numpy-core-Define-RISCV-32-support.patch
@@ -0,0 +1,56 @@
1From dbcf296f84e5cef6a3ff0f1c469a4508f1e0fb15 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sun, 15 Nov 2020 15:32:39 -0800
4Subject: [PATCH] numpy/core: Define RISCV-32 support
5
6Helps compile on riscv32
7
8Upstream-Status: Submitted [https://github.com/numpy/numpy/pull/17780]
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11 numpy/core/include/numpy/npy_cpu.h | 9 +++++++--
12 numpy/core/include/numpy/npy_endian.h | 1 +
13 2 files changed, 8 insertions(+), 2 deletions(-)
14
15diff --git a/numpy/core/include/numpy/npy_cpu.h b/numpy/core/include/numpy/npy_cpu.h
16index 4dbf9d84e..bc41a7eda 100644
17--- a/numpy/core/include/numpy/npy_cpu.h
18+++ b/numpy/core/include/numpy/npy_cpu.h
19@@ -18,6 +18,7 @@
20 * NPY_CPU_ARCEL
21 * NPY_CPU_ARCEB
22 * NPY_CPU_RISCV64
23+ * NPY_CPU_RISCV32
24 * NPY_CPU_WASM
25 */
26 #ifndef _NPY_CPUARCH_H_
27@@ -100,8 +101,12 @@
28 #define NPY_CPU_ARCEL
29 #elif defined(__arc__) && defined(__BIG_ENDIAN__)
30 #define NPY_CPU_ARCEB
31-#elif defined(__riscv) && defined(__riscv_xlen) && __riscv_xlen == 64
32- #define NPY_CPU_RISCV64
33+#elif defined(__riscv)
34+ #if __riscv_xlen == 64
35+ #define NPY_CPU_RISCV64
36+ #elif __riscv_xlen == 32
37+ #define NPY_CPU_RISCV32
38+ #endif
39 #elif defined(__EMSCRIPTEN__)
40 /* __EMSCRIPTEN__ is defined by emscripten: an LLVM-to-Web compiler */
41 #define NPY_CPU_WASM
42diff --git a/numpy/core/include/numpy/npy_endian.h b/numpy/core/include/numpy/npy_endian.h
43index aa367a002..d59484573 100644
44--- a/numpy/core/include/numpy/npy_endian.h
45+++ b/numpy/core/include/numpy/npy_endian.h
46@@ -49,6 +49,7 @@
47 || defined(NPY_CPU_PPC64LE) \
48 || defined(NPY_CPU_ARCEL) \
49 || defined(NPY_CPU_RISCV64) \
50+ || defined(NPY_CPU_RISCV32) \
51 || defined(NPY_CPU_WASM)
52 #define NPY_BYTE_ORDER NPY_LITTLE_ENDIAN
53 #elif defined(NPY_CPU_PPC) \
54--
552.29.2
56
diff --git a/meta/recipes-devtools/python/python3-numpy/run-ptest b/meta/recipes-devtools/python/python3-numpy/run-ptest
new file mode 100644
index 0000000000..9a1c72aeb1
--- /dev/null
+++ b/meta/recipes-devtools/python/python3-numpy/run-ptest
@@ -0,0 +1,5 @@
1#!/usr/bin/env python3
2
3import numpy
4numpy.test(label='full', verbose=2)
5
diff --git a/meta/recipes-devtools/python/python3-numpy_1.21.4.bb b/meta/recipes-devtools/python/python3-numpy_1.21.4.bb
new file mode 100644
index 0000000000..8988a5bc39
--- /dev/null
+++ b/meta/recipes-devtools/python/python3-numpy_1.21.4.bb
@@ -0,0 +1,58 @@
1SUMMARY = "A sophisticated Numeric Processing Package for Python"
2HOMEPAGE = "https://numpy.org/"
3DESCRIPTION = "NumPy is the fundamental package needed for scientific computing with Python."
4SECTION = "devel/python"
5LICENSE = "BSD-3-Clause & BSD-2-Clause & PSF & Apache-2.0 & MIT"
6LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=b076ad374a7d311ba3126a22b2d52596"
7
8SRCNAME = "numpy"
9
10SRC_URI = "https://github.com/${SRCNAME}/${SRCNAME}/releases/download/v${PV}/${SRCNAME}-${PV}.tar.gz \
11 file://0001-Don-t-search-usr-and-so-on-for-libraries-by-default-.patch \
12 file://0001-numpy-core-Define-RISCV-32-support.patch \
13 file://run-ptest \
14"
15SRC_URI[sha256sum] = "5d412381aa489b8be82ac5c6a9e99c3eb3f754245ad3f90ab5c339d92f25fb47"
16
17UPSTREAM_CHECK_URI = "https://github.com/numpy/numpy/releases"
18UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)\.tar"
19
20DEPENDS += "python3-cython-native"
21
22inherit ptest setuptools3
23
24S = "${WORKDIR}/numpy-${PV}"
25
26CLEANBROKEN = "1"
27
28FILES:${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/numpy/core/lib/*.a ${PYTHON_SITEPACKAGES_DIR}/numpy/random/lib/*.a"
29
30# install what is needed for numpy.test()
31RDEPENDS:${PN} = "${PYTHON_PN}-unittest \
32 ${PYTHON_PN}-difflib \
33 ${PYTHON_PN}-pprint \
34 ${PYTHON_PN}-pickle \
35 ${PYTHON_PN}-shell \
36 ${PYTHON_PN}-doctest \
37 ${PYTHON_PN}-datetime \
38 ${PYTHON_PN}-distutils \
39 ${PYTHON_PN}-misc \
40 ${PYTHON_PN}-mmap \
41 ${PYTHON_PN}-netclient \
42 ${PYTHON_PN}-numbers \
43 ${PYTHON_PN}-pydoc \
44 ${PYTHON_PN}-pkgutil \
45 ${PYTHON_PN}-email \
46 ${PYTHON_PN}-compression \
47 ${PYTHON_PN}-ctypes \
48 ${PYTHON_PN}-threading \
49 ${PYTHON_PN}-multiprocessing \
50"
51RDEPENDS:${PN}-ptest += "${PYTHON_PN}-pytest \
52 ${PYTHON_PN}-hypothesis \
53 ${PYTHON_PN}-sortedcontainers \
54 ${PYTHON_PN}-resource \
55 ldd \
56"
57
58BBCLASSEXTEND = "native nativesdk"