upgpkg: wordpress 6.2.1-1
[ArchLinux/community.git] / python-pycuda / trunk / PKGBUILD
blobffd899edbb329ee429d5d1d4954722561d121bd1
1 # Maintainer:
2 # Contributor: Felix Yan <felixonmars@archlinux.org>
3 # Contributor: Stéphane Gaudreault <stephane@archlinux.org>
5 _name=pycuda
6 pkgname=python-pycuda
7 pkgver=2022.2.2
8 pkgrel=3
9 pkgdesc="Python wrapper for Nvidia CUDA"
10 arch=(x86_64)
11 url="https://documen.tician.de/pycuda/"
12 license=(
13   Apache
14   MIT
16 depends=(
17   boost-libs
18   cuda
19   gcc-libs
20   glibc
21   nvidia-utils
22   python
23   python-numpy
24   python-pytools
26 makedepends=(
27   boost
28   ctags
29   mesa
30   python-build
31   python-installer
32   python-setuptools
33   python-wheel
35 checkdepends=(
36   python-pytest
38 provides=(pycuda-headers)
39 conflicts=(pycuda-headers)
40 replaces=(pycuda-headers)
41 source=(https://files.pythonhosted.org/packages/source/${_name::1}/$_name/$_name-$pkgver.tar.gz)
42 sha512sums=('c62aafe473e44339ac2147d86b51fc9bc2429310450b6d99e78a127828cc3a42dc74f20e1bdf8261f6652aed6d07ee3a871ce371f89f33fbcc4014f551af0b96')
43 b2sums=('d60e83ac2faa183e0fa022c3d901c9d97ec2f9a59195425b9d71467c24b154d48d5735223220b41aa58b0898800d382d9ead54166d0a59db9c2a777e03e574be')
45 prepare() {
46   local lib_arch=''
47   [[ "$CARCH" = "x86_64" ]] && lib_arch='64'
49   # create local siteconf.py for build system
50   # defaults can be compared from running the ./configure.py script
51   {
52     printf "BOOST_PYTHON_LIBNAME = ['boost_python3']\n"
53     printf "CUDA_ROOT = '/opt/cuda'\n"
54     printf "USE_SHIPPED_BOOST = False\n"
55   } > $_name-$pkgver/siteconf.py
57   # we ship python-numpy
58   sed -e 's/oldest-supported-numpy/numpy/' -i $_name-$pkgver/pyproject.toml
61 build() {
62   cd $_name-$pkgver
63   python -m build --wheel --no-isolation
66 # requires an Nvidia graphics card to run
67 # check() {
68 #   local pytest_options=(
69 #     -vv
70 #     --ignore examples/from-wiki/simple_speed_test.py
71 #   )
72 #   local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
74 #   cd $_name-$pkgver
75 #   # install to temporary location, as importlib is used
76 #   python -m installer --destdir=test_dir dist/*.whl
77 #   export PYTHONPATH="test_dir/$site_packages:$PYTHONPATH"
78 #   pytest "${pytest_options[@]}"
79 # }
81 package() {
82   cd $_name-$pkgver
83   python -m installer --destdir="$pkgdir" dist/*.whl
84   install -vDm 644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/