summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 9bc5ac1064f57c10cb6c89a89169fd5d7f0e2247 (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
# Maintainer: Blair Bonnett <blair.bonnett@gmail.com>

pkgname=python-lazrs
pkgdesc="Python bindings for laz-rs (LAZ compression)"
pkgver=0.5.0
pkgrel=1
url='https://github.com/laz-rs/laz-rs-python'
arch=('x86_64')
license=('MIT')

depends=('gcc-libs' 'glibc' 'python')
makedepends=('maturin' 'python-installer')

_pypi=lazrs
source=(
  "https://files.pythonhosted.org/packages/source/${_pypi::1}/$_pypi/$_pypi-$pkgver.tar.gz"
)
sha256sums=(
  '793359e94eb436b34877b4305570774f9b1bba34c4671238512b80b60456d9ce'
)

build() {
  cd "$_pypi-$pkgver"
  maturin build --release --locked --strip \
                --interpreter /usr/bin/python \
                --target "$CARCH-unknown-linux-gnu"
}

check() {
  cd "$_pypi-$pkgver"
  local _site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
  python -m installer --destdir=test_dir "target/wheels/$_pypi-$pkgver-"*.whl
  export PYTHONPATH="test_dir/$_site_packages:$PYTHONPATH"
  python -c 'import lazrs'
}

package() {
  cd "$_pypi-$pkgver"
  python -m installer --destdir="$pkgdir" "target/wheels/$_pypi-$pkgver-"*.whl
  install -Dm644 LICENSE.txt -t "$pkgdir/usr/share/licenses/$pkgname/"
}