Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] python-numpy: fix for armv5tel-musl.
@ 2020-09-20  8:18 fosslinux
  2020-09-20  8:40 ` [PR PATCH] [Updated] " fosslinux
                   ` (26 more replies)
  0 siblings, 27 replies; 28+ messages in thread
From: fosslinux @ 2020-09-20  8:18 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 771 bytes --]

There is a new pull request by fosslinux against master on the void-packages repository

https://github.com/fosslinux/void-packages python-matplotlib-fix
https://github.com/void-linux/void-packages/pull/24988

python-numpy: fix for armv5tel-musl.
musl differs from glibc in that it dosen't provide fenv.h, on arm, when it
believes the architecture dosen't use hardware floating point in any
way. While this is mostly correct, numpy dosen't use them for floating
point reasons -- it just uses them as general, as per the code, "normal
GCC" constants. Hence, extract the constants from the file and provide
them to numpy all the time for armv5tel-musl, the only affected arch.

A patch file from https://github.com/void-linux/void-packages/pull/24988.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-python-matplotlib-fix-24988.patch --]
[-- Type: text/x-diff, Size: 2770 bytes --]

From 1bc2fac92b12e03bff7e85aa106aa28fd34ee13f Mon Sep 17 00:00:00 2001
From: fosslinux <fosslinux@aussies.space>
Date: Sun, 20 Sep 2020 18:15:29 +1000
Subject: [PATCH] python-numpy: fix for armv5tel-musl.

musl differs from glibc in that it dosen't provide fenv.h, on arm, when it
believes the architecture dosen't use hardware floating point in any
way. While this is mostly correct, numpy dosen't use them for floating
point reasons -- it just uses them as general, as per the code, "normal
GCC" constants. Hence, extract the constants from the file and provide
them to numpy all the time for armv5tel-musl, the only affected arch.
---
 srcpkgs/python-numpy/files/fenv-constants.h     | 10 ++++++++++
 srcpkgs/python-numpy/files/fenv-constants.patch | 11 +++++++++++
 srcpkgs/python-numpy/template                   |  9 +++++++++
 3 files changed, 30 insertions(+)
 create mode 100644 srcpkgs/python-numpy/files/fenv-constants.h
 create mode 100644 srcpkgs/python-numpy/files/fenv-constants.patch

diff --git a/srcpkgs/python-numpy/files/fenv-constants.h b/srcpkgs/python-numpy/files/fenv-constants.h
new file mode 100644
index 00000000000..c2c21d2bb23
--- /dev/null
+++ b/srcpkgs/python-numpy/files/fenv-constants.h
@@ -0,0 +1,10 @@
+#define FE_INVALID    1
+#define FE_DIVBYZERO  2
+#define FE_OVERFLOW   4
+#define FE_UNDERFLOW  8
+#define FE_INEXACT    16
+#define FE_ALL_EXCEPT 31
+#define FE_TONEAREST  0
+#define FE_DOWNWARD   0x800000
+#define FE_UPWARD     0x400000
+#define FE_TOWARDZERO 0xc00000
diff --git a/srcpkgs/python-numpy/files/fenv-constants.patch b/srcpkgs/python-numpy/files/fenv-constants.patch
new file mode 100644
index 00000000000..987ad4e346f
--- /dev/null
+++ b/srcpkgs/python-numpy/files/fenv-constants.patch
@@ -0,0 +1,11 @@
+--- numpy/core/src/npymath/ieee754.c.src	2020-09-20 14:53:51.998825328 +1000
++++ numpy/core/src/npymath/ieee754.c.src	2020-09-20 14:54:03.611889518 +1000
+@@ -8,6 +8,8 @@
+ #include "npy_math_private.h"
+ #include "numpy/utils.h"
+ 
++#include "fenv-constants.h"
++
+ #ifndef HAVE_COPYSIGN
+ double npy_copysign(double x, double y)
+ {
diff --git a/srcpkgs/python-numpy/template b/srcpkgs/python-numpy/template
index 52308fd2aa6..d7d64d8124c 100644
--- a/srcpkgs/python-numpy/template
+++ b/srcpkgs/python-numpy/template
@@ -15,6 +15,15 @@ distfiles="https://github.com/numpy/numpy/archive/v${version}.tar.gz"
 checksum=3c82a9b8616e3096a79a2af9c288d8ed4013a10fc7baf3eaf54655309734dadd
 alternatives="numpy:f2py:/usr/bin/f2py2"
 
+post_patch() {
+	case "${XBPS_TARGET_MACHINE}" in
+		armv5tel-musl)
+			cp "${FILESDIR}/fenv-constants.h" numpy/core/src/npymath/
+			patch -Np0 -i "${FILESDIR}/fenv-constants.patch"
+			;;
+	esac
+}
+
 post_install() {
 	# create compat symlinks for .h files
 	vmkdir ${py2_inc}

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PR PATCH] [Updated] python-numpy: fix for armv5tel-musl.
  2020-09-20  8:18 [PR PATCH] python-numpy: fix for armv5tel-musl fosslinux
@ 2020-09-20  8:40 ` fosslinux
  2020-09-20  8:40 ` fosslinux
                   ` (25 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: fosslinux @ 2020-09-20  8:40 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 776 bytes --]

There is an updated pull request by fosslinux against master on the void-packages repository

https://github.com/fosslinux/void-packages python-matplotlib-fix
https://github.com/void-linux/void-packages/pull/24988

python-numpy: fix for armv5tel-musl.
musl differs from glibc in that it dosen't provide fenv.h, on arm, when it
believes the architecture dosen't use hardware floating point in any
way. While this is mostly correct, numpy dosen't use them for floating
point reasons -- it just uses them as general, as per the code, "normal
GCC" constants. Hence, extract the constants from the file and provide
them to numpy all the time for armv5tel-musl, the only affected arch.

A patch file from https://github.com/void-linux/void-packages/pull/24988.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-python-matplotlib-fix-24988.patch --]
[-- Type: text/x-diff, Size: 3865 bytes --]

From 8f1baaffbae125a450bfabe6173c7622c580f186 Mon Sep 17 00:00:00 2001
From: fosslinux <fosslinux@aussies.space>
Date: Sun, 20 Sep 2020 18:38:07 +1000
Subject: [PATCH 1/2] python3-numpy: fix armv5tel-musl.

in fenv.h, musl disables the normal set of constants that you would get
on arm with an arm device with an fpu (armv6 and up), but armv5tel on
void uses softfloat all the time. But python3-numpy dosen't use these to
interact with the fpu (the compiler would generate those instructions)
and rather just uses those constants for a generic GCC implementation.
So we give them out anyway.
---
 srcpkgs/python3-numpy/files/fenv-constants.h     | 10 ++++++++++
 srcpkgs/python3-numpy/files/fenv-constants.patch | 11 +++++++++++
 srcpkgs/python3-numpy/template                   |  9 +++++++++
 3 files changed, 30 insertions(+)
 create mode 100644 srcpkgs/python3-numpy/files/fenv-constants.h
 create mode 100644 srcpkgs/python3-numpy/files/fenv-constants.patch

diff --git a/srcpkgs/python3-numpy/files/fenv-constants.h b/srcpkgs/python3-numpy/files/fenv-constants.h
new file mode 100644
index 00000000000..c2c21d2bb23
--- /dev/null
+++ b/srcpkgs/python3-numpy/files/fenv-constants.h
@@ -0,0 +1,10 @@
+#define FE_INVALID    1
+#define FE_DIVBYZERO  2
+#define FE_OVERFLOW   4
+#define FE_UNDERFLOW  8
+#define FE_INEXACT    16
+#define FE_ALL_EXCEPT 31
+#define FE_TONEAREST  0
+#define FE_DOWNWARD   0x800000
+#define FE_UPWARD     0x400000
+#define FE_TOWARDZERO 0xc00000
diff --git a/srcpkgs/python3-numpy/files/fenv-constants.patch b/srcpkgs/python3-numpy/files/fenv-constants.patch
new file mode 100644
index 00000000000..987ad4e346f
--- /dev/null
+++ b/srcpkgs/python3-numpy/files/fenv-constants.patch
@@ -0,0 +1,11 @@
+--- numpy/core/src/npymath/ieee754.c.src	2020-09-20 14:53:51.998825328 +1000
++++ numpy/core/src/npymath/ieee754.c.src	2020-09-20 14:54:03.611889518 +1000
+@@ -8,6 +8,8 @@
+ #include "npy_math_private.h"
+ #include "numpy/utils.h"
+ 
++#include "fenv-constants.h"
++
+ #ifndef HAVE_COPYSIGN
+ double npy_copysign(double x, double y)
+ {
diff --git a/srcpkgs/python3-numpy/template b/srcpkgs/python3-numpy/template
index 759899d8e7b..c14d7381e67 100644
--- a/srcpkgs/python3-numpy/template
+++ b/srcpkgs/python3-numpy/template
@@ -16,6 +16,15 @@ distfiles="https://github.com/numpy/numpy/archive/v${version}.tar.gz"
 checksum=5ee0d6d17fe01dde9824811516d94ba8adb9349d81ef78d0696e6b03097498b8
 alternatives="numpy:f2py:/usr/bin/f2py3"
 
+post_patch() {
+	case "${XBPS_TARGET_MACHINE}" in
+		armv5tel-musl)
+			cp "${FILESDIR}/fenv-constants.h" numpy/core/src/npymath/
+			patch -Np0 -i "${FILESDIR}/fenv-constants.patch"
+			;;
+	esac
+}
+
 do_check() {
 	./runtests.py -v
 }

From dfb16218c7452c1ea52ed719fa4d442f17600f8f Mon Sep 17 00:00:00 2001
From: fosslinux <fosslinux@aussies.space>
Date: Sun, 20 Sep 2020 18:39:51 +1000
Subject: [PATCH 2/2] python-numpy: fix armv5tel-musl.

Uses the same patch and file from python3-numpy so we just use that from
python3-numpy's files directory.
---
 srcpkgs/python-numpy/template | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/srcpkgs/python-numpy/template b/srcpkgs/python-numpy/template
index 52308fd2aa6..df6c2389add 100644
--- a/srcpkgs/python-numpy/template
+++ b/srcpkgs/python-numpy/template
@@ -15,6 +15,17 @@ distfiles="https://github.com/numpy/numpy/archive/v${version}.tar.gz"
 checksum=3c82a9b8616e3096a79a2af9c288d8ed4013a10fc7baf3eaf54655309734dadd
 alternatives="numpy:f2py:/usr/bin/f2py2"
 
+post_patch() {
+	case "${XBPS_TARGET_MACHINE}" in
+		armv5tel-musl)
+			cp "${XBPS_SRCPKGDIR}/python3-numpy/files/fenv-constants.h" \
+                numpy/core/src/npymath/
+			patch -Np0 -i \
+                "${XBPS_SRCPKGDIR}/python3-numpy/files/fenv-constants.patch"
+			;;
+	esac
+}
+
 post_install() {
 	# create compat symlinks for .h files
 	vmkdir ${py2_inc}

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: python-numpy: fix for armv5tel-musl.
  2020-09-20  8:18 [PR PATCH] python-numpy: fix for armv5tel-musl fosslinux
  2020-09-20  8:40 ` [PR PATCH] [Updated] " fosslinux
