Skip to contentSkip to conversation

python3-numpy: add from oe-core

PATCH In review Alexander Kanavin 1 participant 3 messages Feb 29, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 python3-numpy: add from oe-core

---
 ...-and-so-on-for-libraries-by-default-.patch | 70 +++++++++++++++++++
 ...up.py-remove-the-detection-of-x86-ta.patch | 32 +++++++++
 .../python-numpy/python-numpy.inc             | 52 ++++++++++++++
 .../python-numpy/python3-numpy_1.17.4.bb      |  3 +
 4 files changed, 157 insertions(+)
 create mode 100644 meta-python/recipes-devtools/python-numpy/files/0001-Don-t-search-usr-and-so-on-for-libraries-by-default-.patch
 create mode 100644 meta-python/recipes-devtools/python-numpy/files/0001-numpy-random-setup.py-remove-the-detection-of-x86-ta.patch
 create mode 100644 meta-python/recipes-devtools/python-numpy/python-numpy.inc
 create mode 100644 meta-python/recipes-devtools/python-numpy/python3-numpy_1.17.4.bb
meta-python/recipes-devtools/python-numpy/files/0001-Don-t-search-usr-and-so-on-for-libraries-by-default-.patch new file +70 -0
new file mode 100644
index 000000000..98a970583
@@ -0,0 +1,70 @@
+From 672a75c8417ce08db9e31fc415ec445479231d5a Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <[email protected]>
+Date: Thu, 10 Dec 2015 13:20:30 +0200
+Subject: [PATCH] Don't search /usr and so on for libraries by default to
+
+ avoid host contamination.
+
+Upstream-Status: Inappropriate (As the code stands, this is a hack)
+Signed-off-by: Ross Burton <[email protected]>
+Signed-off-by: Alexander Kanavin <[email protected]>
+
+---
+ numpy/distutils/system_info.py | 42 ++++------------------------------
+ 1 file changed, 5 insertions(+), 37 deletions(-)
+
+diff --git a/numpy/distutils/system_info.py b/numpy/distutils/system_info.py
+index ba2b1f4..f94dce1 100644
+--- a/numpy/distutils/system_info.py
++++ b/numpy/distutils/system_info.py
+@@ -278,45 +278,13 @@ if sys.platform == 'win32':
+             add_system_root(os.path.join(conda_dir, 'Library'))
+ 
+ else:
+-    default_lib_dirs = libpaths(['/usr/local/lib', '/opt/lib', '/usr/lib',
+-                                 '/opt/local/lib', '/sw/lib'], platform_bits)
+     default_runtime_dirs = []
+-    default_include_dirs = ['/usr/local/include',
+-                            '/opt/include', '/usr/include',
+-                            # path of umfpack under macports
+-                            '/opt/local/include/ufsparse',
+-                            '/opt/local/include', '/sw/include',
+-                            '/usr/include/suitesparse']
+-    default_src_dirs = ['.', '/usr/local/src', '/opt/src', '/sw/src']
+-
+-    default_x11_lib_dirs = libpaths(['/usr/X11R6/lib', '/usr/X11/lib',
+-                                     '/usr/lib'], platform_bits)
+-    default_x11_include_dirs = ['/usr/X11R6/include', '/usr/X11/include',
+-                                '/usr/include']
+-
+-    if os.path.exists('/usr/lib/X11'):
+-        globbed_x11_dir = glob('/usr/lib/*/libX11.so')
+-        if globbed_x11_dir:
+-            x11_so_dir = os.path.split(globbed_x11_dir[0])[0]
+-            default_x11_lib_dirs.extend([x11_so_dir, '/usr/lib/X11'])
+-            default_x11_include_dirs.extend(['/usr/lib/X11/include',
+-                                             '/usr/include/X11'])
+-
+-    with open(os.devnull, 'w') as tmp:
+-        try:
+-            p = subprocess.Popen(["gcc", "-print-multiarch"], stdout=subprocess.PIPE,
+-                         stderr=tmp)
+-        except (OSError, DistutilsError):
+-            # OSError if gcc is not installed, or SandboxViolation (DistutilsError
+-            # subclass) if an old setuptools bug is triggered (see gh-3160).
+-            pass
+-        else:
+-            triplet = str(p.communicate()[0].decode().strip())
+-            if p.returncode == 0:
+-                # gcc supports the "-print-multiarch" option
+-                default_x11_lib_dirs += [os.path.join("/usr/lib/", triplet)]
+-                default_lib_dirs += [os.path.join("/usr/lib/", triplet)]
++    default_lib_dirs = libpaths(['/deadir/lib'], platform_bits)
++    default_include_dirs = ['/deaddir/include']
++    default_src_dirs = ['.', '/deaddir/src']
+ 
++    default_x11_lib_dirs = libpaths(['/deaddir/lib'], platform_bits)
++    default_x11_include_dirs = ['/deaddir/include']
+ 
+ if os.path.join(sys.prefix, 'lib') not in default_lib_dirs:
+     default_lib_dirs.insert(0, os.path.join(sys.prefix, 'lib'))
meta-python/recipes-devtools/python-numpy/files/0001-numpy-random-setup.py-remove-the-detection-of-x86-ta.patch new file +32 -0
new file mode 100644
index 000000000..9da6a2b3d
@@ -0,0 +1,32 @@
+From b881e0b2ba9cf1a4aa351a1c1ea90b1e1776ce21 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <[email protected]>
+Date: Mon, 12 Aug 2019 15:37:36 +0200
+Subject: [PATCH] numpy/random/setup.py: remove the detection of x86 targets
+ via uname()
+
+This was badly breaking compilation for ARM targets (and possibly
+other non-x86 targets); if -msse2 is desirable for x86 builds it has
+to be passed through another channel.
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <[email protected]>
+---
+ numpy/random/setup.py | 5 -----
+ 1 file changed, 5 deletions(-)
+
+diff --git a/numpy/random/setup.py b/numpy/random/setup.py
+index a1bf3b8..60fb534 100644
+--- a/numpy/random/setup.py
++++ b/numpy/random/setup.py
+@@ -49,11 +49,6 @@ def configuration(parent_package='', top_path=None):
+     elif not is_msvc:
+         # Some bit generators require c99
+         EXTRA_COMPILE_ARGS += ['-std=c99']
+-        INTEL_LIKE = any(arch in platform.machine() 
+-                         for arch in ('x86', 'i686', 'i386', 'amd64'))
+-        if INTEL_LIKE:
+-            # Assumes GCC or GCC-like compiler
+-            EXTRA_COMPILE_ARGS += ['-msse2']
+ 
+     # Use legacy integer variable sizes
+     LEGACY_DEFS = [('NP_RANDOM_LEGACY', '1')]
meta-python/recipes-devtools/python-numpy/python-numpy.inc new file +52 -0

