summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaleb Maclennan2021-08-03 17:51:48 +0300
committerCaleb Maclennan2021-08-03 17:55:10 +0300
commit4f866b97cdbb8d96573ab05ac330f70d969ade66 (patch)
treed2d520586164d8feddd7e830b84e3f76dea3212e
parent9314b4aaa71633758ba83f81c09fe6c82f6e5565 (diff)
downloadaur-4f866b97cdbb8d96573ab05ac330f70d969ade66.tar.gz
Adopt and overhaul packaging
* Add missing dependencies, crosscheck with upstream * Split build() and package() steps * Disable check() function, circular dependency look with python-fontparts * Remove obsolete workaround from check() function * Prepare Python build for reproducible build verification * Fix upstream project URL * Use more stable download location for PyPi * 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--.SRCINFO8
-rw-r--r--PKGBUILD50
2 files changed, 35 insertions, 23 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 867b4b523277..f844c13ec023 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,17 +1,15 @@
pkgbase = python-fontpens
pkgdesc = A collection of classes implementing the pen protocol for manipulating glyphs.
pkgver = 0.2.4
- pkgrel = 1
- url = https://pypi.org/project/fontPens/
+ pkgrel = 2
+ url = https://github.com/robotools/$_pyname
arch = any
license = BSD
- checkdepends = python-fontmath
checkdepends = python-fontparts
checkdepends = python-pytest
makedepends = python-setuptools
depends = python-fonttools
- source = https://pypi.org/packages/source/f/fontPens/fontPens-0.2.4.zip
+ source = https://files.pythonhosted.org/packages/source/f/fontPens/fontPens-0.2.4.zip
sha256sums = a6d9a14573b3450f3313d69523f9006028c21fc7aef5d35333b87aab7f2b41fd
pkgname = python-fontpens
-
diff --git a/PKGBUILD b/PKGBUILD
index dd7614813b68..8077890353e8 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,27 +1,41 @@
+# Maintainer: Caleb Maclennan <caleb@alerque.com>
# Maintainer: Guillaume Horel <guillaume.horel@gmail.com>
-pkgname='python-fontpens'
-_pkgname='fontPens'
-pkgver='0.2.4'
-pkgrel=1
+
+# Upstream test suite has a circular dependency (it uses fontparts which in
+# turn depends on this library) and thus cannot be run by default without
+# blocking installation until first building without tests.
+BUILDENV+=(!check)
+
+_pyname=fontPens
+pkgname=python-${_pyname,,}
+pkgver=0.2.4
+pkgrel=2
pkgdesc='A collection of classes implementing the pen protocol for manipulating glyphs.'
-url='https://pypi.org/project/fontPens/'
-checkdepends=('python-fontmath' 'python-fontparts' 'python-pytest')
-depends=('python-fonttools')
-makedepends=('python-setuptools')
-optdepends=()
-license=('BSD')
-arch=('any')
-source=("https://pypi.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.zip")
+arch=(any)
+url='https://github.com/robotools/$_pyname'
+license=(BSD)
+depends=(python-fonttools)
+makedepends=(python-setuptools)
+checkdepends=(python-fontparts
+ python-pytest)
+_archive="$_pyname-$pkgver"
+source=("https://files.pythonhosted.org/packages/source/${_pyname::1}/$_pyname/$_archive.zip")
sha256sums=('a6d9a14573b3450f3313d69523f9006028c21fc7aef5d35333b87aab7f2b41fd')
-package() {
- cd "${_pkgname}-${pkgver}"
- python setup.py install --root="${pkgdir}" --optimize=1
- install -D -m644 LICENSE.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.txt"
+build() {
+ cd "$_archive"
+ export PYTHONHASHSEED=0
+ python setup.py build
}
check() {
- cd "$_pkgname-$pkgver"
- pytest -k 'not fontPens.penTools.estimateQuadraticCurveLength' Lib/
+ cd "$_archive"
+ PYTHONPATH=Lib pytest Lib
+}
+
+package() {
+ cd "$_archive"
+ python setup.py install --root="$pkgdir" --optimize=1 --skip-build
+ install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname/" LICENSE.txt
}