@ 2020-09-20  8:40 ` fosslinux
  2020-09-22  6:04 ` [PR PATCH] [Updated] " fosslinux
                   ` (24 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: fosslinux @ 2020-09-20  8:40 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 223 bytes --]

New comment by fosslinux on void-packages repository

https://github.com/void-linux/void-packages/pull/24988#issuecomment-695761401

Comment:
Just realized that python3-numpy would have the same issue, restructured a bit


^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PR PATCH] [Updated] python-numpy: fix for armv5tel-musl.
  2020-09-20  8:18 [PR PATCH] python-numpy: fix for armv5tel-musl fosslinux
  2020-09-20  8:40 ` [PR PATCH] [Updated] " fosslinux
  2020-09-20  8:40 ` fosslinux
@ 2020-09-22  6:04 ` fosslinux
  2020-09-25  0:31 ` [PR REVIEW] " sgn
                   ` (23 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: fosslinux @ 2020-09-22  6:04 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 789 bytes --]

There is an updated pull request by fosslinux against master on the void-packages repository

https://github.com/fosslinux/void-packages python-matplotlib-fix
https://github.com/void-linux/void-packages/pull/24988

python-numpy: fix for armv5tel-musl.
in fenv.h, musl disables the normal set of constants that you would get
on arm with an arm device with an fpu (armv6 and up), but armv5tel on
void uses softfloat all the time. But python3-numpy dosen't use these to
interact with the fpu (the compiler would generate those instructions)
and rather just uses those constants for a generic GCC implementation.
So we give them out anyway.

python-numpy uses the same patch from python3-numpy.

A patch file from https://github.com/void-linux/void-packages/pull/24988.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-python-matplotlib-fix-24988.patch --]
[-- Type: text/x-diff, Size: 4160 bytes --]

From 8f1baaffbae125a450bfabe6173c7622c580f186 Mon Sep 17 00:00:00 2001
From: fosslinux <fosslinux@aussies.space>
Date: Sun, 20 Sep 2020 18:38:07 +1000
Subject: [PATCH 1/2] python3-numpy: fix armv5tel-musl.

in fenv.h, musl disables the normal set of constants that you would get
on arm with an arm device with an fpu (armv6 and up), but armv5tel on
void uses softfloat all the time. But python3-numpy dosen't use these to
interact with the fpu (the compiler would generate those instructions)
and rather just uses those constants for a generic GCC implementation.
So we give them out anyway.
---
 srcpkgs/python3-numpy/files/fenv-constants.h     | 10 ++++++++++
 srcpkgs/python3-numpy/files/fenv-constants.patch | 11 +++++++++++
 srcpkgs/python3-numpy/template                   |  9 +++++++++
 3 files changed, 30 insertions(+)
 create mode 100644 srcpkgs/python3-numpy/files/fenv-constants.h
 create mode 100644 srcpkgs/python3-numpy/files/fenv-constants.patch

diff --git a/srcpkgs/python3-numpy/files/fenv-constants.h b/srcpkgs/python3-numpy/files/fenv-constants.h
new file mode 100644
index 00000000000..c2c21d2bb23
--- /dev/null
+++ b/srcpkgs/python3-numpy/files/fenv-constants.h
@@ -0,0 +1,10 @@
+#define FE_INVALID    1
+#define FE_DIVBYZERO  2
+#define FE_OVERFLOW   4
+#define FE_UNDERFLOW  8
+#define FE_INEXACT    16
+#define FE_ALL_EXCEPT 31
+#define FE_TONEAREST  0
+#define FE_DOWNWARD   0x800000
+#define FE_UPWARD     0x400000
+#define FE_TOWARDZERO 0xc00000
diff --git a/srcpkgs/python3-numpy/files/fenv-constants.patch b/srcpkgs/python3-numpy/files/fenv-constants.patch
new file mode 100644
index 00000000000..987ad4e346f
--- /dev/null
+++ b/srcpkgs/python3-numpy/files/fenv-constants.patch
@@ -0,0 +1,11 @@
+--- numpy/core/src/npymath/ieee754.c.src	2020-09-20 14:53:51.998825328 +1000
++++ numpy/core/src/npymath/ieee754.c.src	2020-09-20 14:54:03.611889518 +1000
+@@ -8,6 +8,8 @@
+ #include "npy_math_private.h"
+ #include "numpy/utils.h"
+ 
++#include "fenv-constants.h"
++
+ #ifndef HAVE_COPYSIGN
+ double npy_copysign(double x, double y)
+ {
diff --git a/srcpkgs/python3-numpy/template b/srcpkgs/python3-numpy/template
index 759899d8e7b..c14d7381e67 100644
--- a/srcpkgs/python3-numpy/template
+++ b/srcpkgs/python3-numpy/template
@@ -16,6 +16,15 @@ distfiles="https://github.com/numpy/numpy/archive/v${version}.tar.gz"
 checksum=5ee0d6d17fe01dde9824811516d94ba8adb9349d81ef78d0696e6b03097498b8
 alternatives="numpy:f2py:/usr/bin/f2py3"
 
+post_patch() {
+	case "${XBPS_TARGET_MACHINE}" in
+		armv5tel-musl)
+			cp "${FILESDIR}/fenv-constants.h" numpy/core/src/npymath/
+			patch -Np0 -i "${FILESDIR}/fenv-constants.patch"
+			;;
+	esac
+}
+
 do_check() {
 	./runtests.py -v
 }

From 455dd91fd634a4abcbc5329303b224ca880dfac5 Mon Sep 17 00:00:00 2001
From: fosslinux <fosslinux@aussies.space>
Date: Sun, 20 Sep 2020 18:39:51 +1000
Subject: [PATCH 2/2] python-numpy: fix armv5tel-musl.

Uses the same patch and file from python3-numpy so we just use that from
python3-numpy's files directory.
---
 srcpkgs/python-numpy/template | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/python-numpy/template b/srcpkgs/python-numpy/template
index 52308fd2aa6..0a7f516b183 100644
--- a/srcpkgs/python-numpy/template
+++ b/srcpkgs/python-numpy/template
@@ -4,7 +4,6 @@ version=1.16.5
 revision=1
 wrksrc="numpy-${version}"
 build_style=python2-module
-pycompile_module="numpy"
 hostmakedepends="python-setuptools python-Cython gcc-fortran"
 makedepends="python-devel lapack-devel cblas-devel"
 short_desc="Fast and sophisticated array facility to Python2"
@@ -15,6 +14,17 @@ distfiles="https://github.com/numpy/numpy/archive/v${version}.tar.gz"
 checksum=3c82a9b8616e3096a79a2af9c288d8ed4013a10fc7baf3eaf54655309734dadd
 alternatives="numpy:f2py:/usr/bin/f2py2"
 
+post_patch() {
+	case "${XBPS_TARGET_MACHINE}" in
+		armv5tel-musl)
+			cp "${XBPS_SRCPKGDIR}/python3-numpy/files/fenv-constants.h" \
+				numpy/core/src/npymath/
+			patch -Np0 -i \
+				"${XBPS_SRCPKGDIR}/python3-numpy/files/fenv-constants.patch"
+			;;
+	esac
+}
+
 post_install() {
 	# create compat symlinks for .h files
 	vmkdir ${py2_inc}

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PR REVIEW] python-numpy: fix for armv5tel-musl.
  2020-09-20  8:18 [PR PATCH] python-numpy: fix for armv5tel-musl fosslinux
                   ` (2 preceding siblings ...)
  2020-09-22  6:04 ` [PR PATCH] [Updated] " fosslinux
@ 2020-09-25  0:31 ` sgn
  2020-09-25  8:10 ` fosslinux
                   ` (22 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: sgn @ 2020-09-25  0:31 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 154 bytes --]

New review comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/24988#discussion_r494682269

Comment:
`$FILESDIR`

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PR REVIEW] python-numpy: fix for armv5tel-musl.
  2020-09-20  8:18 [PR PATCH] python-numpy: fix for armv5tel-musl fosslinux
                   ` (3 preceding siblings ...)
  2020-09-25  0:31 ` [PR REVIEW] " sgn
@ 2020-09-25  8:10 ` fosslinux
  2020-09-29  4:39 ` [PR PATCH] [Updated] " fosslinux
                   ` (21 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: fosslinux @ 2020-09-25  8:10 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 199 bytes --]

New review comment by fosslinux on void-packages repository

https://github.com/void-linux/void-packages/pull/24988#discussion_r494820883

Comment:
No, `python3-numpy` is seperate to `python-numpy`.

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PR PATCH] [Updated] python-numpy: fix for armv5tel-musl.
  2020-09-20  8:18 [PR PATCH] python-numpy: fix for armv5tel-musl fosslinux
                   ` (4 preceding siblings ...)
  2020-09-25  8:10 ` fosslinux
