1 |
commit: 3d57bc5a46510156ca1d1042f4b2dea0be79416e |
2 |
Author: Marek Szuba <marecki <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Feb 1 23:06:26 2023 +0000 |
4 |
Commit: Marek Szuba <marecki <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Feb 1 23:08:18 2023 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3d57bc5a |
7 |
|
8 |
dev-python/pyopencl: add 2022.3.1 |
9 |
|
10 |
Signed-off-by: Marek Szuba <marecki <AT> gentoo.org> |
11 |
|
12 |
dev-python/pyopencl/Manifest | 1 + |
13 |
dev-python/pyopencl/pyopencl-2022.3.1.ebuild | 70 ++++++++++++++++++++++++++++ |
14 |
2 files changed, 71 insertions(+) |
15 |
|
16 |
diff --git a/dev-python/pyopencl/Manifest b/dev-python/pyopencl/Manifest |
17 |
index 29e14c0bab22..8c6ff082a610 100644 |
18 |
--- a/dev-python/pyopencl/Manifest |
19 |
+++ b/dev-python/pyopencl/Manifest |
20 |
@@ -1 +1,2 @@ |
21 |
DIST pyopencl-2022.2.4.tar.gz 468743 BLAKE2B 52c0d1bfc1f01eef853efb334434eba81adfaa57d98592663145b3124110765f2afa936331e36b534abadf8d87a5c606ab32ab4452e0b8e87f1ee41c1ef2548c SHA512 b1996dec89a6921216d624e5e38407dd7ada77f137e9c245f9c2dd634dd33d208ffdad57f84739e7942c64643c37ea2d044277fed85eefb362bbc331f4be3ab0 |
22 |
+DIST pyopencl-2022.3.1.tar.gz 470441 BLAKE2B 86ec602f3d73a64e34fe77b7985e64db332a685b33231ad7832d7e864f3170e3eee0aed42742b9892f7950a0f672a736e169ccd0ca08a124b7f20738b348dbff SHA512 57944de69bb24f0f22fb2c0165cd4de5265f5329246fead8449d26e6cbe1204fd44ced70df9960aa54e7d285abe81d8f8a802ba62309de5f4865e882177025ae |
23 |
|
24 |
diff --git a/dev-python/pyopencl/pyopencl-2022.3.1.ebuild b/dev-python/pyopencl/pyopencl-2022.3.1.ebuild |
25 |
new file mode 100644 |
26 |
index 000000000000..ca30dc274779 |
27 |
--- /dev/null |
28 |
+++ b/dev-python/pyopencl/pyopencl-2022.3.1.ebuild |
29 |
@@ -0,0 +1,70 @@ |
30 |
+# Copyright 1999-2023 Gentoo Authors |
31 |
+# Distributed under the terms of the GNU General Public License v2 |
32 |
+ |
33 |
+EAPI=8 |
34 |
+ |
35 |
+PYTHON_COMPAT=( python3_{9..11} ) |
36 |
+DISTUTILS_USE_PEP517=setuptools |
37 |
+ |
38 |
+inherit distutils-r1 multiprocessing |
39 |
+ |
40 |
+DESCRIPTION="Python wrapper for OpenCL" |
41 |
+HOMEPAGE="https://mathema.tician.de/software/pyopencl/ |
42 |
+ https://pypi.org/project/pyopencl/" |
43 |
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz" |
44 |
+ |
45 |
+LICENSE="GPL-2" |
46 |
+SLOT="0" |
47 |
+KEYWORDS="~amd64 ~ppc64" |
48 |
+IUSE="examples opengl" |
49 |
+ |
50 |
+# Running tests on GPUs requires both appropriate hardware and additional permissions |
51 |
+# having been granted to the user running them. Testing on CPUs with dev-libs/pocl |
52 |
+# is in theory possible but has been found to be very fragile, see e.g. Bug #872308. |
53 |
+RESTRICT="test" |
54 |
+ |
55 |
+COMMON=">=virtual/opencl-2" |
56 |
+# libglvnd is only needed for the headers |
57 |
+DEPEND="${COMMON} |
58 |
+ opengl? ( media-libs/libglvnd )" |
59 |
+RDEPEND="${COMMON} |
60 |
+ >=dev-python/mako-0.3.6[${PYTHON_USEDEP}] |
61 |
+ dev-python/numpy[${PYTHON_USEDEP}] |
62 |
+ >=dev-python/platformdirs-2.2.0[${PYTHON_USEDEP}] |
63 |
+ >=dev-python/pytools-2021.2.7[${PYTHON_USEDEP}]" |
64 |
+BDEPEND="dev-python/numpy[${PYTHON_USEDEP}] |
65 |
+ >=dev-python/pybind11-2.5.0[${PYTHON_USEDEP}] |
66 |
+ test? ( dev-libs/pocl )" |
67 |
+ |
68 |
+distutils_enable_tests pytest |
69 |
+ |
70 |
+python_configure_all() { |
71 |
+ local myconf=() |
72 |
+ if use opengl; then |
73 |
+ myconf+=(--cl-enable-gl) |
74 |
+ fi |
75 |
+ |
76 |
+ "${EPYTHON}" configure.py \ |
77 |
+ "${myconf[@]}" |
78 |
+} |
79 |
+ |
80 |
+python_test() { |
81 |
+ # Use dev-libs/pocl for testing; ignore any other OpenCL devices that might be present |
82 |
+ local -x PYOPENCL_TEST="portable:pthread" |
83 |
+ # Set the number of threads to match MAKEOPTS |
84 |
+ local -x POCL_MAX_PTHREAD_COUNT=$(makeopts_jobs) |
85 |
+ # Change to the 'test' directory so that python does not try to import pyopencl from the source directory |
86 |
+ # (Importing from the source directory fails, because the compiled '_cl' module is only in the build directory) |
87 |
+ pushd test >/dev/null || die |
88 |
+ epytest |
89 |
+ popd >/dev/null || die |
90 |
+} |
91 |
+ |
92 |
+python_install_all() { |
93 |
+ if use examples; then |
94 |
+ dodoc -r examples |
95 |
+ docompress -x /usr/share/doc/${PF}/examples |
96 |
+ fi |
97 |
+ |
98 |
+ distutils-r1_python_install_all |
99 |
+} |