summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 49d2525de078b5854ded8fee277640d16a82d0b4 (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
# Maintainer: Caleb Maclennan <caleb@alerque.com>

pkgname=nanoemoji
pkgver=0.15.1
pkgrel=3
pkgdesc='A wee tool to build color fonts'
arch=(any)
url="https://github.com/googlefonts/$_pkgname"
license=(Apache-2.0)
_pydeps=(cffsubr # optdepends of ufo2ft required for [cffsubr]
         fonttools
         fs # optdepends of fonttols required for [ufo]
         lxml
         pillow
         regex
         toml
         ufo2ft
         ufolib2)
depends=(absl-py
         ninja
         picosvg
         python
         "${_pydeps[@]/#/python-}")
makedepends=(python-{build,installer,wheel}
             python-setuptools-scm)
optdepends=('resvg: Support CBDT and sbix color fonts')
checkdepends=(python-pytest
              resvg)
_archive="$pkgname-$pkgver"
source=("https://files.pythonhosted.org/packages/source/${pkgname::1}/$pkgname/$_archive.tar.gz")
sha256sums=('12d4cf7947405e92dee9f17b2bedf681dfc0ab1f22d70099d175a782e63b9420')

prepare() {
	cd "$_archive"
	sed -i -e 's/^from ninja //' src/nanoemoji/ninja.py
}

build() {
	cd "$_archive"
	python -m build -wn
}

check() {
	cd "$_archive"
	# Skip tests that assume shell access to installed executable
	local deselected=(
		tests/extract_svgs_test.py
		tests/maximum_color_test.py
		tests/nanoemoji_test.py
	)
	PYTHONPATH=build/lib pytest ${deselected[@]/#/--deselect }
}

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