From 359dc0486e7111d9eceb5ce943938e485f6ed021 Mon Sep 17 00:00:00 2001 From: "Andrew J. Hesford" Date: Sat, 23 Sep 2023 21:03:09 -0400 Subject: [PATCH] python3-pyopencl: rebuild for Python 3.12 --- .../python3-pyopencl/patches/aksetup.00.patch | 43 +++++++++++++++++++ .../python3-pyopencl/patches/aksetup.01.patch | 29 +++++++++++++ srcpkgs/python3-pyopencl/template | 2 +- 3 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/python3-pyopencl/patches/aksetup.00.patch create mode 100644 srcpkgs/python3-pyopencl/patches/aksetup.01.patch diff --git a/srcpkgs/python3-pyopencl/patches/aksetup.00.patch b/srcpkgs/python3-pyopencl/patches/aksetup.00.patch new file mode 100644 index 00000000000..7a5e4e8fc31 --- /dev/null +++ b/srcpkgs/python3-pyopencl/patches/aksetup.00.patch @@ -0,0 +1,43 @@ +From b5059d4a73f982db90f136fda0073dcdc83f3fd2 Mon Sep 17 00:00:00 2001 +From: Andreas Kloeckner +Date: Mon, 28 Aug 2023 12:03:49 -0500 +Subject: [PATCH] Update to latest aksetup + +Includes changes equivalent to https://github.com/inducer/pycuda/pull/423 + +Co-authored-by: Antoine Martin +--- + aksetup_helper.py | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + +diff --git a/aksetup_helper.py b/aksetup_helper.py +index 89e66da38..1acc8f6d5 100644 +--- a/aksetup_helper.py ++++ b/aksetup_helper.py +@@ -43,10 +43,13 @@ def setup(*args, **kwargs): + + + def get_numpy_incpath(): +- from imp import find_module +- # avoid actually importing numpy, it screws up distutils +- file, pathname, descr = find_module("numpy") +- from os.path import join ++ from os.path import join, basename ++ from importlib.util import find_spec ++ origin = find_spec("numpy").origin ++ if origin is None: ++ raise RuntimeError("origin of numpy package not found") ++ ++ pathname = basename(origin) + return join(pathname, "core", "include") + + +@@ -937,7 +940,7 @@ def has_flag(compiler, flagname): + def cpp_flag(compiler): + """Return the -std=c++[11/14] compiler flag. + +- The c++14 is preferred over c++11 (when it is available). ++ C++14 is preferred over C++11 (when it is available). + """ + if has_flag(compiler, "-std=gnu++14"): + return "-std=gnu++14" diff --git a/srcpkgs/python3-pyopencl/patches/aksetup.01.patch b/srcpkgs/python3-pyopencl/patches/aksetup.01.patch new file mode 100644 index 00000000000..7c77b5f453a --- /dev/null +++ b/srcpkgs/python3-pyopencl/patches/aksetup.01.patch @@ -0,0 +1,29 @@ +From ad6a14a2f28c3d54755f3a1a17069089ad896666 Mon Sep 17 00:00:00 2001 +From: Andreas Kloeckner +Date: Mon, 28 Aug 2023 12:51:04 -0500 +Subject: [PATCH] Fix numpy finding in aksetup + +--- + aksetup_helper.py | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/aksetup_helper.py b/aksetup_helper.py +index d36a2d70..8c9bcec5 100644 +--- a/aksetup_helper.py ++++ b/aksetup_helper.py +@@ -43,13 +43,13 @@ + + + def get_numpy_incpath(): +- from os.path import join, basename ++ from os.path import join, dirname + from importlib.util import find_spec + origin = find_spec("numpy").origin + if origin is None: + raise RuntimeError("origin of numpy package not found") + +- pathname = basename(origin) ++ pathname = dirname(origin) + return join(pathname, "core", "include") + + diff --git a/srcpkgs/python3-pyopencl/template b/srcpkgs/python3-pyopencl/template index 1f4efca3e39..0611430e40a 100644 --- a/srcpkgs/python3-pyopencl/template +++ b/srcpkgs/python3-pyopencl/template @@ -1,7 +1,7 @@ # Template file for 'python3-pyopencl' pkgname=python3-pyopencl version=2023.1.2 -revision=1 +revision=2 build_style=python3-module hostmakedepends="python3-setuptools python3-pybind11 python3-Cython python3-numpy" makedepends="OpenCL-Headers ocl-icd-devel python3-pybind11"