52 lines not on this page · raw message

meta-python/recipes-devtools/python-numpy/python3-numpy_1.17.4.bb new file +3 -0
new file mode 100644
index 000000000..d388e88d2
@@ -0,0 +1,3 @@
+inherit setuptools3
+require python-numpy.inc
+
Signature · 1 line
2.25.1
#1 lore raw

PATCH 2/2 piglist: add from oe-core

---
 ...-bash-completions-in-the-right-place.patch | 35 ++++++++++
 ...proper-WAYLAND_INCLUDE_DIRS-variable.patch | 32 ++++++++++
 meta-oe/recipes-graphics/piglit/piglit_git.bb | 64 +++++++++++++++++++
 3 files changed, 131 insertions(+)
 create mode 100644 meta-oe/recipes-graphics/piglit/piglit/0001-cmake-install-bash-completions-in-the-right-place.patch
 create mode 100644 meta-oe/recipes-graphics/piglit/piglit/0001-cmake-use-proper-WAYLAND_INCLUDE_DIRS-variable.patch
 create mode 100644 meta-oe/recipes-graphics/piglit/piglit_git.bb
meta-oe/recipes-graphics/piglit/piglit/0001-cmake-install-bash-completions-in-the-right-place.patch new file +35 -0
new file mode 100644
index 000000000..e07e810a7
@@ -0,0 +1,35 @@
+From 26faa2c157a27a18a9f767976730fe0c115e3af4 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <[email protected]>
+Date: Wed, 13 Jul 2016 19:19:02 +0300
+Subject: [PATCH] cmake: install bash-completions in the right place
+
+The completionsdir variable is a full path and should not be
+prefixed.
+
+This does mean the files may be installed outside of
+CMAKE_INSTALL_PREFIX -- the alternative is more difficult and
+means that bash completion files may be installed where
+bash-completion can't find them.
+
+Signed-off-by: Jussi Kukkonen <[email protected]>
+Upstream-Status: Submitted [mailing list]
+---
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 8e2abba..784a8f9 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -532,7 +532,7 @@ install (
+ if (BASH_COMPLETION_FOUND)
+ 	install(
+ 		FILES completions/bash/piglit
+-		DESTINATION ${CMAKE_INSTALL_PREFIX}/${BASH_COMPLETION_COMPLETIONSDIR}/
++		DESTINATION ${BASH_COMPLETION_COMPLETIONSDIR}/
+ 	)
+ endif (BASH_COMPLETION_FOUND)
+ 
+-- 
+2.8.1
+
meta-oe/recipes-graphics/piglit/piglit/0001-cmake-use-proper-WAYLAND_INCLUDE_DIRS-variable.patch new file +32 -0
new file mode 100644
index 000000000..5d6ec368b
@@ -0,0 +1,32 @@
+From 3bf1beee1ddd19bc536ff2856e04ac269d43daa2 Mon Sep 17 00:00:00 2001
+From: Pascal Bach <[email protected]>
+Date: Thu, 4 Oct 2018 14:43:17 +0200
+Subject: [PATCH] cmake: use proper WAYLAND_INCLUDE_DIRS variable
+
+WAYLAND_wayland-client_INCLUDEDIR is an internal variable and is not correctly
+set when cross compiling. WAYLAND_INCLUDE_DIRS includes the correct path even
+when cross compiling.
+
+Signed-off-by: Pascal Bach <[email protected]>
+
+Upstream-Status: Submitted [[email protected]]
+---
+ tests/util/CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tests/util/CMakeLists.txt b/tests/util/CMakeLists.txt
+index a5f080156..a303a9f58 100644
+--- a/tests/util/CMakeLists.txt
++++ b/tests/util/CMakeLists.txt
+@@ -97,7 +97,7 @@ if(PIGLIT_USE_WAFFLE)
+ 			piglit-framework-gl/piglit_wl_framework.c
+ 		)
+ 		list(APPEND UTIL_GL_INCLUDES
+-			${WAYLAND_wayland-client_INCLUDEDIR}
++			${WAYLAND_INCLUDE_DIRS}
+ 		)
+ 	endif()
+ 	if(PIGLIT_HAS_X11)
+-- 
+2.11.0
+
meta-oe/recipes-graphics/piglit/piglit_git.bb new file +64 -0

