summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 7e552ac175dbb46baaa24929865418451cf42e85 (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: Jeremy Cantrell <jmcantrell at gmail dot com>

pkgname=swaystatus-git
pkgver=0.5.0.r2.2268aec
pkgrel=1
pkgdesc="Generate a status line for swaybar"
arch=('any')
url="https://git.sr.ht/~jmcantrell/${pkgname%-git}"
license=('MIT')
depends=('python' 'python-toml')
optdepends=('python-systemd: systemd journal logging')
makedepends=('git' 'python-build' 'python-installer' 'python-wheel' 'python-hatchling')
checkdepends=('python-pytest' 'python-pytest-cov')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
source=("git+$url")
md5sums=('SKIP')

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

check() {
    cd "$srcdir/${pkgname%-git}" || return
    PYTHONPATH=$PWD/src pytest --no-cov
}

prepare() {
    git -C "$srcdir/${pkgname%-git}" clean -dfx
}

build() {
    cd "$srcdir/${pkgname%-git}" || return
    python -m build --wheel --no-isolation
}

package() {
    cd "$srcdir/${pkgname%-git}" || return
    python -m installer --compile-bytecode=1 --destdir="$pkgdir" dist/*.whl
}