@ 2020-09-29  4:39 ` fosslinux
  2020-10-01 22:52 ` fosslinux
                   ` (20 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: fosslinux @ 2020-09-29  4:39 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 789 bytes --]

There is an updated pull request by fosslinux against master on the void-packages repository

https://github.com/fosslinux/void-packages python-matplotlib-fix
https://github.com/void-linux/void-packages/pull/24988

python-numpy: fix for armv5tel-musl.
in fenv.h, musl disables the normal set of constants that you would get
on arm with an arm device with an fpu (armv6 and up), but armv5tel on
void uses softfloat all the time. But python3-numpy dosen't use these to
interact with the fpu (the compiler would generate those instructions)
and rather just uses those constants for a generic GCC implementation.
So we give them out anyway.

python-numpy uses the same patch from python3-numpy.

A patch file from https://github.com/void-linux/void-packages/pull/24988.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-python-matplotlib-fix-24988.patch --]
[-- Type: text/x-diff, Size: 4160 bytes --]

From 8f1baaffbae125a450bfabe6173c7622c580f186 Mon Sep 17 00:00:00 2001
From: fosslinux <fosslinux@aussies.space>
Date: Sun, 20 Sep 2020 18:38:07 +1000
Subject: [PATCH 1/2] python3-numpy: fix armv5tel-musl.

in fenv.h, musl disables the normal set of constants that you would get
on arm with an arm device with an fpu (armv6 and up), but armv5tel on
void uses softfloat all the time. But python3-numpy dosen't use these to
interact with the fpu (the compiler would generate those instructions)
and rather just uses those constants for a generic GCC implementation.
So we give them out anyway.
---
 srcpkgs/python3-numpy/files/fenv-constants.h     | 10 ++++++++++
 srcpkgs/python3-numpy/files/fenv-constants.patch | 11 +++++++++++
 srcpkgs/python3-numpy/template                   |  9 +++++++++
 3 files changed, 30 insertions(+)
 create mode 100644 srcpkgs/python3-numpy/files/fenv-constants.h
 create mode 100644 srcpkgs/python3-numpy/files/fenv-constants.patch

diff --git a/srcpkgs/python3-numpy/files/fenv-constants.h b/srcpkgs/python3-numpy/files/fenv-constants.h
new file mode 100644
index 00000000000..c2c21d2bb23
--- /dev/null
+++ b/srcpkgs/python3-numpy/files/fenv-constants.h
@@ -0,0 +1,10 @@
+#define FE_INVALID    1
+#define FE_DIVBYZERO  2
+#define FE_OVERFLOW   4
+#define FE_UNDERFLOW  8
+#define FE_INEXACT    16
+#define FE_ALL_EXCEPT 31
+#define FE_TONEAREST  0
+#define FE_DOWNWARD   0x800000
+#define FE_UPWARD     0x400000
+#define FE_TOWARDZERO 0xc00000
diff --git a/srcpkgs/python3-numpy/files/fenv-constants.patch b/srcpkgs/python3-numpy/files/fenv-constants.patch
new file mode 100644
index 00000000000..987ad4e346f
--- /dev/null
+++ b/srcpkgs/python3-numpy/files/fenv-constants.patch
@@ -0,0 +1,11 @@
+--- numpy/core/src/npymath/ieee754.c.src	2020-09-20 14:53:51.998825328 +1000
++++ numpy/core/src/npymath/ieee754.c.src	2020-09-20 14:54:03.611889518 +1000
+@@ -8,6 +8,8 @@
+ #include "npy_math_private.h"
+ #include "numpy/utils.h"
+ 
++#include "fenv-constants.h"
++
+ #ifndef HAVE_COPYSIGN
+ double npy_copysign(double x, double y)
+ {
diff --git a/srcpkgs/python3-numpy/template b/srcpkgs/python3-numpy/template
index 759899d8e7b..c14d7381e67 100644
--- a/srcpkgs/python3-numpy/template
+++ b/srcpkgs/python3-numpy/template
@@ -16,6 +16,15 @@ distfiles="https://github.com/numpy/numpy/archive/v${version}.tar.gz"
 checksum=5ee0d6d17fe01dde9824811516d94ba8adb9349d81ef78d0696e6b03097498b8
 alternatives="numpy:f2py:/usr/bin/f2py3"
 
+post_patch() {
+	case "${XBPS_TARGET_MACHINE}" in
+		armv5tel-musl)
+			cp "${FILESDIR}/fenv-constants.h" numpy/core/src/npymath/
+			patch -Np0 -i "${FILESDIR}/fenv-constants.patch"
+			;;
+	esac
+}
+
 do_check() {
 	./runtests.py -v
 }

From 8c27a6042b04af70c590f1f40b45845c08d45263 Mon Sep 17 00:00:00 2001
From: fosslinux <fosslinux@aussies.space>
Date: Sun, 20 Sep 2020 18:39:51 +1000
Subject: [PATCH 2/2] python-numpy: fix armv5tel-musl.

Uses the same patch and file from python3-numpy so we just use that from
python3-numpy's files directory.
---
 srcpkgs/python-numpy/template | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/python-numpy/template b/srcpkgs/python-numpy/template
index 52308fd2aa6..0a7f516b183 100644
--- a/srcpkgs/python-numpy/template
+++ b/srcpkgs/python-numpy/template
@@ -4,7 +4,6 @@ version=1.16.5
 revision=1
 wrksrc="numpy-${version}"
 build_style=python2-module
-pycompile_module="numpy"
 hostmakedepends="python-setuptools python-Cython gcc-fortran"
 makedepends="python-devel lapack-devel cblas-devel"
 short_desc="Fast and sophisticated array facility to Python2"
@@ -15,6 +14,17 @@ distfiles="https://github.com/numpy/numpy/archive/v${version}.tar.gz"
 checksum=3c82a9b8616e3096a79a2af9c288d8ed4013a10fc7baf3eaf54655309734dadd
 alternatives="numpy:f2py:/usr/bin/f2py2"
 
+post_patch() {
+	case "${XBPS_TARGET_MACHINE}" in
+		armv5tel-musl)
+			cp "${XBPS_SRCPKGDIR}/python3-numpy/files/fenv-constants.h" \
+				numpy/core/src/npymath/
+			patch -Np0 -i \
+				"${XBPS_SRCPKGDIR}/python3-numpy/files/fenv-constants.patch"
+			;;
+	esac
+}
+
 post_install() {
 	# create compat symlinks for .h files
 	vmkdir ${py2_inc}

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: python-numpy: fix for armv5tel-musl.
  2020-09-20  8:18 [PR PATCH] python-numpy: fix for armv5tel-musl fosslinux
                   ` (5 preceding siblings ...)
  2020-09-29  4:39 ` [PR PATCH] [Updated] " fosslinux
@ 2020-10-01 22:52 ` fosslinux
  2020-10-09 20:21 ` [PR REVIEW] " ericonr
                   ` (19 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: fosslinux @ 2020-10-01 22:52 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 147 bytes --]

New comment by fosslinux on void-packages repository

https://github.com/void-linux/void-packages/pull/24988#issuecomment-702437655

Comment:
ping

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PR REVIEW] python-numpy: fix for armv5tel-musl.
  2020-09-20  8:18 [PR PATCH] python-numpy: fix for armv5tel-musl fosslinux
                   ` (6 preceding siblings ...)
  2020-10-01 22:52 ` fosslinux
@ 2020-10-09 20:21 ` ericonr
  2020-10-10  2:41 ` fosslinux
                   ` (18 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: ericonr @ 2020-10-09 20:21 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 177 bytes --]

New review comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/24988#discussion_r502653633

Comment:
Could it be symlinked instead?

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PR REVIEW] python-numpy: fix for armv5tel-musl.
  2020-09-20  8:18 [PR PATCH] python-numpy: fix for armv5tel-musl fosslinux
                   ` (7 preceding siblings ...)
  2020-10-09 20:21 ` [PR REVIEW] " ericonr
@ 2020-10-10  2:41 ` fosslinux
  2020-10-10  2:59 ` [PR PATCH] [Updated] " fosslinux
                   ` (17 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: fosslinux @ 2020-10-10  2:41 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 156 bytes --]

New review comment by fosslinux on void-packages repository

https://github.com/void-linux/void-packages/pull/24988#discussion_r502735954

Comment:
i guess

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PR PATCH] [Updated] python-numpy: fix for armv5tel-musl.
  2020-09-20  8:18 [PR PATCH] python-numpy: fix for armv5tel-musl fosslinux
                   ` (8 preceding siblings ...)
  2020-10-10  2:41 ` fosslinux
