Subject: [alpine-aports] [PATCH v2] testing/py3-cairosvg: adopt, upgrade to 2.3.0

From: Drew DeVault <[email-masked]>
Date: Fri, 5 Apr 2019 11:24:11 -0400

Note that this required dropping python2 support and overhauling large
parts of the APKBUILD.
---
Updated to include missing checkdepend

 testing/py-cairosvg/APKBUILD  | 40 -----------------------------------
 testing/py3-cairosvg/APKBUILD | 38 +++++++++++++++++++++++++++++++++
 2 files changed, 38 insertions(+), 40 deletions(-)
 delete mode 100644 testing/py-cairosvg/APKBUILD
 create mode 100644 testing/py3-cairosvg/APKBUILD

diff --git a/testing/py-cairosvg/APKBUILD b/testing/py-cairosvg/APKBUILD
deleted file mode 100644
index 82b330bd4c..0000000000
--- a/testing/py-cairosvg/APKBUILD
+++ /dev/null
@@ -1,40 +0,0 @@
-# Contributor: 
-# Maintainer: 
-pkgname=py-cairosvg
-pkgver=0.5
-pkgrel=0
-pkgdesc="Cairo-based SVG renderer for python"
-url="http://cairosvg.org"
-arch="noarch"
-license="LGPL-3.0-or-later"
-depends="python2 py-cairocffi"
-depends_dev=""
-makedepends="python2-dev py-setuptools"
-install=""
-subpackages=""
-source="https://files.pythonhosted.org/packages/source/C/CairoSVG/CairoSVG-$pkgver.tar.gz"
-
-_builddir="$srcdir"/CairoSVG-$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
-}
-
-build() {
-	cd "$_builddir"
-	python2 setup.py build || return 1
-}
-
-package() {
-	cd "$_builddir"
-	python2 setup.py install --prefix=/usr --root="$pkgdir" || return 1
-}
-
-md5sums="6c092cce2b2ade47054aea6657173cbf  CairoSVG-0.5.tar.gz"
-sha256sums="9aa311fb832c37bf376a4bbcf0b97beddc4527e4fbd918cdd35d42bc3200e170  CairoSVG-0.5.tar.gz"
-sha512sums="039db314effeeeb2bfae1ad47f8505742fcc160804e8f029a4f3568fbc3e9b802e785ae2cf4ec63d6dee6d4730676fa48c1d8915423ec60e5855540eaac17572  CairoSVG-0.5.tar.gz"
diff --git a/testing/py3-cairosvg/APKBUILD b/testing/py3-cairosvg/APKBUILD
new file mode 100644
index 0000000000..d544aec52d
--- /dev/null
+++ b/testing/py3-cairosvg/APKBUILD
@@ -0,0 +1,38 @@
+# Maintainer: Drew DeVault <[email-masked]>
+pkgname=py3-cairosvg
+_pyname=CairoSVG
+pkgver=2.3.0
+pkgrel=0
+pkgdesc="Cairo-based SVG renderer for python"
+url="http://cairosvg.org"
+arch="noarch"
+license="LGPL-3.0-or-later"
+depends="python3 py3-tinycss2 py3-cssselect2 py3-defusedxml py3-cairocffi"
+checkdepends="py3-pytest py3-pillow"
+makedepends="python3-dev py3-setuptools cairo-dev"
+_pypiprefix="${_pyname%${_pyname#?}}"
+source="https://files.pythonhosted.org/packages/source/$_pypiprefix/$_pyname/$_pyname-$pkgver.tar.gz"
+builddir="$srcdir"/CairoSVG-$pkgver
+replaces="py-cairosvg"
+
+prepare() {
+	cd "$builddir"
+	sed -i setup.cfg -e 's/--flake8//' -e 's/--isort//'
+}
+
+build() {
+	cd "$builddir"
+	python3 setup.py build
+}
+
+check() {
+	cd "$builddir"
+	pytest-3
+}
+
+package() {
+	mkdir -p "$pkgdir"
+	python3 setup.py install --prefix=/usr --root="$pkgdir"
+}
+
+sha512sums="099da421f3e3bd8b1aaf727bffe388ed08b36eb027a79e31d2fae74fe67adcb8c174763ae2bae49715369a5ab44aea1d3f50bd64895a6aac6740ddf8bebbdc54  CairoSVG-2.3.0.tar.gz"
-- 
2.21.0

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