summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaleb Maclennan2021-06-09 23:44:36 +0300
committerCaleb Maclennan2021-06-09 23:51:27 +0300
commitdcba11e761b08bd58813fee4bf30359c555dd71e (patch)
treef41a162d8f70cc04152cdde287b1d5de51dcb042
parent6b1db11346696889b9b2ac2ee430677a19e96a41 (diff)
downloadaur-dcba11e761b08bd58813fee4bf30359c555dd71e.tar.gz
Overhaul packaging per Python guidelines
* Drop bogus pip dependency, add the thing it was trying to use pip to fetch directly instead * Add missing setuptools dependency * Drop transient dependencies, use official upstream install_requires list as a guide for actual dependencies, confirm by chroot build * Drop unused string manipulations (that could be done easier with bash expansions anyway) * Use Arch recommended downloads for Python packages, official sdist instead of Git archive * Split build() from package() steps * Cleanup scripting
-rw-r--r--.SRCINFO28
-rw-r--r--PKGBUILD34
2 files changed, 30 insertions, 32 deletions
diff --git a/.SRCINFO b/.SRCINFO
index e3bb0544387..86bc2e32376 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,27 +1,23 @@
pkgbase = python-weasyprint
- pkgdesc = Converts web documents (HTML, CSS, SVG, ...) to PDF.
+ pkgdesc = Convert web documents (HTML, CSS, SVG, ...) to PDF
pkgver = 52.5
- pkgrel = 2
- url = http://weasyprint.org/
+ pkgrel = 3
+ url = http://weasyprint.org
arch = any
license = BSD
- makedepends = python
- makedepends = python-distribute
- makedepends = python-pip
+ makedepends = python-setuptools
depends = python
- depends = pango>=1.29.3
- depends = gdk-pixbuf2>=2.25
- depends = cairo>=1.15.4
depends = python-cairo
+ depends = python-cairocffi
depends = python-cairosvg
- depends = python-tinycss2
- depends = python-cssselect2>=0.1
- depends = python-html5lib
depends = python-cffi
- depends = python-cairocffi
+ depends = python-cssselect2
+ depends = python-html5lib
+ depends = python-pillow
depends = python-pyphen
- depends = python-xcffib
- source = https://github.com/Kozea/WeasyPrint/archive/v52.5.tar.gz
- md5sums = dae9e7b3d0d48312669050593d504e12
+ depends = python-pytest-runner
+ depends = python-tinycss2
+ source = https://files.pythonhosted.org/packages/source/W/WeasyPrint/WeasyPrint-52.5.tar.gz
+ sha256sums = b37ea02d75ca04babd7becad7341426be332ae560d8f02d664bfa1e9afb18481
pkgname = python-weasyprint
diff --git a/PKGBUILD b/PKGBUILD
index b684dcae125..117b2cfffe0 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,24 +1,26 @@
# Maintainer: Florijan Hamzic <florijanh at gmail dot com>
-_pypi_name='WeasyPrint'
+# Maintainer: Caleb Maclennan <caleb@alerque.com>
+
+_pypi_name=WeasyPrint
+pkgname=python-${_pypi_name,,}
pkgver=52.5
-pkgrel=2
-pkgdesc="Converts web documents (HTML, CSS, SVG, ...) to PDF."
+pkgrel=3
+pkgdesc='Convert web documents (HTML, CSS, SVG, ...) to PDF'
license=('BSD')
arch=('any')
-url="http://weasyprint.org/"
-makedepends=('python' 'python-distribute' 'python-pip')
-depends=('python' 'pango>=1.29.3' 'gdk-pixbuf2>=2.25' 'cairo>=1.15.4'
- 'python-cairo' 'python-cairosvg'
- 'python-tinycss2' 'python-cssselect2>=0.1' 'python-html5lib'
- 'python-cffi' 'python-cairocffi' 'python-pyphen' 'python-xcffib')
-
-pkgname="python-weasyprint"
-_pypi_name_inital=$(echo ${_pypi_name}|cut -c1)
-source=("https://github.com/Kozea/WeasyPrint/archive/v${pkgver}.tar.gz")
-md5sums=('dae9e7b3d0d48312669050593d504e12')
+url='http://weasyprint.org'
+_py_deps=(cairo cairocffi cairosvg cffi cssselect2 html5lib pillow pyphen pytest-runner tinycss2)
+depends=(python "${_py_deps[@]/#/python-}")
+makedepends=(python-setuptools)
+source=("https://files.pythonhosted.org/packages/source/${_pypi_name::1}/$_pypi_name/$_pypi_name-$pkgver.tar.gz")
+sha256sums=('b37ea02d75ca04babd7becad7341426be332ae560d8f02d664bfa1e9afb18481')
+build() {
+ cd "$_pypi_name-$pkgver"
+ python setup.py build
+}
package() {
- cd "$srcdir/WeasyPrint-$pkgver"
- python3 setup.py install --root="$pkgdir/" --optimize=1
+ cd "$_pypi_name-$pkgver"
+ python setup.py install --root="$pkgdir" --optimize=1 --skip-build
}