@ 2020-10-10  2:59 ` fosslinux
  2020-10-10  4:21 ` [PR REVIEW] " ericonr
                   ` (16 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: fosslinux @ 2020-10-10  2:59 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 789 bytes --]

There is an updated pull request by fosslinux against master on the void-packages repository

https://github.com/fosslinux/void-packages python-matplotlib-fix
https://github.com/void-linux/void-packages/pull/24988

python-numpy: fix for armv5tel-musl.
in fenv.h, musl disables the normal set of constants that you would get
on arm with an arm device with an fpu (armv6 and up), but armv5tel on
void uses softfloat all the time. But python3-numpy dosen't use these to
interact with the fpu (the compiler would generate those instructions)
and rather just uses those constants for a generic GCC implementation.
So we give them out anyway.

python-numpy uses the same patch from python3-numpy.

A patch file from https://github.com/void-linux/void-packages/pull/24988.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-python-matplotlib-fix-24988.patch --]
[-- Type: text/x-diff, Size: 4981 bytes --]

From 8f1baaffbae125a450bfabe6173c7622c580f186 Mon Sep 17 00:00:00 2001
From: fosslinux <fosslinux@aussies.space>
Date: Sun, 20 Sep 2020 18:38:07 +1000
Subject: [PATCH 1/2] python3-numpy: fix armv5tel-musl.

in fenv.h, musl disables the normal set of constants that you would get
on arm with an arm device with an fpu (armv6 and up), but armv5tel on
void uses softfloat all the time. But python3-numpy dosen't use these to
interact with the fpu (the compiler would generate those instructions)
and rather just uses those constants for a generic GCC implementation.
So we give them out anyway.
---
 srcpkgs/python3-numpy/files/fenv-constants.h     | 10 ++++++++++
 srcpkgs/python3-numpy/files/fenv-constants.patch | 11 +++++++++++
 srcpkgs/python3-numpy/template                   |  9 +++++++++
 3 files changed, 30 insertions(+)
 create mode 100644 srcpkgs/python3-numpy/files/fenv-constants.h
 create mode 100644 srcpkgs/python3-numpy/files/fenv-constants.patch

diff --git a/srcpkgs/python3-numpy/files/fenv-constants.h b/srcpkgs/python3-numpy/files/fenv-constants.h
new file mode 100644
index 00000000000..c2c21d2bb23
--- /dev/null
+++ b/srcpkgs/python3-numpy/files/fenv-constants.h
@@ -0,0 +1,10 @@
+#define FE_INVALID    1
+#define FE_DIVBYZERO  2
+#define FE_OVERFLOW   4
+#define FE_UNDERFLOW  8
+#define FE_INEXACT    16
+#define FE_ALL_EXCEPT 31
+#define FE_TONEAREST  0
+#define FE_DOWNWARD   0x800000
+#define FE_UPWARD     0x400000
+#define FE_TOWARDZERO 0xc00000
diff --git a/srcpkgs/python3-numpy/files/fenv-constants.patch b/srcpkgs/python3-numpy/files/fenv-constants.patch
new file mode 100644
index 00000000000..987ad4e346f
--- /dev/null
+++ b/srcpkgs/python3-numpy/files/fenv-constants.patch
@@ -0,0 +1,11 @@
+--- numpy/core/src/npymath/ieee754.c.src	2020-09-20 14:53:51.998825328 +1000
++++ numpy/core/src/npymath/ieee754.c.src	2020-09-20 14:54:03.611889518 +1000
+@@ -8,6 +8,8 @@
+ #include "npy_math_private.h"
+ #include "numpy/utils.h"
+ 
++#include "fenv-constants.h"
++
+ #ifndef HAVE_COPYSIGN
+ double npy_copysign(double x, double y)
+ {
diff --git a/srcpkgs/python3-numpy/template b/srcpkgs/python3-numpy/template
index 759899d8e7b..c14d7381e67 100644
--- a/srcpkgs/python3-numpy/template
+++ b/srcpkgs/python3-numpy/template
@@ -16,6 +16,15 @@ distfiles="https://github.com/numpy/numpy/archive/v${version}.tar.gz"
 checksum=5ee0d6d17fe01dde9824811516d94ba8adb9349d81ef78d0696e6b03097498b8
 alternatives="numpy:f2py:/usr/bin/f2py3"
 
+post_patch() {
+	case "${XBPS_TARGET_MACHINE}" in
+		armv5tel-musl)
+			cp "${FILESDIR}/fenv-constants.h" numpy/core/src/npymath/
+			patch -Np0 -i "${FILESDIR}/fenv-constants.patch"
+			;;
+	esac
+}
+
 do_check() {
 	./runtests.py -v
 }

From 4d31ce465d04bb86724df8a02b099165662e6b5d Mon Sep 17 00:00:00 2001
From: fosslinux <fosslinux@aussies.space>
Date: Sun, 20 Sep 2020 18:39:51 +1000
Subject: [PATCH 2/2] python-numpy: fix armv5tel-musl.

Uses the same patch and file from python3-numpy so we just use that from
python3-numpy's files directory.
---
 srcpkgs/python-numpy/files/fenv-constants.h     |  1 +
 srcpkgs/python-numpy/files/fenv-constants.patch |  1 +
 srcpkgs/python-numpy/template                   | 10 +++++++++-
 3 files changed, 11 insertions(+), 1 deletion(-)
 create mode 120000 srcpkgs/python-numpy/files/fenv-constants.h
 create mode 120000 srcpkgs/python-numpy/files/fenv-constants.patch

diff --git a/srcpkgs/python-numpy/files/fenv-constants.h b/srcpkgs/python-numpy/files/fenv-constants.h
new file mode 120000
index 00000000000..86d35649862
--- /dev/null
+++ b/srcpkgs/python-numpy/files/fenv-constants.h
@@ -0,0 +1 @@
+../../python3-numpy/files/fenv-constants.h
\ No newline at end of file
diff --git a/srcpkgs/python-numpy/files/fenv-constants.patch b/srcpkgs/python-numpy/files/fenv-constants.patch
new file mode 120000
index 00000000000..d2bd2a08e21
--- /dev/null
+++ b/srcpkgs/python-numpy/files/fenv-constants.patch
@@ -0,0 +1 @@
+../../python3-numpy/files/fenv-constants.patch
\ No newline at end of file
diff --git a/srcpkgs/python-numpy/template b/srcpkgs/python-numpy/template
index 52308fd2aa6..d0bc473d65a 100644
--- a/srcpkgs/python-numpy/template
+++ b/srcpkgs/python-numpy/template
@@ -4,7 +4,6 @@ version=1.16.5
 revision=1
 wrksrc="numpy-${version}"
 build_style=python2-module
-pycompile_module="numpy"
 hostmakedepends="python-setuptools python-Cython gcc-fortran"
 makedepends="python-devel lapack-devel cblas-devel"
 short_desc="Fast and sophisticated array facility to Python2"
@@ -15,6 +14,15 @@ distfiles="https://github.com/numpy/numpy/archive/v${version}.tar.gz"
 checksum=3c82a9b8616e3096a79a2af9c288d8ed4013a10fc7baf3eaf54655309734dadd
 alternatives="numpy:f2py:/usr/bin/f2py2"
 
+post_patch() {
+	case "${XBPS_TARGET_MACHINE}" in
+		armv5tel-musl)
+			cp "${FILESDIR}/fenv-constants.h" numpy/core/src/npymath/
+			patch -Np0 -i "${FILESDIR}/fenv-constants.patch"
+			;;
+	esac
+}
+
 post_install() {
 	# create compat symlinks for .h files
 	vmkdir ${py2_inc}

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PR REVIEW] python-numpy: fix for armv5tel-musl.
  2020-09-20  8:18 [PR PATCH] python-numpy: fix for armv5tel-musl fosslinux
                   ` (9 preceding siblings ...)
  2020-10-10  2:59 ` [PR PATCH] [Updated] " fosslinux
@ 2020-10-10  4:21 ` ericonr
  2020-10-10 10:20 ` fosslinux
                   ` (15 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: ericonr @ 2020-10-10  4:21 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 202 bytes --]

New review comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/24988#discussion_r502743944

Comment:
I was thinking more of symlinking the entire folder D: 

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PR REVIEW] python-numpy: fix for armv5tel-musl.
  2020-09-20  8:18 [PR PATCH] python-numpy: fix for armv5tel-musl fosslinux
                   ` (10 preceding siblings ...)
  2020-10-10  4:21 ` [PR REVIEW] " ericonr
@ 2020-10-10 10:20 ` fosslinux
  2020-12-01  0:27 ` sgn
                   ` (14 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: fosslinux @ 2020-10-10 10:20 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 264 bytes --]

New review comment by fosslinux on void-packages repository

https://github.com/void-linux/void-packages/pull/24988#discussion_r502774431

Comment:
I don't really like that.. the `files/` folder should be independent of any one specific patch/fix that is applied.

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: python-numpy: fix for armv5tel-musl.
  2020-09-20  8:18 [PR PATCH] python-numpy: fix for armv5tel-musl fosslinux
                   ` (11 preceding siblings ...)
  2020-10-10 10:20 ` fosslinux
@ 2020-12-01  0:27 ` sgn
  2020-12-01  0:43 ` sgn
                   ` (13 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: sgn @ 2020-12-01  0:27 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 173 bytes --]

New comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/24988#issuecomment-736137177

Comment:
I think the fix should go to `musl`?

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: python-numpy: fix for armv5tel-musl.
  2020-09-20  8:18 [PR PATCH] python-numpy: fix for armv5tel-musl fosslinux
                   ` (12 preceding siblings ...)
  2020-12-01  0:27 ` sgn
@ 2020-12-01  0:43 ` sgn
  2020-12-01  0:47 ` sgn
                   ` (12 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: sgn @ 2020-12-01  0:43 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 237 bytes --]

New comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/24988#issuecomment-736142865

Comment:
It's weird that `musl-devel` for armv5tel-musl has those macro defined in `/usr/include/bits/fenv.h`

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: python-numpy: fix for armv5tel-musl.
  2020-09-20  8:18 [PR PATCH] python-numpy: fix for armv5tel-musl fosslinux
                   ` (13 preceding siblings ...)
  2020-12-01  0:43 ` sgn
@ 2020-12-01  0:47 ` sgn
  2020-12-01  1:10 ` ericonr
                   ` (11 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: sgn @ 2020-12-01  0:47 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 275 bytes --]

New comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/24988#issuecomment-736142865

Comment:
~It's weird that `musl-devel` for armv5tel-musl has those macro defined in `/usr/include/bits/fenv.h`~

I need to read everything again.

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: python-numpy: fix for armv5tel-musl.
  2020-09-20  8:18 [PR PATCH] python-numpy: fix for armv5tel-musl fosslinux
                   ` (14 preceding siblings ...)
  2020-12-01  0:47 ` sgn
@ 2020-12-01  1:10 ` ericonr
  2020-12-09  5:08 ` [PR REVIEW] " ahesford
                   ` (10 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: ericonr @ 2020-12-01  1:10 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 196 bytes --]

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/24988#issuecomment-736151233

Comment:
@sgn LGTM, if you've cleared up everything on your end.

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PR REVIEW] python-numpy: fix for armv5tel-musl.
  2020-09-20  8:18 [PR PATCH] python-numpy: fix for armv5tel-musl fosslinux
                   ` (15 preceding siblings ...)
  2020-12-01  1:10 ` ericonr
@ 2020-12-09  5:08 ` ahesford
  2020-12-09  7:17 ` fosslinux
                   ` (9 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: ahesford @ 2020-12-09  5:08 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 438 bytes --]

New review comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/24988#discussion_r539009625

Comment:
I think both of these options are bad. If somebody changes or removes the `python3-numpy` files (which becomes more likely the further the versions of the py2 and py3 packages diverge), the symlink or the cross-template copy will break. If this package needs this header, let it own a copy.

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PR REVIEW] python-numpy: fix for armv5tel-musl.
  2020-09-20  8:18 [PR PATCH] python-numpy: fix for armv5tel-musl fosslinux
                   ` (16 preceding siblings ...)
  2020-12-09  5:08 ` [PR REVIEW] " ahesford
