summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 74147d9e37b6a6f67fc049dc9fc95d26a50ad9b0 (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
# Maintainer: Rafael Fontenelle <rafaelff@gnome.org>

_name=pyg3t
pkgname=$_name-git
pkgver=0.5.1.r401.3939d89
pkgrel=1
pkgdesc="Python GetText Translation Toolkit"
arch=(any)
url="https://gitlab.com/pyg3t/pyg3t"
license=(GPL-3.0-or-later)
depends=(python)
makedepends=(git python-setuptools python-build python-installer python-wheel)
checkdepends=(python-pytest)
provides=($_name)
conflicts=($_name)
source=(git+${url}.git)
md5sums=('SKIP')

pkgver() {
  cd "$srcdir/$_name"
  v=$(python -c 'from pyg3t import __version__; print(__version__)')
  r="$(git rev-list --count HEAD)"
  h="$(git rev-parse --short HEAD)"
  printf "$v.r$r.$h"
}

build() {
  cd $_name
  python -m build --wheel --no-isolation
}

# Workaround for the tests requiring installed scripts (poselect, etc.)
check() {
  cd $_name
  python -m installer --destdir='tmp_dir' dist/*.whl
  export PATH="$PWD/tmp_dir/usr/bin:$PATH"
  PYTHONPATH=$PWD python -m pytest -vv
}

package() {
  cd $_name
  python -m installer --destdir="$pkgdir" dist/*.whl
}