summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2b1da14e1127d9c4569e7bef16ff4e27b3055494 (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
# Maintainer: taotieren <admin@taotieren.com>

pkgname=python-cffsubr-git
pkgver=0.2.9.post1.r0.g5999ae5
pkgrel=2
pkgdesc='Standalone CFF subroutinizer based on AFDKO tx'
url='https://github.com/adobe-type-tools/cffsubr'
license=('Apache')
arch=(any)
depends=(python
    python-fonttools)
makedepends=(python-setuptools-git-ls-files
    python-setuptools-scm
    python-{build,installer,wheel}
    git)
checkdepends=(python-pytest)
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
source=("$pkgname::git+$url.git")
sha256sums=('SKIP')

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

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

build() {
    cd "$pkgname"
    git submodule update --init --recursive
    python -m build -wn
}

check() {
    cd "$pkgname"
    # PYTHONPATH=src pytest tests
    local _pyver=$(python -c 'import sys; print("".join(map(str, sys.version_info[:2])))')
	export PYTHONPATH="$PWD/build/lib.linux-$CARCH-cpython-$_pyver"
	pytest tests
}

package() {
    cd "$pkgname"
    python -m installer -d "$pkgdir" dist/*.whl
}