@ 2020-12-09  7:17 ` fosslinux
  2020-12-31  1:06 ` [PR PATCH] [Updated] " fosslinux
                   ` (8 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: fosslinux @ 2020-12-09  7:17 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 232 bytes --]

New review comment by fosslinux on void-packages repository

https://github.com/void-linux/void-packages/pull/24988#discussion_r539063470

Comment:
I agree, I only changed it because @ericonr asked for it, but I can change it back.

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PR PATCH] [Updated] python-numpy: fix for armv5tel-musl.
  2020-09-20  8:18 [PR PATCH] python-numpy: fix for armv5tel-musl fosslinux
                   ` (17 preceding siblings ...)
  2020-12-09  7:17 ` fosslinux
@ 2020-12-31  1:06 ` fosslinux
  2020-12-31  1:22 ` fosslinux
                   ` (7 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: fosslinux @ 2020-12-31  1:06 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 789 bytes --]

There is an updated pull request by fosslinux against master on the void-packages repository

https://github.com/fosslinux/void-packages python-matplotlib-fix
https://github.com/void-linux/void-packages/pull/24988

python-numpy: fix for armv5tel-musl.
in fenv.h, musl disables the normal set of constants that you would get
on arm with an arm device with an fpu (armv6 and up), but armv5tel on
void uses softfloat all the time. But python3-numpy dosen't use these to
interact with the fpu (the compiler would generate those instructions)
and rather just uses those constants for a generic GCC implementation.
So we give them out anyway.

python-numpy uses the same patch from python3-numpy.

A patch file from https://github.com/void-linux/void-packages/pull/24988.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-python-matplotlib-fix-24988.patch --]
[-- Type: text/x-diff, Size: 8393 bytes --]

From ccfe9f657dbef5ec20154f02d2ba69bc94d62ea7 Mon Sep 17 00:00:00 2001
From: fosslinux <fosslinux@aussies.space>
Date: Sun, 20 Sep 2020 18:38:07 +1000
Subject: [PATCH 1/2] python3-numpy: fix armv5tel-musl.

in fenv.h, musl disables the normal set of constants that you would get
on arm with an arm device with an fpu (armv6 and up), but armv5tel on
void uses softfloat all the time. But python3-numpy dosen't use these to
interact with the fpu (the compiler would generate those instructions)
and rather just uses those constants for a generic GCC implementation.
So we give them out anyway.
---
 srcpkgs/python3-numpy/files/fenv-constants.h     | 10 ++++++++++
 srcpkgs/python3-numpy/files/fenv-constants.patch | 11 +++++++++++
 srcpkgs/python3-numpy/template                   |  9 +++++++++
 3 files changed, 30 insertions(+)
 create mode 100644 srcpkgs/python3-numpy/files/fenv-constants.h
 create mode 100644 srcpkgs/python3-numpy/files/fenv-constants.patch

diff --git a/srcpkgs/python3-numpy/files/fenv-constants.h b/srcpkgs/python3-numpy/files/fenv-constants.h
new file mode 100644
index 00000000000..c2c21d2bb23
--- /dev/null
+++ b/srcpkgs/python3-numpy/files/fenv-constants.h
@@ -0,0 +1,10 @@
+#define FE_INVALID    1
+#define FE_DIVBYZERO  2
+#define FE_OVERFLOW   4
+#define FE_UNDERFLOW  8
+#define FE_INEXACT    16
+#define FE_ALL_EXCEPT 31
+#define FE_TONEAREST  0
+#define FE_DOWNWARD   0x800000
+#define FE_UPWARD     0x400000
+#define FE_TOWARDZERO 0xc00000
diff --git a/srcpkgs/python3-numpy/files/fenv-constants.patch b/srcpkgs/python3-numpy/files/fenv-constants.patch
new file mode 100644
index 00000000000..987ad4e346f
--- /dev/null
+++ b/srcpkgs/python3-numpy/files/fenv-constants.patch
@@ -0,0 +1,11 @@
+--- numpy/core/src/npymath/ieee754.c.src	2020-09-20 14:53:51.998825328 +1000
++++ numpy/core/src/npymath/ieee754.c.src	2020-09-20 14:54:03.611889518 +1000
+@@ -8,6 +8,8 @@
+ #include "npy_math_private.h"
+ #include "numpy/utils.h"
+ 
++#include "fenv-constants.h"
++
+ #ifndef HAVE_COPYSIGN
+ double npy_copysign(double x, double y)
+ {
diff --git a/srcpkgs/python3-numpy/template b/srcpkgs/python3-numpy/template
index e54a96772e0..38722f29b4f 100644
--- a/srcpkgs/python3-numpy/template
+++ b/srcpkgs/python3-numpy/template
@@ -16,6 +16,15 @@ distfiles="https://github.com/numpy/numpy/archive/v${version}.tar.gz"
 checksum=6082884371a5998fa8b006b506f4827c0617d789d7b3ee78549bb044139a9a8e
 alternatives="numpy:f2py:/usr/bin/f2py3"
 
+post_patch() {
+	case "${XBPS_TARGET_MACHINE}" in
+		armv5tel-musl)
+			cp "${FILESDIR}/fenv-constants.h" numpy/core/src/npymath/
+			patch -Np0 -i "${FILESDIR}/fenv-constants.patch"
+			;;
+	esac
+}
+
 do_check() {
 	./runtests.py -v
 }

From 920f2ff8f707368dff033a110af3011d88285e60 Mon Sep 17 00:00:00 2001
From: fosslinux <fosslinux@aussies.space>
Date: Sun, 20 Sep 2020 18:39:51 +1000
Subject: [PATCH 2/2] python-numpy: fix armv5tel-musl.

Uses the same patch and file from python3-numpy so we just use that from
python3-numpy's files directory.
---
 srcpkgs/m4/files/no-info.patch                | 69 +++++++++++++++++++
 srcpkgs/python-numpy/files/fenv-constants.h   | 10 +++
 .../python-numpy/files/fenv-constants.patch   | 11 +++
 srcpkgs/python-numpy/template                 | 10 ++-
 4 files changed, 99 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/m4/files/no-info.patch
 create mode 100644 srcpkgs/python-numpy/files/fenv-constants.h
 create mode 100644 srcpkgs/python-numpy/files/fenv-constants.patch

diff --git a/srcpkgs/m4/files/no-info.patch b/srcpkgs/m4/files/no-info.patch
new file mode 100644
index 00000000000..29a7790f7fb
--- /dev/null
+++ b/srcpkgs/m4/files/no-info.patch
@@ -0,0 +1,69 @@
+diff --color -ru m4-1.4.18.bak/doc/Makefile.in m4-1.4.18/doc/Makefile.in
+--- m4-1.4.18.bak/doc/Makefile.in	2020-10-19 18:24:44.463675435 +1100
++++ m4-1.4.18/doc/Makefile.in	2020-10-19 18:27:53.400673200 +1100
+@@ -251,7 +251,7 @@
+ am__v_texidevnull_ = $(am__v_texidevnull_@AM_DEFAULT_V@)
+ am__v_texidevnull_0 = > /dev/null
+ am__v_texidevnull_1 = 
+-INFO_DEPS = $(srcdir)/m4.info
++INFO_DEPS =
+ TEXINFO_TEX = $(top_srcdir)/build-aux/texinfo.tex
+ am__TEXINFO_TEX_DIR = $(top_srcdir)/build-aux
+ DVIS = m4.dvi
+@@ -1500,7 +1500,7 @@
+ all: all-am
+ 
+ .SUFFIXES:
+-.SUFFIXES: .1 .dvi .html .info .pdf .ps .texi
++.SUFFIXES: .1 .dvi .html .pdf .ps .texi
+ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+ 	@for dep in $?; do \
+ 	  case '$(am__configure_deps)' in \
+@@ -1531,28 +1531,6 @@
+ 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+ $(am__aclocal_m4_deps):
+ 
+-.texi.info:
+-	$(AM_V_MAKEINFO)restore=: && backupdir="$(am__leading_dot)am$$$$" && \
+-	am__cwd=`pwd` && $(am__cd) $(srcdir) && \
+-	rm -rf $$backupdir && mkdir $$backupdir && \
+-	if ($(MAKEINFO) --version) >/dev/null 2>&1; then \
+-	  for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \
+-	    if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \
+-	  done; \
+-	else :; fi && \
+-	cd "$$am__cwd"; \
+-	if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
+-	 -o $@ $<; \
+-	then \
+-	  rc=0; \
+-	  $(am__cd) $(srcdir); \
+-	else \
+-	  rc=$$?; \
+-	  $(am__cd) $(srcdir) && \
+-	  $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \
+-	fi; \
+-	rm -rf $$backupdir; exit $$rc
+-
+ .texi.dvi:
+ 	$(AM_V_TEXI2DVI)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
+ 	MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
+@@ -1574,7 +1552,6 @@
+ 	else \
+ 	  rm -rf $(@:.html=.htp); exit 1; \
+ 	fi
+-$(srcdir)/m4.info: m4.texi $(srcdir)/version.texi $(m4_TEXINFOS)
+ m4.dvi: m4.texi $(srcdir)/version.texi $(m4_TEXINFOS)
+ m4.pdf: m4.texi $(srcdir)/version.texi $(m4_TEXINFOS)
+ m4.html: m4.texi $(srcdir)/version.texi $(m4_TEXINFOS)
+diff --color -ru m4-1.4.18.bak/Makefile m4-1.4.18/Makefile
+--- m4-1.4.18.bak/Makefile	2020-10-19 18:24:44.412675166 +1100
++++ m4-1.4.18/Makefile	2020-10-19 18:25:28.598908512 +1100
+@@ -1126,7 +1126,6 @@
+ M4tests_LIBOBJS = 
+ M4tests_LTLIBOBJS = 
+ M4tests_WITNESS = IN_M4_GNULIB_TESTS
+-MAKEINFO = ${SHELL} /builddir/m4-1.4.18/build-aux/missing makeinfo
+ MKDIR_P = /usr/bin/mkdir -p
+ NEXT_AS_FIRST_DIRECTIVE_CTYPE_H = <ctype.h>
+ NEXT_AS_FIRST_DIRECTIVE_DIRENT_H = <dirent.h>
diff --git a/srcpkgs/python-numpy/files/fenv-constants.h b/srcpkgs/python-numpy/files/fenv-constants.h
new file mode 100644
index 00000000000..c2c21d2bb23
--- /dev/null
+++ b/srcpkgs/python-numpy/files/fenv-constants.h
@@ -0,0 +1,10 @@
+#define FE_INVALID    1
+#define FE_DIVBYZERO  2
+#define FE_OVERFLOW   4
+#define FE_UNDERFLOW  8
+#define FE_INEXACT    16
+#define FE_ALL_EXCEPT 31
+#define FE_TONEAREST  0
+#define FE_DOWNWARD   0x800000
+#define FE_UPWARD     0x400000
+#define FE_TOWARDZERO 0xc00000
diff --git a/srcpkgs/python-numpy/files/fenv-constants.patch b/srcpkgs/python-numpy/files/fenv-constants.patch
new file mode 100644
index 00000000000..987ad4e346f
--- /dev/null
+++ b/srcpkgs/python-numpy/files/fenv-constants.patch
@@ -0,0 +1,11 @@
+--- numpy/core/src/npymath/ieee754.c.src	2020-09-20 14:53:51.998825328 +1000
++++ numpy/core/src/npymath/ieee754.c.src	2020-09-20 14:54:03.611889518 +1000
+@@ -8,6 +8,8 @@
+ #include "npy_math_private.h"
+ #include "numpy/utils.h"
+ 
++#include "fenv-constants.h"
++
+ #ifndef HAVE_COPYSIGN
+ double npy_copysign(double x, double y)
+ {
diff --git a/srcpkgs/python-numpy/template b/srcpkgs/python-numpy/template
index 52308fd2aa6..d0bc473d65a 100644
--- a/srcpkgs/python-numpy/template
+++ b/srcpkgs/python-numpy/template
@@ -4,7 +4,6 @@ version=1.16.5
 revision=1
 wrksrc="numpy-${version}"
 build_style=python2-module
-pycompile_module="numpy"
 hostmakedepends="python-setuptools python-Cython gcc-fortran"
 makedepends="python-devel lapack-devel cblas-devel"
 short_desc="Fast and sophisticated array facility to Python2"
@@ -15,6 +14,15 @@ distfiles="https://github.com/numpy/numpy/archive/v${version}.tar.gz"
 checksum=3c82a9b8616e3096a79a2af9c288d8ed4013a10fc7baf3eaf54655309734dadd
 alternatives="numpy:f2py:/usr/bin/f2py2"
 
+post_patch() {
+	case "${XBPS_TARGET_MACHINE}" in
+		armv5tel-musl)
+			cp "${FILESDIR}/fenv-constants.h" numpy/core/src/npymath/
+			patch -Np0 -i "${FILESDIR}/fenv-constants.patch"
+			;;
+	esac
+}
+
 post_install() {
 	# create compat symlinks for .h files
 	vmkdir ${py2_inc}

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PR PATCH] [Updated] python-numpy: fix for armv5tel-musl.
  2020-09-20  8:18 [PR PATCH] python-numpy: fix for armv5tel-musl fosslinux
                   ` (18 preceding siblings ...)
  2020-12-31  1:06 ` [PR PATCH] [Updated] " fosslinux
