Subject: [alpine-aports] [PATCH] community/py-weasyprint: add py3, update to 0.42.3

From: Drew DeVault <[email-masked]>
Date: Tue, 20 Nov 2018 18:01:05 -0500

---
 testing/py-weasyprint/APKBUILD | 58 ++++++++++++++++++++++------------
 1 file changed, 37 insertions(+), 21 deletions(-)

diff --git a/testing/py-weasyprint/APKBUILD b/testing/py-weasyprint/APKBUILD
index 373a3b4574..4e1e0873b5 100644
--- a/testing/py-weasyprint/APKBUILD
+++ b/testing/py-weasyprint/APKBUILD
@@ -2,40 +2,56 @@
 # Maintainer: William Pitcock <[email-masked]>
 pkgname=py-weasyprint
 _pkgname=WeasyPrint
-pkgver=0.19.2
+pkgver=0.42.3
 pkgrel=0
 pkgdesc="cairo-based HTML renderer for python"
 url="http://weasyprint.org"
 arch="noarch"
 license="LGPL"
-depends="python2 pango cairo py-cairocffi py-cairosvg py-cssselect py-tinycss py-pyphen py-lxml"
-depends_dev=""
-makedepends="python2-dev py-setuptools"
-install=""
-subpackages=""
+depends="pango cairo py-cairocffi py-cairosvg py-cssselect py-tinycss py-pyphen py-lxml"
+subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"
+makedepends="python2-dev python3-dev py-setuptools"
 source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
+builddir="$srcdir"/$_pkgname-$pkgver
 
-_builddir="$srcdir"/$_pkgname-$pkgver
 prepare() {
-	local i
-	cd "$_builddir"
-	for i in $source; do
-		case $i in
-		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
-		esac
-	done
+	cp -r "$builddir" "$builddir"-py3
 }
 
 build() {
-	cd "$_builddir"
-	python2 setup.py build || return 1
+	cd "$builddir"
+	python2 setup.py build
+	cd "$builddir"-py3
+	python3 setup.py build
+}
+
+check() {
+	cd "$builddir"
+	python2 setup.py check
+	cd "$builddir"-py3
+	python3 setup.py check
 }
 
 package() {
-	cd "$_builddir"
-	python2 setup.py install --prefix=/usr --root="$pkgdir" || return 1
+	mkdir -p "$pkgdir"
+}
+
+_py2() {
+	cd "$builddir"
+	_py python2
+}
+
+_py3() {
+	cd "$builddir"-py3
+	_py python3
+}
+
+_py() {
+	local python="$1"
+	pkgdesc="$pkgdesc (for $python)"
+	depends="$python"
+	install_if="$pkgname=$pkgver-r$pkgrel $python"
+	$python setup.py install --prefix=/usr --root="$subpkgdir"
 }
 
-md5sums="75f1de2cf4677c53c5bff1adb23033ec  WeasyPrint-0.19.2.tar.gz"
-sha256sums="63fa62b40a5bd3a1f14887950f6f40d73fff752507cd41f0040606b3d5399ba4  WeasyPrint-0.19.2.tar.gz"
-sha512sums="c491ec6788b164857265f11391148d761a737a47045288258f5584b277d58075e49384a9c0fa93ab849adbc1672684518039e2cc7bcf76b684dbab196f666166  WeasyPrint-0.19.2.tar.gz"
+sha512sums="d6007934c301904308bd4821626d6a7bb504268c5c71a31f7486faebb3dd649fad18774737cab39eb13a0916635bb58eba2c8432c72cc5a461cea2a5d874b1ee  WeasyPrint-0.42.3.tar.gz"
-- 
2.18.1

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---