summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 59f3c05d7ee54e3a6a7fb5f18101e5d9352531d8 (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
# Maintainer: Patrick Armengol <patrickarmengol AT protonmail DOT com>

_name=xkcdrandom
pkgname=python-xkcdrandom-git
pkgver=0.0.2.r0.gc038281
pkgrel=1
pkgdesc="A random number generator made in accordance with https://xkcd.com/221/"
arch=('any')
url="https://github.com/patrickarmengol/xkcdrandom"
license=('MIT')
groups=()
depends=('python>=3.7')
makedepends=('git' 'python-build' 'python-installer' 'python-hatchling' 'python-wheel')
checkdepends=('python-pytest')
optdepends=()
provides=()
conflicts=()
replaces=()
backup=()
options=()
install=
changelog=
source=("$_name::git+$url.git")
noextract=()
sha256sums=('SKIP')  # use updpkgsums to update

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

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

check() {
  cd "$_name"
  PYTHONPATH="$PWD/src" pytest
}

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