summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 64fd4043c29dcc9f9222c29dbbbd161643665331 (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
64
65
66
67
68
# Maintainer: Ruben Gonzalez <rgonzalez@fluendo.com> and Carlos Falgueras <cfalgueras@fluendo.com>

pkgname=fluster
pkgver=0.0.0.9e37ae0
pkgrel=1
pkgdesc="Testing framework for decoders conformance"
arch=(any)
url="https://github.com/fluster/fluster"
license=(LGPL-3.0)
depends=(
  python
)
makedepends=(
  python-build
  python-installer
  python-wheel
  python-black
  python-pylint
  flake8
  mypy
)
checkdepends=(
  git
  python-pytest
)

source=("git+https://github.com/fluendo/fluster.git#branch=master")
sha256sums=('SKIP')

_archive="$pkgname-$pkgver"

build() {
  cd "fluster"

  export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
  python -m build --wheel --no-isolation

  rm -rf tmp_install
  _site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
  python -m installer --destdir=tmp_install dist/*.whl

  # Completions
  export PYTHONPATH="$PWD/tmp_install/$_site_packages:$PYTHONPATH"
  _fluster_cmd="$PWD/tmp_install/usr/bin/fluster"
  _FLUSTER_COMPLETE=bash_source $_fluster_cmd > fluster.bash
  _FLUSTER_COMPLETE=fish_source $_fluster_cmd > fluster.fish
  _FLUSTER_COMPLETE=zsh_source $_fluster_cmd > fluster.zsh
}

check() {
  cd "fluster"

  make check
}

package() {
  cd "fluster"

  python -m installer --destdir="$pkgdir" dist/*.whl

  find test_suites -name "*json" -exec install -Dm644 {} "$pkgdir/usr/share/$pkgname/{}" \;

  install -Dm644 fluster.bash "$pkgdir/usr/share/bash-completion/completions/fluster"
  install -Dm644 fluster.fish "$pkgdir/usr/share/fish/vendor_completions.d/fluster.fish"
  install -Dm644 fluster.zsh "$pkgdir/usr/share/zsh/site-functions/_fluster"

  install -Dm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
}