pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/math/py-numpy py-numpy: fix build on macOS and maybe o...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/0e8a0243ea78
branches:  trunk
changeset: 379950:0e8a0243ea78
user:      tnn <tnn%pkgsrc.org@localhost>
date:      Wed May 25 19:09:25 2022 +0000

description:
py-numpy: fix build on macOS and maybe others

diffstat:

 math/py-numpy/Makefile                                             |   5 ++-
 math/py-numpy/distinfo                                             |   5 +-
 math/py-numpy/patches/patch-numpy_core_include_numpy_npy__common.h |  17 ++++++++
 math/py-numpy/patches/patch-numpy_core_setup.py                    |  19 +++++++--
 4 files changed, 39 insertions(+), 7 deletions(-)

diffs (93 lines):

diff -r f21e814cb885 -r 0e8a0243ea78 math/py-numpy/Makefile
--- a/math/py-numpy/Makefile    Wed May 25 17:18:13 2022 +0000
+++ b/math/py-numpy/Makefile    Wed May 25 19:09:25 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.94 2022/05/23 17:28:41 ryoon Exp $
+# $NetBSD: Makefile,v 1.95 2022/05/25 19:09:25 tnn Exp $
 
 DISTNAME=      numpy-1.22.4
 PKGNAME=       ${PYPKGPREFIX}-${DISTNAME}
@@ -53,6 +53,9 @@
 # Work around it on DragonFly by specifying the classic gnu linker
 MAKE_ENV.DragonFly+=   LDVER=ld.bfd
 
+pre-install:
+       ${RM} -f ${WRKSRC}/numpy/core/include/numpy/npy_common.h.orig
+
 post-install:
        cd ${DESTDIR}${PREFIX}/bin && ${RM} f2py || ${TRUE}
        cd ${DESTDIR}${PREFIX}/bin && ${RM} f2py3 || ${TRUE}
diff -r f21e814cb885 -r 0e8a0243ea78 math/py-numpy/distinfo
--- a/math/py-numpy/distinfo    Wed May 25 17:18:13 2022 +0000
+++ b/math/py-numpy/distinfo    Wed May 25 19:09:25 2022 +0000
@@ -1,9 +1,10 @@
-$NetBSD: distinfo,v 1.73 2022/05/23 17:28:41 ryoon Exp $
+$NetBSD: distinfo,v 1.74 2022/05/25 19:09:25 tnn Exp $
 
 BLAKE2s (numpy-1.22.4.zip) = 020700e15b661d064377106b6c3ecd5959c524e32cc2f3d1b97739894bbbcff8
 SHA512 (numpy-1.22.4.zip) = bb2993459157c43f8c419de98be1c832f108b4eb6b96e1d20f406eccd782681ad8d0f8653637962ac592abe7d75719c17678ec97f035f6c87d4c7f939a1a8a48
 Size (numpy-1.22.4.zip) = 11458830 bytes
-SHA1 (patch-numpy_core_setup.py) = 9f5d5934112d533f44207c2106db75465170d605
+SHA1 (patch-numpy_core_include_numpy_npy__common.h) = 2560358bbef62b72281f95b8d62b90b6c032f9c5
+SHA1 (patch-numpy_core_setup.py) = 01f90b7eb700cfa51edded31498c2de4c3850848
 SHA1 (patch-numpy_core_src_npymath_npy__math__private.h) = e3b8e751fd0b6b6c6794d714aa5f60dfe9d7f421
 SHA1 (patch-numpy_distutils_command_config.py) = eb37d28482689703e0c1a264f9768409cf8bb4b6
 SHA1 (patch-numpy_distutils_fcompiler_____init____.py) = 49d070da5b48bd9818b37ac3254341fa68503c53
diff -r f21e814cb885 -r 0e8a0243ea78 math/py-numpy/patches/patch-numpy_core_include_numpy_npy__common.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/math/py-numpy/patches/patch-numpy_core_include_numpy_npy__common.h        Wed May 25 19:09:25 2022 +0000
@@ -0,0 +1,17 @@
+$NetBSD: patch-numpy_core_include_numpy_npy__common.h,v 1.1 2022/05/25 19:09:25 tnn Exp $
+
+Fix build on non-x86:
+The configure test for __builtin_prefetch is broken with clang.
+_configtest.c:6:3: error: builtin functions must be directly called
+
+--- numpy/core/include/numpy/npy_common.h.orig 2022-05-20 05:46:10.000000000 +0000
++++ numpy/core/include/numpy/npy_common.h
+@@ -116,7 +116,7 @@
+ #define NPY_UNLIKELY(x) (x)
+ #endif
+ 
+-#ifdef HAVE___BUILTIN_PREFETCH
++#if !defined(__i386__) && !defined(__x86_64__)
+ /* unlike _mm_prefetch also works on non-x86 */
+ #define NPY_PREFETCH(x, rw, loc) __builtin_prefetch((x), (rw), (loc))
+ #else
diff -r f21e814cb885 -r 0e8a0243ea78 math/py-numpy/patches/patch-numpy_core_setup.py
--- a/math/py-numpy/patches/patch-numpy_core_setup.py   Wed May 25 17:18:13 2022 +0000
+++ b/math/py-numpy/patches/patch-numpy_core_setup.py   Wed May 25 19:09:25 2022 +0000
@@ -1,10 +1,21 @@
-$NetBSD: patch-numpy_core_setup.py,v 1.8 2022/05/23 17:28:41 ryoon Exp $
+$NetBSD: patch-numpy_core_setup.py,v 1.9 2022/05/25 19:09:25 tnn Exp $
 
 Use C language (not F77 from blas_info); fixes library name on Darwin.
+Add configure test for HAVE_XLOCALE_H, used by numpyos.c.
 
---- numpy/core/setup.py.orig   2022-05-19 22:46:10.000000000 +0000
+--- numpy/core/setup.py.orig   2022-05-20 05:46:10.000000000 +0000
 +++ numpy/core/setup.py
-@@ -217,7 +217,7 @@ def check_math_capabilities(config, ext,
+@@ -208,6 +208,9 @@ def check_math_capabilities(config, ext,
+         # It didn't work with xlocale.h, maybe it will work with locale.h?
+         locale_headers[1] = "locale.h"
+         check_funcs(OPTIONAL_LOCALE_FUNCS, headers=locale_headers)
++    st = config.check_header('xlocale.h')
++    if st:
++        moredefs.append(('HAVE_XLOCALE_H', 1))
+ 
+     for tup in OPTIONAL_INTRINSICS:
+         headers = None
+@@ -217,7 +220,7 @@ def check_math_capabilities(config, ext,
              f, args, headers, m = tup[0], tup[1], [tup[2]], fname2def(tup[0])
          else:
              f, args, headers, m = tup[0], tup[1], [tup[2]], fname2def(tup[3])
@@ -13,7 +24,7 @@
                               headers=headers):
              moredefs.append((m, 1))
  
-@@ -868,6 +868,7 @@ def configuration(parent_package='',top_
+@@ -868,6 +871,7 @@ def configuration(parent_package='',top_
  
      if have_blas:
          extra_info = blas_info



Home | Main Index | Thread Index | Old Index