summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaleb Maclennan2021-08-03 17:25:20 +0300
committerCaleb Maclennan2021-08-03 17:25:20 +0300
commit1d8ca64d76fb804e665eb258945ff141defedfee (patch)
tree61ddb47a1440b86d75b3cfe4990098afbabcb399
parentd37b8ef88f76e2fdd06cbbbfd87427e1583da470 (diff)
downloadaur-1d8ca64d76fb804e665eb258945ff141defedfee.tar.gz
Adopt and overhaul packaging
* Add missing dependencies, remove unused or obsolete ones, crosscheck with upstream * Split build() and package() steps * Remove obsolete workaround from check() function * Prepare Python build for reproducible build verification * Use more stable download location for PyPi * Prefer to use tooling (setuptools-scm) specified by upstream rather than patches that need maintaining on every release bump. * Cleanup coding style (largely to my preferences, but also making sure bash quoting is valid and matches shellharden output) * Place fields in Wiki recommended order, sort dependencies
-rw-r--r--.SRCINFO11
-rw-r--r--PKGBUILD50
2 files changed, 38 insertions, 23 deletions
diff --git a/.SRCINFO b/.SRCINFO
index bcc616c5d75b..08b50d6cbe80 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,20 +1,21 @@
pkgbase = python-fontparts
pkgdesc = The replacement for RoboFab
pkgver = 0.9.10
- pkgrel = 1
+ pkgrel = 2
url = https://github.com/robotools/fontParts
arch = any
license = MIT
- checkdepends = python-fontpens
- makedepends = python-setuptools
+ makedepends = python-setuptools-scm
depends = python
depends = python-booleanoperations
depends = python-defcon
depends = python-fontmath
+ depends = python-fontpens
depends = python-fonttools
depends = python-fs
- source = https://pypi.org/packages/source/f/fontParts/fontParts-0.9.10.zip
+ depends = python-lxml
+ depends = python-unicodedata2
+ source = https://files.pythonhosted.org/packages/source/f/fontParts/fontParts-0.9.10.zip
sha256sums = 4898942385e0ea28a721fd8de3232f5db7b6c528840754fa8b703a3617b69243
pkgname = python-fontparts
-
diff --git a/PKGBUILD b/PKGBUILD
index d153e2d7d333..d5282c458884 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,28 +1,42 @@
+# Maintainer: Caleb Maclennan <caleb@alerque.com>
# Maintainer: Guillaume Horel <guillaume.horel@gmail.com>
-pkgname='python-fontparts'
-_pkgname='fontParts'
+
+_pyname=fontParts
+pkgname=python-${_pyname,,}
pkgver=0.9.10
-pkgrel=1
+pkgrel=2
pkgdesc='The replacement for RoboFab'
-url='https://github.com/robotools/fontParts'
-checkdepends=('python-fontpens')
-depends=('python' 'python-booleanoperations' 'python-defcon' 'python-fontmath' 'python-fonttools' 'python-fs')
-makedepends=('python-setuptools')
-optdepends=()
-license=('MIT')
-arch=('any')
-source=("https://pypi.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.zip")
+arch=(any)
+url="https://github.com/robotools/${_pyname}"
+license=(MIT)
+_pydeps=(booleanoperations
+ defcon
+ fontmath
+ fontpens # for defcon[pens]
+ fonttools
+ fs # for fonttools[ufo]
+ lxml # for fonttools[lxml]
+ unicodedata2) # for fonttools[unicode]
+depends=(python
+ "${_pydeps[@]/#/python-}")
+makedepends=(python-setuptools-scm)
+_archive="$_pyname-$pkgver"
+source=("https://files.pythonhosted.org/packages/source/${_pyname::1}/$_pyname/$_archive.zip")
sha256sums=('4898942385e0ea28a721fd8de3232f5db7b6c528840754fa8b703a3617b69243')
-package() {
- cd "${srcdir}/${_pkgname}-${pkgver}"
- python setup.py install --root="${pkgdir}" --optimize=1
- install -D -m644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+build() {
+ cd "$_archive"
+ export PYTHONHASHSEED=0
+ python setup.py build
}
check() {
- cd "$srcdir/$_pkgname-$pkgver/Lib"
- sed -e 's/unittest2 as //' -i fontParts/test/test_deprecated.py
- PYTHONPATH=. python fontParts/fontshell/test.py
+ cd "$_archive/Lib"
+ PYTHONPATH=. python "$_pyname/fontshell/test.py"
}
+package() {
+ cd "$_archive"
+ python setup.py install --root="$pkgdir" --optimize=1 --skip-build
+ install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname/" LICENSE
+}