64 lines not on this page · raw message

Signature · 1 line
2.25.1
#2 lore raw
In reply to Alexander Kanavin

Please ignore this set; the recipes will stay in core for now.

Alex

Quoted 224 lines · Alexander Kanavin
---
 ...-and-so-on-for-libraries-by-default-.patch | 70 +++++++++++++++++++
 ...up.py-remove-the-detection-of-x86-ta.patch | 32 +++++++++
 .../python-numpy/python-numpy.inc             | 52 ++++++++++++++
 .../python-numpy/python3-numpy_1.17.4.bb      |  3 +
 4 files changed, 157 insertions(+)
 create mode 100644
meta-python/recipes-devtools/python-numpy/files/0001-Don-t-search-usr-and-so-on-for-libraries-by-default-.patch
 create mode 100644
meta-python/recipes-devtools/python-numpy/files/0001-numpy-random-setup.py-remove-the-detection-of-x86-ta.patch
 create mode 100644
meta-python/recipes-devtools/python-numpy/python-numpy.inc
 create mode 100644 meta-python/recipes-devtools/python-numpy/

python3-numpy_1.17.4.bb

diff --git a/meta-python/recipes-devtools/python-numpy/files/0001-Don-t-search-usr-and-so-on-for-libraries-by-default-.patch b/meta-python/recipes-devtools/python-numpy/files/0001-Don-t-search-usr-and-so-on-for-libraries-by-default-.patch new file mode 100644
index 000000000..98a970583
--- /dev/null
+++
b/meta-python/recipes-devtools/python-numpy/files/0001-Don-t-search-usr-and-so-on-for-libraries-by-default-.patch

meta-python/recipes-devtools/python-numpy/files/0001-Don-t-search-usr-and-so-on-for-libraries-by-default-.patch new file +16 -0
@@ -0,0 +1,70 @@
+From 672a75c8417ce08db9e31fc415ec445479231d5a Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <[email protected]>
+Date: Thu, 10 Dec 2015 13:20:30 +0200
+Subject: [PATCH] Don't search /usr and so on for libraries by default to
+
+ avoid host contamination.
+
+Upstream-Status: Inappropriate (As the code stands, this is a hack)
+Signed-off-by: Ross Burton <[email protected]>
+Signed-off-by: Alexander Kanavin <[email protected]>
+
+---
+ numpy/distutils/system_info.py | 42 ++++------------------------------
+ 1 file changed, 5 insertions(+), 37 deletions(-)
+
+diff --git a/numpy/distutils/system_info.py

b/numpy/distutils/system_info.py

