summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b40960ec2080b5564659d2d826d5048cfd4a4f14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#  Maintainer: Blair Bonnett <blair dot bonnett at gmail dot com>
# Contributor: Quan Guo <guotsuan at gmail dot com>

pkgname=python-llvmlite-git
pkgver=0.45.0dev0.r497.gdee4d034
pkgrel=1
pkgdesc="A lightweight LLVM Python binding for writing JIT compilers (Git version)"
url="https://github.com/numba/llvmlite"
arch=('i686' 'x86_64')
license=('BSD-2-Clause')

depends=(
  'gcc-libs'
  'glibc'
  'python'
  'llvm-libs'
)
makedepends=(
  'cmake'
  'git'
  'llvm'
  'python-build'
  'python-installer'
  'python-setuptools'
)
optdepends=(
  'python-graphviz: visualising control-flow graphs'
)
provides=("python-llvmlite=$pkgver")
conflicts=('python-llvmlite')

source=(
  'llvmlite::git+https://github.com/numba/llvmlite.git'
)
sha256sums=(
  'SKIP'
)

pkgver() {
  cd llvmlite
  git describe --long | sed -r 's/^v//;s/([^-]*-g)/r\1/;s/-/./g'
}

build() {
  cd llvmlite
  export LLVMLITE_SHARED=1
  python -m build --no-isolation --wheel
}

check() {
  cd llvmlite
  python runtests.py
}

package() {
  cd llvmlite
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  # Remove tests from final package.
  local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
  rm -r "$pkgdir/$site_packages/llvmlite/tests"
}