Patches for aports can be sent to this list

[alpine-aports] [PATCH] testing/py-flask-babel: split into a py2/py3 package, bump to 0.12.2

Kylie McClain
Details
Message ID
<20190414030812.30743-1-kylie@somas.is>
Sender timestamp
1555211292
DKIM signature
missing
Download raw message
Patch: +35 -10
---
 testing/py-flask-babel/APKBUILD | 45 +++++++++++++++++++++++++--------
 1 file changed, 35 insertions(+), 10 deletions(-)

diff --git a/testing/py-flask-babel/APKBUILD b/testing/py-flask-babel/APKBUILD
index a79c3f0b66..a5a1a98893 100644
--- a/testing/py-flask-babel/APKBUILD
+++ b/testing/py-flask-babel/APKBUILD
@@ -2,17 +2,18 @@
 # Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
 pkgname=py-flask-babel
 _pkgname=Flask-Babel
-pkgver=0.9
+pkgver=0.12.2
 pkgrel=0
 pkgdesc="Flask i18n/l10n support"
 url="https://pypi.python.org/pypi/Flask-Babel"
 arch="noarch"
 license="BSD"
-depends="python2 py-flask"
+depends="py-flask py-jinja2"
 depends_dev=""
-makedepends="python2-dev py-setuptools"
+makedepends="python2-dev python3-dev py-setuptools"
+checkdepends="py-babel py-tz"
 install=""
-subpackages=""
+subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"
 source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
 
 _builddir="$srcdir"/$_pkgname-$pkgver
@@ -28,14 +29,38 @@ prepare() {
 
 build() {
 	cd "$_builddir"
-	python2 setup.py build || return 1
+	python2 setup.py build
+	python3 setup.py build
 }
 
-package() {
+check() {
 	cd "$_builddir"
-	python2 setup.py install --prefix=/usr --root="$pkgdir" || return 1
+	python2 setup.py test
+	python3 setup.py test
+}
+
+package() {
+	mkdir -p "$pkgdir"
+}
+
+_py2() {
+    depends="${depends//py-/py2-}"
+    _py python2
+}
+
+_py3() {
+    depends="${depends//py-/py3-}"
+    _py python3
+}
+
+_py() {
+    local python="$1"
+    pkgdesc="$pkgdesc (for $python)"
+    depends="$depends $python"
+    install_if="$pkgname=$pkgver-r$pkgrel $python"
+
+    cd "$_builddir"
+    $python setup.py install --prefix=/usr --root="$subpkgdir"
 }
 
-md5sums="4762e0392303f464d53cbebedfb87ded  Flask-Babel-0.9.tar.gz"
-sha256sums="4afd150f360434b00684ba7848358f7961072fd0658a6e81aaa578522699fb4c  Flask-Babel-0.9.tar.gz"
-sha512sums="c667c8a532332bb3dd0d694932d17f7f9b2b51f68151767624116853b2e71f2a6b4c47164d17a6f368b67a5cabce97495b18147655fb36aee5034c058d3b9a89  Flask-Babel-0.9.tar.gz"
+sha512sums="c43bf5cf6c66e3a8a52298f52bd6300cf0b0c53a1f0fb5862b1bcf8a9800ea0e043c9f85125bb9eb5c281a3c0583c63f0f9653792204883a6f82080547b37104  Flask-Babel-0.12.2.tar.gz"
-- 
2.21.0



---
Unsubscribe:  alpine-aports+unsubscribe@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---