meta-python/recipes-devtools/python-numpy/files/0001-Don-t-search-usr-and-so-on-for-libraries-by-default-.patch new file +8 -0
+index ba2b1f4..f94dce1 100644
+--- a/numpy/distutils/system_info.py
++++ b/numpy/distutils/system_info.py
+@@ -278,45 +278,13 @@ if sys.platform == 'win32':
+             add_system_root(os.path.join(conda_dir, 'Library'))
+
+ else:
+-    default_lib_dirs = libpaths(['/usr/local/lib', '/opt/lib',

'/usr/lib',
+- '/opt/local/lib', '/sw/lib'],
platform_bits)
+ default_runtime_dirs = []

+-    default_include_dirs = ['/usr/local/include',
+-                            '/opt/include', '/usr/include',
+-                            # path of umfpack under macports
+-                            '/opt/local/include/ufsparse',
+-                            '/opt/local/include', '/sw/include',
+-                            '/usr/include/suitesparse']
+-    default_src_dirs = ['.', '/usr/local/src', '/opt/src', '/sw/src']
+-
+-    default_x11_lib_dirs = libpaths(['/usr/X11R6/lib', '/usr/X11/lib',
+-                                     '/usr/lib'], platform_bits)
+-    default_x11_include_dirs = ['/usr/X11R6/include', '/usr/X11/include',
+-                                '/usr/include']
+-
+-    if os.path.exists('/usr/lib/X11'):
+-        globbed_x11_dir = glob('/usr/lib/*/libX11.so')
+-        if globbed_x11_dir:
+-            x11_so_dir = os.path.split(globbed_x11_dir[0])[0]
+-            default_x11_lib_dirs.extend([x11_so_dir, '/usr/lib/X11'])
+-            default_x11_include_dirs.extend(['/usr/lib/X11/include',
+-                                             '/usr/include/X11'])
+-
+-    with open(os.devnull, 'w') as tmp:
+-        try:
+-            p = subprocess.Popen(["gcc", "-print-multiarch"],
stdout=subprocess.PIPE,
+-                         stderr=tmp)
+-        except (OSError, DistutilsError):
+-            # OSError if gcc is not installed, or SandboxViolation
(DistutilsError
+-            # subclass) if an old setuptools bug is triggered (see
gh-3160).
+-            pass
+-        else:
+-            triplet = str(p.communicate()[0].decode().strip())
+-            if p.returncode == 0:
+-                # gcc supports the "-print-multiarch" option
+-                default_x11_lib_dirs += [os.path.join("/usr/lib/",
triplet)]
+-                default_lib_dirs += [os.path.join("/usr/lib/", triplet)]
++    default_lib_dirs = libpaths(['/deadir/lib'], platform_bits)
++    default_include_dirs = ['/deaddir/include']
++    default_src_dirs = ['.', '/deaddir/src']
meta-python/recipes-devtools/python-numpy/files/0001-Don-t-search-usr-and-so-on-for-libraries-by-default-.patch new file +6 -0
+
++    default_x11_lib_dirs = libpaths(['/deaddir/lib'], platform_bits)
++    default_x11_include_dirs = ['/deaddir/include']
+
+ if os.path.join(sys.prefix, 'lib') not in default_lib_dirs:
+     default_lib_dirs.insert(0, os.path.join(sys.prefix, 'lib'))

diff --git a/meta-python/recipes-devtools/python-numpy/files/0001-numpy-random-setup.py-remove-the-detection-of-x86-ta.patch b/meta-python/recipes-devtools/python-numpy/files/0001-numpy-random-setup.py-remove-the-detection-of-x86-ta.patch new file mode 100644
index 000000000..9da6a2b3d
--- /dev/null
+++
b/meta-python/recipes-devtools/python-numpy/files/0001-numpy-random-setup.py-remove-the-detection-of-x86-ta.patch

meta-python/recipes-devtools/python-numpy/files/0001-numpy-random-setup.py-remove-the-detection-of-x86-ta.patch new file +4 -0
@@ -0,0 +1,32 @@
+From b881e0b2ba9cf1a4aa351a1c1ea90b1e1776ce21 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <[email protected]>
+Date: Mon, 12 Aug 2019 15:37:36 +0200
+Subject: [PATCH] numpy/random/setup.py: remove the detection of x86

targets
+ via uname()

