summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaleb Maclennan2021-08-03 21:26:39 +0300
committerCaleb Maclennan2021-08-03 21:26:39 +0300
commit9b8a3f4ac8485fbde6e9dcbdf7ea4edfacfd522a (patch)
tree2c7b6d3825fd617ac5a03979dcd724ac61eadf5a
parentc88317366cfc971f7961b49156f8cb380bbdbfc5 (diff)
downloadaur-9b8a3f4ac8485fbde6e9dcbdf7ea4edfacfd522a.tar.gz
Adopt and overhaul packaging
* Add missing dependencies, crosscheck with upstream * Split build() and package() steps * 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--.SRCINFO17
-rw-r--r--PKGBUILD58
2 files changed, 52 insertions, 23 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 443ece9ce21c..9b5ddbf5f202 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,21 +1,24 @@
pkgbase = python-glyphslib
pkgdesc = A bridge from Glyphs source files (.glyphs) to UFOs
pkgver = 5.3.2
- pkgrel = 1
+ pkgrel = 2
url = https://github.com/googlefonts/glyphsLib
arch = any
license = Apache
- checkdepends = python>=3.8
+ checkdepends = python-defcon
+ checkdepends = python-lxml
checkdepends = python-pytest
- checkdepends = python-ufolib2
checkdepends = python-ufonormalizer
checkdepends = python-xmldiff
- makedepends = python-setuptools
- depends = python-defcon
+ makedepends = python-setuptools-scm
+ depends = python
depends = python-fonttools
+ depends = python-fs
+ depends = python-ufolib2
+ depends = python-unicodedata2
+ optdepends = python-defcon
optdepends = python-ufonormalizer
- source = https://pypi.org/packages/source/g/glyphsLib/glyphsLib-5.3.2.zip
+ source = https://files.pythonhosted.org/packages/source/g/glyphsLib/glyphsLib-5.3.2.zip
sha256sums = f0a4247c23c96c5d40a14970f651b402b8e23e517cf1a974bb8682e02d5cd3f9
pkgname = python-glyphslib
-
diff --git a/PKGBUILD b/PKGBUILD
index b70ac72a000a..77f4b4c51458 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,25 +1,51 @@
+# Maintainer: Caleb Maclennan <caleb@alerque.com>
# Maintainer: Guillaume Horel <guillaume.horel@gmail.com>
-pkgname=python-glyphslib
-_pkgname=glyphsLib
+
+_pyname=glyphsLib
+pkgname=python-${_pyname,,}
pkgver=5.3.2
-pkgrel=1
-pkgdesc="A bridge from Glyphs source files (.glyphs) to UFOs"
-url="https://github.com/googlefonts/glyphsLib"
-checkdepends=('python>=3.8' 'python-pytest' 'python-ufolib2' 'python-ufonormalizer' 'python-xmldiff')
-depends=('python-defcon' 'python-fonttools')
-makedepends=('python-setuptools')
-optdepends=('python-ufonormalizer')
-license=('Apache')
-arch=('any')
-source=("https://pypi.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.zip")
+pkgrel=2
+pkgdesc='A bridge from Glyphs source files (.glyphs) to UFOs'
+arch=(any)
+url="https://github.com/googlefonts/$_pyname"
+license=(Apache)
+_pydeps=(fonttools
+ fs # for fonttools[ufo]
+ ufolib2
+ unicodedata2) # for fonttools[unicode]
+depends=(python
+ "${_pydeps[@]/#/python-}")
+makedepends=(python-setuptools-scm)
+_pycheckdeps=(defcon
+ lxml # for fonttools[lxml]
+ pytest
+ ufonormalizer
+ xmldiff)
+checkdepends=("${_pycheckdeps[@]/#/python-}")
+optdepends=(python-defcon
+ python-ufonormalizer)
+_archive="$_pyname-$pkgver"
+source=("https://files.pythonhosted.org/packages/source/${_pyname::1}/$_pyname/$_archive.zip")
sha256sums=('f0a4247c23c96c5d40a14970f651b402b8e23e517cf1a974bb8682e02d5cd3f9')
+prepare() {
+ cd "$_archive"
+ # Upstream Issue: https://github.com/googlefonts/glyphsLib/issues/701
+ sed -i -e '/wheel$/d' setup.cfg
+}
+
+build() {
+ cd "$_archive"
+ export PYTHONHASHSEED=0
+ python setup.py build
+}
+
check() {
- cd "$srcdir/$_pkgname-$pkgver"
- PYTHONPATH=Lib pytest
+ cd "$_archive"
+ PYTHONPATH=Lib pytest tests
}
package() {
- cd "${srcdir}/${_pkgname}-${pkgver}"
- python setup.py install --root="${pkgdir}" --optimize=1
+ cd "$_archive"
+ python setup.py install --root="$pkgdir" --optimize=1 --skip-build
}