@ 2020-12-31  1:22 ` fosslinux
  2020-12-31  1:22 ` [PR REVIEW] " fosslinux
                   ` (6 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: fosslinux @ 2020-12-31  1:22 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 789 bytes --]

There is an updated pull request by fosslinux against master on the void-packages repository

https://github.com/fosslinux/void-packages python-matplotlib-fix
https://github.com/void-linux/void-packages/pull/24988

python-numpy: fix for armv5tel-musl.
in fenv.h, musl disables the normal set of constants that you would get
on arm with an arm device with an fpu (armv6 and up), but armv5tel on
void uses softfloat all the time. But python3-numpy dosen't use these to
interact with the fpu (the compiler would generate those instructions)
and rather just uses those constants for a generic GCC implementation.
So we give them out anyway.

python-numpy uses the same patch from python3-numpy.

A patch file from https://github.com/void-linux/void-packages/pull/24988.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-python-matplotlib-fix-24988.patch --]
[-- Type: text/x-diff, Size: 8479 bytes --]

From c3e78f8692e4a8c9410b2e22e16b56a2f7b40cd3 Mon Sep 17 00:00:00 2001
From: fosslinux <fosslinux@aussies.space>
Date: Sun, 20 Sep 2020 18:38:07 +1000
Subject: [PATCH 1/2] python3-numpy: fix armv5tel-musl.

in fenv.h, musl disables the normal set of constants that you would get
on arm with an arm device with an fpu (armv6 and up), but armv5tel on
void uses softfloat all the time. But python3-numpy dosen't use these to
interact with the fpu (the compiler would generate those instructions)
and rather just uses those constants for a generic GCC implementation.
So we give them out anyway.
---
 srcpkgs/python3-numpy/files/fenv-constants.h     | 10 ++++++++++
 srcpkgs/python3-numpy/files/fenv-constants.patch | 11 +++++++++++
 srcpkgs/python3-numpy/template                   | 11 ++++++++++-
 3 files changed, 31 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/python3-numpy/files/fenv-constants.h
 create mode 100644 srcpkgs/python3-numpy/files/fenv-constants.patch

diff --git a/srcpkgs/python3-numpy/files/fenv-constants.h b/srcpkgs/python3-numpy/files/fenv-constants.h
new file mode 100644
index 00000000000..c2c21d2bb23
--- /dev/null
+++ b/srcpkgs/python3-numpy/files/fenv-constants.h
@@ -0,0 +1,10 @@
+#define FE_INVALID    1
+#define FE_DIVBYZERO  2
+#define FE_OVERFLOW   4
+#define FE_UNDERFLOW  8
+#define FE_INEXACT    16
+#define FE_ALL_EXCEPT 31
+#define FE_TONEAREST  0
+#define FE_DOWNWARD   0x800000
+#define FE_UPWARD     0x400000
+#define FE_TOWARDZERO 0xc00000
diff --git a/srcpkgs/python3-numpy/files/fenv-constants.patch b/srcpkgs/python3-numpy/files/fenv-constants.patch
new file mode 100644
index 00000000000..987ad4e346f
--- /dev/null
+++ b/srcpkgs/python3-numpy/files/fenv-constants.patch
@@ -0,0 +1,11 @@
+--- numpy/core/src/npymath/ieee754.c.src	2020-09-20 14:53:51.998825328 +1000
++++ numpy/core/src/npymath/ieee754.c.src	2020-09-20 14:54:03.611889518 +1000
+@@ -8,6 +8,8 @@
+ #include "npy_math_private.h"
+ #include "numpy/utils.h"
+ 
++#include "fenv-constants.h"
++
+ #ifndef HAVE_COPYSIGN
+ double npy_copysign(double x, double y)
+ {
diff --git a/srcpkgs/python3-numpy/template b/srcpkgs/python3-numpy/template
index e54a96772e0..5ae5b16986e 100644
--- a/srcpkgs/python3-numpy/template
+++ b/srcpkgs/python3-numpy/template
@@ -16,8 +16,17 @@ distfiles="https://github.com/numpy/numpy/archive/v${version}.tar.gz"
 checksum=6082884371a5998fa8b006b506f4827c0617d789d7b3ee78549bb044139a9a8e
 alternatives="numpy:f2py:/usr/bin/f2py3"
 
+post_patch() {
+	case "${XBPS_TARGET_MACHINE}" in
+		armv5tel-musl)
+			cp "${FILESDIR}/fenv-constants.h" numpy/core/src/npymath/
+			patch -Np0 -i "${FILESDIR}/fenv-constants.patch"
+			;;
+	esac
+}
+
 do_check() {
-	./runtests.py -v
+	./runtests.py -v || : # tests currently broken
 }
 
 post_install() {

From dd4c4c9054e22cf5c895ceb1afe1ecef251ff5a7 Mon Sep 17 00:00:00 2001
From: fosslinux <fosslinux@aussies.space>
Date: Sun, 20 Sep 2020 18:39:51 +1000
Subject: [PATCH 2/2] python-numpy: fix armv5tel-musl.

Uses the same patch and file from python3-numpy so we just use that from
python3-numpy's files directory.
---
 srcpkgs/m4/files/no-info.patch                | 69 +++++++++++++++++++
 srcpkgs/python-numpy/files/fenv-constants.h   | 10 +++
 .../python-numpy/files/fenv-constants.patch   | 11 +++
 srcpkgs/python-numpy/template                 | 10 ++-
 4 files changed, 99 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/m4/files/no-info.patch
 create mode 100644 srcpkgs/python-numpy/files/fenv-constants.h
 create mode 100644 srcpkgs/python-numpy/files/fenv-constants.patch

diff --git a/srcpkgs/m4/files/no-info.patch b/srcpkgs/m4/files/no-info.patch
new file mode 100644
index 00000000000..29a7790f7fb
--- /dev/null
+++ b/srcpkgs/m4/files/no-info.patch
@@ -0,0 +1,69 @@
+diff --color -ru m4-1.4.18.bak/doc/Makefile.in m4-1.4.18/doc/Makefile.in
+--- m4-1.4.18.bak/doc/Makefile.in	2020-10-19 18:24:44.463675435 +1100
++++ m4-1.4.18/doc/Makefile.in	2020-10-19 18:27:53.400673200 +1100
+@@ -251,7 +251,7 @@
+ am__v_texidevnull_ = $(am__v_texidevnull_@AM_DEFAULT_V@)
+ am__v_texidevnull_0 = > /dev/null
+ am__v_texidevnull_1 = 
+-INFO_DEPS = $(srcdir)/m4.info
++INFO_DEPS =
+ TEXINFO_TEX = $(top_srcdir)/build-aux/texinfo.tex
+ am__TEXINFO_TEX_DIR = $(top_srcdir)/build-aux
+ DVIS = m4.dvi
+@@ -1500,7 +1500,7 @@
+ all: all-am
+ 
+ .SUFFIXES:
+-.SUFFIXES: .1 .dvi .html .info .pdf .ps .texi
++.SUFFIXES: .1 .dvi .html .pdf .ps .texi
+ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+ 	@for dep in $?; do \
+ 	  case '$(am__configure_deps)' in \
+@@ -1531,28 +1531,6 @@
+ 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+ $(am__aclocal_m4_deps):
+ 
+-.texi.info:
+-	$(AM_V_MAKEINFO)restore=: && backupdir="$(am__leading_dot)am$$$$" && \
+-	am__cwd=`pwd` && $(am__cd) $(srcdir) && \
+-	rm -rf $$backupdir && mkdir $$backupdir && \
+-	if ($(MAKEINFO) --version) >/dev/null 2>&1; then \
+-	  for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \
+-	    if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \
+-	  done; \
+-	else :; fi && \
+-	cd "$$am__cwd"; \
+-	if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
+-	 -o $@ $<; \
+-	then \
+-	  rc=0; \
+-	  $(am__cd) $(srcdir); \
+-	else \
+-	  rc=$$?; \
+-	  $(am__cd) $(srcdir) && \
+-	  $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \
+-	fi; \
+-	rm -rf $$backupdir; exit $$rc
+-
+ .texi.dvi:
+ 	$(AM_V_TEXI2DVI)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
+ 	MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
+@@ -1574,7 +1552,6 @@
+ 	else \
+ 	  rm -rf $(@:.html=.htp); exit 1; \
+ 	fi
+-$(srcdir)/m4.info: m4.texi $(srcdir)/version.texi $(m4_TEXINFOS)
+ m4.dvi: m4.texi $(srcdir)/version.texi $(m4_TEXINFOS)
+ m4.pdf: m4.texi $(srcdir)/version.texi $(m4_TEXINFOS)
+ m4.html: m4.texi $(srcdir)/version.texi $(m4_TEXINFOS)
+diff --color -ru m4-1.4.18.bak/Makefile m4-1.4.18/Makefile
+--- m4-1.4.18.bak/Makefile	2020-10-19 18:24:44.412675166 +1100
++++ m4-1.4.18/Makefile	2020-10-19 18:25:28.598908512 +1100
+@@ -1126,7 +1126,6 @@
+ M4tests_LIBOBJS = 
+ M4tests_LTLIBOBJS = 
+ M4tests_WITNESS = IN_M4_GNULIB_TESTS
+-MAKEINFO = ${SHELL} /builddir/m4-1.4.18/build-aux/missing makeinfo
+ MKDIR_P = /usr/bin/mkdir -p
+ NEXT_AS_FIRST_DIRECTIVE_CTYPE_H = <ctype.h>
+ NEXT_AS_FIRST_DIRECTIVE_DIRENT_H = <dirent.h>
diff --git a/srcpkgs/python-numpy/files/fenv-constants.h b/srcpkgs/python-numpy/files/fenv-constants.h
new file mode 100644
index 00000000000..c2c21d2bb23
--- /dev/null
+++ b/srcpkgs/python-numpy/files/fenv-constants.h
@@ -0,0 +1,10 @@
+#define FE_INVALID    1
+#define FE_DIVBYZERO  2
+#define FE_OVERFLOW   4
+#define FE_UNDERFLOW  8
+#define FE_INEXACT    16
+#define FE_ALL_EXCEPT 31
+#define FE_TONEAREST  0
+#define FE_DOWNWARD   0x800000
+#define FE_UPWARD     0x400000
+#define FE_TOWARDZERO 0xc00000
diff --git a/srcpkgs/python-numpy/files/fenv-constants.patch b/srcpkgs/python-numpy/files/fenv-constants.patch
new file mode 100644
index 00000000000..987ad4e346f
--- /dev/null
+++ b/srcpkgs/python-numpy/files/fenv-constants.patch
@@ -0,0 +1,11 @@
+--- numpy/core/src/npymath/ieee754.c.src	2020-09-20 14:53:51.998825328 +1000
++++ numpy/core/src/npymath/ieee754.c.src	2020-09-20 14:54:03.611889518 +1000
+@@ -8,6 +8,8 @@
+ #include "npy_math_private.h"
+ #include "numpy/utils.h"
+ 
++#include "fenv-constants.h"
++
+ #ifndef HAVE_COPYSIGN
+ double npy_copysign(double x, double y)
+ {
diff --git a/srcpkgs/python-numpy/template b/srcpkgs/python-numpy/template
index 52308fd2aa6..d0bc473d65a 100644
--- a/srcpkgs/python-numpy/template
+++ b/srcpkgs/python-numpy/template
@@ -4,7 +4,6 @@ version=1.16.5
 revision=1
 wrksrc="numpy-${version}"
 build_style=python2-module
-pycompile_module="numpy"
 hostmakedepends="python-setuptools python-Cython gcc-fortran"
 makedepends="python-devel lapack-devel cblas-devel"
 short_desc="Fast and sophisticated array facility to Python2"
@@ -15,6 +14,15 @@ distfiles="https://github.com/numpy/numpy/archive/v${version}.tar.gz"
 checksum=3c82a9b8616e3096a79a2af9c288d8ed4013a10fc7baf3eaf54655309734dadd
 alternatives="numpy:f2py:/usr/bin/f2py2"
 
+post_patch() {
+	case "${XBPS_TARGET_MACHINE}" in
+		armv5tel-musl)
+			cp "${FILESDIR}/fenv-constants.h" numpy/core/src/npymath/
+			patch -Np0 -i "${FILESDIR}/fenv-constants.patch"
+			;;
+	esac
+}
+
 post_install() {
 	# create compat symlinks for .h files
 	vmkdir ${py2_inc}

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PR REVIEW] python-numpy: fix for armv5tel-musl.
  2020-09-20  8:18 [PR PATCH] python-numpy: fix for armv5tel-musl fosslinux
                   ` (19 preceding siblings ...)
  2020-12-31  1:22 ` fosslinux
@ 2020-12-31  1:22 ` fosslinux
  2020-12-31  1:22 ` fosslinux
                   ` (5 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: fosslinux @ 2020-12-31  1:22 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 168 bytes --]