meta-python/recipes-devtools/python-numpy/files/0001-numpy-random-setup.py-remove-the-detection-of-x86-ta.patch new file +27 -0
+
+This was badly breaking compilation for ARM targets (and possibly
+other non-x86 targets); if -msse2 is desirable for x86 builds it has
+to be passed through another channel.
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <[email protected]>
+---
+ numpy/random/setup.py | 5 -----
+ 1 file changed, 5 deletions(-)
+
+diff --git a/numpy/random/setup.py b/numpy/random/setup.py
+index a1bf3b8..60fb534 100644
+--- a/numpy/random/setup.py
++++ b/numpy/random/setup.py
+@@ -49,11 +49,6 @@ def configuration(parent_package='', top_path=None):
+     elif not is_msvc:
+         # Some bit generators require c99
+         EXTRA_COMPILE_ARGS += ['-std=c99']
+-        INTEL_LIKE = any(arch in platform.machine()
+-                         for arch in ('x86', 'i686', 'i386', 'amd64'))
+-        if INTEL_LIKE:
+-            # Assumes GCC or GCC-like compiler
+-            EXTRA_COMPILE_ARGS += ['-msse2']
+
+     # Use legacy integer variable sizes
+     LEGACY_DEFS = [('NP_RANDOM_LEGACY', '1')]
meta-python/recipes-devtools/python-numpy/python-numpy.inc new file +4 -0
new file mode 100644
index 000000000..8413434af
@@ -0,0 +1,52 @@
+SUMMARY = "A sophisticated Numeric Processing Package for Python"
+SECTION = "devel/python"
+LICENSE = "BSD-3-Clause & BSD-2-Clause & PSF & Apache-2.0 & BSD & MIT"
+LIC_FILES_CHKSUM =

"file://LICENSE.txt;md5=1a32aba007a415aa8a1c708a0e2b86a1"

meta-python/recipes-devtools/python-numpy/python-numpy.inc new file +4 -0
+
+SRCNAME = "numpy"
+
+SRC_URI = "

https://github.com/${SRCNAME}/${SRCNAME}/releases/download/v${PV}/${SRCNAME}-${PV}.tar.gz
\

meta-python/recipes-devtools/python-numpy/python-numpy.inc new file +5 -0
+
 file://0001-Don-t-search-usr-and-so-on-for-libraries-by-default-.patch \
+
 file://0001-numpy-random-setup.py-remove-the-detection-of-x86-ta.patch \
+           "
+SRC_URI[md5sum] = "9147c3ee75e58d657b5b8b5a4f3564e0"
+SRC_URI[sha256sum] =

"fb0415475e673cb9a6dd816df999e0ab9f86fa3af2b1770944e7288d2bea4ac9"

meta-python/recipes-devtools/python-numpy/python-numpy.inc new file +39 -0
+
+UPSTREAM_CHECK_URI = "https://github.com/numpy/numpy/releases"
+UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)\.tar"
+
+# Needed for building with gcc 4.x from centos 7
+CFLAGS_append_class-native = " -std=c99"
+
+S = "${WORKDIR}/numpy-${PV}"
+
+CLEANBROKEN = "1"
+
+FILES_${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/numpy/core/lib/*.a"
+
+# install what is needed for numpy.test()
+RDEPENDS_${PN} = "${PYTHON_PN}-unittest \
+                  ${PYTHON_PN}-difflib \
+                  ${PYTHON_PN}-pprint \
+                  ${PYTHON_PN}-pickle \
+                  ${PYTHON_PN}-shell \
+                  ${PYTHON_PN}-nose \
+                  ${PYTHON_PN}-doctest \
+                  ${PYTHON_PN}-datetime \
+                  ${PYTHON_PN}-distutils \
+                  ${PYTHON_PN}-misc \
+                  ${PYTHON_PN}-mmap \
+                  ${PYTHON_PN}-netclient \
+                  ${PYTHON_PN}-numbers \
+                  ${PYTHON_PN}-pydoc \
+                  ${PYTHON_PN}-pkgutil \
+                  ${PYTHON_PN}-email \
+                  ${PYTHON_PN}-compression \
+                  ${PYTHON_PN}-ctypes \
+                  ${PYTHON_PN}-threading \
+                  ${PYTHON_PN}-multiprocessing \
+"
+
+RDEPENDS_${PN}_class-native = ""
+
+BBCLASSEXTEND = "native nativesdk"
(quoted diff) +0 -0

python3-numpy_1.17.4.bb b/meta-python/recipes-devtools/python-numpy/ python3-numpy_1.17.4.bb
new file mode 100644
index 000000000..d388e88d2

meta-python/recipes-devtools/python-numpy/python3-numpy_1.17.4.bb new file +3 -1
@@ -0,0 +1,3 @@
+inherit setuptools3
+require python-numpy.inc
+
--

2.25.1