[arch-commits] Commit in (4 files)

Konstantin Gizdov kgizdov at gemini.archlinux.org
Sun Apr 3 23:09:11 UTC 2022


    Date: Sunday, April 3, 2022 @ 23:09:11
  Author: kgizdov
Revision: 1181123

initial release

Added:
  python-cuda/
  python-cuda/repos/
  python-cuda/trunk/
  python-cuda/trunk/PKGBUILD

----------+
 PKGBUILD |   49 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

Added: python-cuda/trunk/PKGBUILD
===================================================================
--- python-cuda/trunk/PKGBUILD	                        (rev 0)
+++ python-cuda/trunk/PKGBUILD	2022-04-03 23:09:11 UTC (rev 1181123)
@@ -0,0 +1,49 @@
+# Maintainer: Konstantin Gizdov <arch at kge dot pw>
+
+_pkgname=cuda
+pkgbase="python-${_pkgname}"
+pkgname=("python-${_pkgname}" "python-${_pkgname}-docs")
+pkgver=11.6.1
+pkgrel=1
+pkgdesc="Python interface for CUDA provided by NVIDIA."
+arch=('x86_64')
+url="https://nvidia.github.io/cuda-python"
+license=('custom')
+depends=('cuda' 'cython' 'NVIDIA-MODULE')
+makedepends=('git' 'python-wheel' 'python-build' 'python-installer' 'python-setuptools-scm')
+checkdepends=('python-pytest' 'python-pytest-benchmark' 'python-numpy' 'python-scipy')
+options=(!emptydirs)
+source=("${pkgbase}::git+https://github.com/NVIDIA/cuda-python#tag=v${pkgver}")
+sha256sums=('SKIP')
+
+get_pyver () {
+    python -c 'import sys; print(str(sys.version_info[0]) + "." + str(sys.version_info[1]))'
+}
+
+build() {
+  cd "${srcdir}/${pkgbase}"
+  # build
+  python -m build --wheel --no-isolation
+}
+
+check() {
+  cd "${srcdir}/${pkgbase}"
+  echo 'pythonpath = '"${PWD}/build/lib.linux-${CARCH}-$(get_pyver)" >> pytest.ini
+  # cannot run tests in chroot
+  # python -m pytest --import-mode=importlib
+}
+
+package_python-cuda() {
+  cd "${srcdir}/${pkgname}"
+
+  install -D -m644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
+  python -m installer --destdir="${pkgdir}" dist/*.whl
+}
+
+package_python-cuda-docs() {
+  cd "${srcdir}/${pkgbase}"
+
+  install -d -m755 "${pkgdir}/usr/share/doc/${pkgname}"
+  cp -a docs/* "${pkgdir}/usr/share/doc/${pkgname}"
+  install -Dm644 -t "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE
+}



More information about the arch-commits mailing list