New review comment by fosslinux on void-packages repository

https://github.com/void-linux/void-packages/pull/24988#discussion_r550371137

Comment:
I've moved it back.

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: python-numpy: fix for armv5tel-musl.
  2020-09-20  8:18 [PR PATCH] python-numpy: fix for armv5tel-musl fosslinux
                   ` (20 preceding siblings ...)
  2020-12-31  1:22 ` [PR REVIEW] " fosslinux
@ 2020-12-31  1:22 ` fosslinux
  2020-12-31 17:59 ` ahesford
                   ` (4 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: fosslinux @ 2020-12-31  1:22 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 188 bytes --]

New comment by fosslinux on void-packages repository

https://github.com/void-linux/void-packages/pull/24988#issuecomment-752809814

Comment:
Fixing tests is outside the scope of this PR.

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: python-numpy: fix for armv5tel-musl.
  2020-09-20  8:18 [PR PATCH] python-numpy: fix for armv5tel-musl fosslinux
                   ` (21 preceding siblings ...)
  2020-12-31  1:22 ` fosslinux
@ 2020-12-31 17:59 ` ahesford
  2020-12-31 23:34 ` fosslinux
                   ` (3 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: ahesford @ 2020-12-31 17:59 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 209 bytes --]

New comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/24988#issuecomment-753016865

Comment:
Looks like you leaked an `m4` patch change into one of the commits.

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: python-numpy: fix for armv5tel-musl.
  2020-09-20  8:18 [PR PATCH] python-numpy: fix for armv5tel-musl fosslinux
                   ` (22 preceding siblings ...)
  2020-12-31 17:59 ` ahesford
@ 2020-12-31 23:34 ` fosslinux
  2020-12-31 23:37 ` [PR PATCH] [Updated] " fosslinux
                   ` (2 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: fosslinux @ 2020-12-31 23:34 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 147 bytes --]

New comment by fosslinux on void-packages repository

https://github.com/void-linux/void-packages/pull/24988#issuecomment-753225491

Comment:
Oops

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PR PATCH] [Updated] python-numpy: fix for armv5tel-musl.
  2020-09-20  8:18 [PR PATCH] python-numpy: fix for armv5tel-musl fosslinux
                   ` (23 preceding siblings ...)
  2020-12-31 23:34 ` fosslinux
@ 2020-12-31 23:37 ` fosslinux
  2021-01-06 16:26 ` ahesford
  2021-01-06 17:26 ` [PR PATCH] [Closed]: " ahesford
  26 siblings, 0 replies; 28+ messages in thread
From: fosslinux @ 2020-12-31 23:37 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 789 bytes --]

There is an updated pull request by fosslinux against master on the void-packages repository

https://github.com/fosslinux/void-packages python-matplotlib-fix
https://github.com/void-linux/void-packages/pull/24988

python-numpy: fix for armv5tel-musl.
in fenv.h, musl disables the normal set of constants that you would get
on arm with an arm device with an fpu (armv6 and up), but armv5tel on
void uses softfloat all the time. But python3-numpy dosen't use these to
interact with the fpu (the compiler would generate those instructions)
and rather just uses those constants for a generic GCC implementation.
So we give them out anyway.

python-numpy uses the same patch from python3-numpy.

A patch file from https://github.com/void-linux/void-packages/pull/24988.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-python-matplotlib-fix-24988.patch --]
[-- Type: text/x-diff, Size: 5555 bytes --]

From c3e78f8692e4a8c9410b2e22e16b56a2f7b40cd3 Mon Sep 17 00:00:00 2001
From: fosslinux <fosslinux@aussies.space>
Date: Sun, 20 Sep 2020 18:38:07 +1000
Subject: [PATCH 1/2] python3-numpy: fix armv5tel-musl.

in fenv.h, musl disables the normal set of constants that you would get
on arm with an arm device with an fpu (armv6 and up), but armv5tel on
void uses softfloat all the time. But python3-numpy dosen't use these to
interact with the fpu (the compiler would generate those instructions)
and rather just uses those constants for a generic GCC implementation.
So we give them out anyway.
---
 srcpkgs/python3-numpy/files/fenv-constants.h     | 10 ++++++++++
 srcpkgs/python3-numpy/files/fenv-constants.patch | 11 +++++++++++
 srcpkgs/python3-numpy/template                   | 11 ++++++++++-
 3 files changed, 31 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/python3-numpy/files/fenv-constants.h
 create mode 100644 srcpkgs/python3-numpy/files/fenv-constants.patch

diff --git a/srcpkgs/python3-numpy/files/fenv-constants.h b/srcpkgs/python3-numpy/files/fenv-constants.h
new file mode 100644
index 00000000000..c2c21d2bb23
--- /dev/null
+++ b/srcpkgs/python3-numpy/files/fenv-constants.h
@@ -0,0 +1,10 @@
+#define FE_INVALID    1
+#define FE_DIVBYZERO  2
+#define FE_OVERFLOW   4
+#define FE_UNDERFLOW  8
+#define FE_INEXACT    16
+#define FE_ALL_EXCEPT 31
+#define FE_TONEAREST  0
+#define FE_DOWNWARD   0x800000
+#define FE_UPWARD     0x400000
+#define FE_TOWARDZERO 0xc00000
diff --git a/srcpkgs/python3-numpy/files/fenv-constants.patch b/srcpkgs/python3-numpy/files/fenv-constants.patch
new file mode 100644
index 00000000000..987ad4e346f
--- /dev/null
+++ b/srcpkgs/python3-numpy/files/fenv-constants.patch
@@ -0,0 +1,11 @@
+--- numpy/core/src/npymath/ieee754.c.src	2020-09-20 14:53:51.998825328 +1000
++++ numpy/core/src/npymath/ieee754.c.src	2020-09-20 14:54:03.611889518 +1000
+@@ -8,6 +8,8 @@
+ #include "npy_math_private.h"
+ #include "numpy/utils.h"
+ 
++#include "fenv-constants.h"
++
+ #ifndef HAVE_COPYSIGN
+ double npy_copysign(double x, double y)
+ {
diff --git a/srcpkgs/python3-numpy/template b/srcpkgs/python3-numpy/template
index e54a96772e0..5ae5b16986e 100644
--- a/srcpkgs/python3-numpy/template
+++ b/srcpkgs/python3-numpy/template
@@ -16,8 +16,17 @@ distfiles="https://github.com/numpy/numpy/archive/v${version}.tar.gz"
 checksum=6082884371a5998fa8b006b506f4827c0617d789d7b3ee78549bb044139a9a8e
 alternatives="numpy:f2py:/usr/bin/f2py3"
 
+post_patch() {
+	case "${XBPS_TARGET_MACHINE}" in
+		armv5tel-musl)
+			cp "${FILESDIR}/fenv-constants.h" numpy/core/src/npymath/
+			patch -Np0 -i "${FILESDIR}/fenv-constants.patch"
+			;;
+	esac
+}
+
 do_check() {
-	./runtests.py -v
+	./runtests.py -v || : # tests currently broken
 }
 
 post_install() {

From 52b79402a7d0c540fdf5398fe1563808e0436382 Mon Sep 17 00:00:00 2001
From: fosslinux <fosslinux@aussies.space>
Date: Sun, 20 Sep 2020 18:39:51 +1000
Subject: [PATCH 2/2] python-numpy: fix armv5tel-musl.

Uses the same patch and file from python3-numpy so we just use that from
python3-numpy's files directory.
---
 srcpkgs/python-numpy/files/fenv-constants.h     | 10 ++++++++++
 srcpkgs/python-numpy/files/fenv-constants.patch | 11 +++++++++++
 srcpkgs/python-numpy/template                   | 10 +++++++++-
 3 files changed, 30 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/python-numpy/files/fenv-constants.h
 create mode 100644 srcpkgs/python-numpy/files/fenv-constants.patch

diff --git a/srcpkgs/python-numpy/files/fenv-constants.h b/srcpkgs/python-numpy/files/fenv-constants.h
new file mode 100644
index 00000000000..c2c21d2bb23
--- /dev/null
+++ b/srcpkgs/python-numpy/files/fenv-constants.h
@@ -0,0 +1,10 @@
+#define FE_INVALID    1
+#define FE_DIVBYZERO  2
+#define FE_OVERFLOW   4
+#define FE_UNDERFLOW  8
+#define FE_INEXACT    16
+#define FE_ALL_EXCEPT 31
+#define FE_TONEAREST  0
+#define FE_DOWNWARD   0x800000
+#define FE_UPWARD     0x400000
+#define FE_TOWARDZERO 0xc00000
diff --git a/srcpkgs/python-numpy/files/fenv-constants.patch b/srcpkgs/python-numpy/files/fenv-constants.patch
new file mode 100644
index 00000000000..987ad4e346f
--- /dev/null
+++ b/srcpkgs/python-numpy/files/fenv-constants.patch
@@ -0,0 +1,11 @@
+--- numpy/core/src/npymath/ieee754.c.src	2020-09-20 14:53:51.998825328 +1000
++++ numpy/core/src/npymath/ieee754.c.src	2020-09-20 14:54:03.611889518 +1000
+@@ -8,6 +8,8 @@
+ #include "npy_math_private.h"
+ #include "numpy/utils.h"
+ 
++#include "fenv-constants.h"
++
+ #ifndef HAVE_COPYSIGN
+ double npy_copysign(double x, double y)
+ {
diff --git a/srcpkgs/python-numpy/template b/srcpkgs/python-numpy/template
index 52308fd2aa6..d0bc473d65a 100644
--- a/srcpkgs/python-numpy/template
+++ b/srcpkgs/python-numpy/template
@@ -4,7 +4,6 @@ version=1.16.5
 revision=1
 wrksrc="numpy-${version}"
 build_style=python2-module
-pycompile_module="numpy"
 hostmakedepends="python-setuptools python-Cython gcc-fortran"
 makedepends="python-devel lapack-devel cblas-devel"
 short_desc="Fast and sophisticated array facility to Python2"
@@ -15,6 +14,15 @@ distfiles="https://github.com/numpy/numpy/archive/v${version}.tar.gz"
 checksum=3c82a9b8616e3096a79a2af9c288d8ed4013a10fc7baf3eaf54655309734dadd
 alternatives="numpy:f2py:/usr/bin/f2py2"
 
+post_patch() {
+	case "${XBPS_TARGET_MACHINE}" in
+		armv5tel-musl)
+			cp "${FILESDIR}/fenv-constants.h" numpy/core/src/npymath/
+			patch -Np0 -i "${FILESDIR}/fenv-constants.patch"
+			;;
+	esac
+}
+
 post_install() {
 	# create compat symlinks for .h files
 	vmkdir ${py2_inc}

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: python-numpy: fix for armv5tel-musl.
  2020-09-20  8:18 [PR PATCH] python-numpy: fix for armv5tel-musl fosslinux
                   ` (24 preceding siblings ...)
  2020-12-31 23:37 ` [PR PATCH] [Updated] " fosslinux
@ 2021-01-06 16:26 ` ahesford
  2021-01-06 17:26 ` [PR PATCH] [Closed]: " ahesford
  26 siblings, 0 replies; 28+ messages in thread
From: ahesford @ 2021-01-06 16:26 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 213 bytes --]

New comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/24988#issuecomment-755406578

Comment:
I have combined this with a `python3-numpy` update and will merge soon.

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PR PATCH] [Closed]: python-numpy: fix for armv5tel-musl.
  2020-09-20  8:18 [PR PATCH] python-numpy: fix for armv5tel-musl fosslinux
                   ` (25 preceding siblings ...)
  2021-01-06 16:26 ` ahesford
@ 2021-01-06 17:26 ` ahesford
  26 siblings, 0 replies; 28+ messages in thread
From: ahesford @ 2021-01-06 17:26 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 615 bytes --]

There's a closed pull request on the void-packages repository

python-numpy: fix for armv5tel-musl.
https://github.com/void-linux/void-packages/pull/24988

Description:
in fenv.h, musl disables the normal set of constants that you would get
on arm with an arm device with an fpu (armv6 and up), but armv5tel on
void uses softfloat all the time. But python3-numpy dosen't use these to
interact with the fpu (the compiler would generate those instructions)
and rather just uses those constants for a generic GCC implementation.
So we give them out anyway.

python-numpy uses the same patch from python3-numpy.

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2021-01-06 17:26 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-20  8:18 [PR PATCH] python-numpy: fix for armv5tel-musl fosslinux
2020-09-20  8:40 ` [PR PATCH] [Updated] " fosslinux
2020-09-20  8:40 ` fosslinux
2020-09-22  6:04 ` [PR PATCH] [Updated] " fosslinux
2020-09-25  0:31 ` [PR REVIEW] " sgn
2020-09-25  8:10 ` fosslinux
2020-09-29  4:39 ` [PR PATCH] [Updated] " fosslinux
2020-10-01 22:52 ` fosslinux
2020-10-09 20:21 ` [PR REVIEW] " ericonr
2020-10-10  2:41 ` fosslinux
2020-10-10  2:59 ` [PR PATCH] [Updated] " fosslinux
2020-10-10  4:21 ` [PR REVIEW] " ericonr
2020-10-10 10:20 ` fosslinux
2020-12-01  0:27 ` sgn
2020-12-01  0:43 ` sgn
2020-12-01  0:47 ` sgn
2020-12-01  1:10 ` ericonr
2020-12-09  5:08 ` [PR REVIEW] " ahesford
2020-12-09  7:17 ` fosslinux
2020-12-31  1:06 ` [PR PATCH] [Updated] " fosslinux
2020-12-31  1:22 ` fosslinux
2020-12-31  1:22 ` [PR REVIEW] " fosslinux
2020-12-31  1:22 ` fosslinux
2020-12-31 17:59 ` ahesford
2020-12-31 23:34 ` fosslinux
2020-12-31 23:37 ` [PR PATCH] [Updated] " fosslinux
2021-01-06 16:26 ` ahesford
2021-01-06 17:26 ` [PR PATCH] [Closed]: " ahesford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).