Subject: [alpine-aports] [PATCH 1/3] testing/py-pypeg2: fix python 3 package

From: Drew DeVault <[email-masked]>
Date: Sun, 5 Aug 2018 13:37:28 -0400

---
 testing/py-pypeg2/APKBUILD | 40 ++++++++++++++++++++------------------
 1 file changed, 21 insertions(+), 19 deletions(-)

diff --git a/testing/py-pypeg2/APKBUILD b/testing/py-pypeg2/APKBUILD
index 61e88e502f..54554e4a35 100644
--- a/testing/py-pypeg2/APKBUILD
+++ b/testing/py-pypeg2/APKBUILD
@@ -1,58 +1,60 @@
+# Contributor: Drew DeVault <[email-masked]>
 # Contributor: Orson Teodoro <[email-masked]>
 # Maintainer: Orson Teodoro <[email-masked]>
 pkgname=py-pypeg2
 _pkgname=pypeg2
 __pkgname=pypeg
 pkgver=2.15.2
-pkgrel=0
+pkgrel=2
 pkgdesc="An intrinsic PEG Parser-Interpreter for Python"
 url="https://fdik.org/pyPEG2/"
 arch="noarch"
 license="GPL-2.0-only"
 _gitrev="43b84d987ec1"
-depends="py-lxml"
 makedepends="py-setuptools py3-setuptools"
 subpackages="py2-$_pkgname:_py2 py3-$_pkgname:_py3 $pkgname-doc"
 source="$pkgname-$pkgver.tar.gz::https://bitbucket.org/fdik/$__pkgname/get/$pkgver.tar.gz"
-builddir="$srcdir"/$_pkgname-$pkgver
+builddir="$srcdir"/fdik-$__pkgname-$_gitrev
 
 prepare() {
-	mv "$srcdir"/fdik-$__pkgname-* "$builddir"
+	sed -i -e "s|PYTHON=python3.3||g" "$builddir"/Makefile
+	cp -r "$builddir" "$builddir"-py3
 	default_prepare
 }
 
 check() {
 	cd "$builddir"
 	python2 setup.py check
-	python3 setup.py check
-	sed -i -e "s|PYTHON=python3.3||g" Makefile
 	PYTHON="/usr/bin/python2" make test
+	cd "$builddir"-py3
+	python3 setup.py check
 	PYTHON="/usr/bin/python3" make test
 }
 
+package() {
+	cd "$builddir"
+	mkdir -p "$pkgdir"
+	install -d "$pkgdir"/usr/share/doc/$pkgname
+	install -t "$pkgdir"/usr/share/doc/$pkgname CHANGES.txt README.txt
+}
+
 _py() {
-	local python="$1"
+	local pyver="${subpkgname:2:1}"
+	local python="python$pyver"
 	pkgdesc="$pkgdesc (for $python)"
-	depends="depends $python"
+	depends="$python ${depends//py-/py$pyver-}"
 	install_if="$pkgname=$pkgver-r$pkgrel $python"
-	cd "$builddir"
 	$python setup.py install --prefix=/usr --root="$subpkgdir"
 }
 
 _py2() {
-	depends="${depends//py-//py2-}"
-	_py python2
+	cd "$builddir"
+	_py
 }
 
 _py3() {
-	depends="${depends//py-//py3-}"
-	_py python3
-}
-
-package() {
-	cd "$builddir"
-	install -d "$pkgdir"/usr/share/doc/$pkgname
-	install -t "$pkgdir"/usr/share/doc/$pkgname CHANGES.txt README.txt
+	cd "$builddir"-py3
+	_py
 }
 
 sha512sums="425e9f56c2353687ab0a77789c209359fd0cf50a949f39fea88c2e153737fbd4e7b0c9716895606a912fa4b98ced3380361739ebddeb13f60c6aad9e41a018d7  py-pypeg2-2.15.2.tar.gz"
-- 
2.18.0

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

---

From: Drew DeVault <[email-masked]>
Date: Sun, 5 Aug 2018 13:37:30 -0400

---
 testing/qutebrowser/APKBUILD | 41 ++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)
 create mode 100644 testing/qutebrowser/APKBUILD

diff --git a/testing/qutebrowser/APKBUILD b/testing/qutebrowser/APKBUILD
new file mode 100644
index 0000000000..7a8a7bf75f
--- /dev/null
+++ b/testing/qutebrowser/APKBUILD
@@ -0,0 +1,41 @@
+# Maintainer: Drew DeVault <[email-masked]>
+pkgname=qutebrowser
+pkgver=1.4.1
+pkgrel=0
+pkgdesc="A keyboard-driven, vim-like browser based on PyQT5"
+url="https://qutebrowser.org/"
+arch="noarch"
+license="GPL-3.0-only"
+depends="
+	py3-attrs py3-jinja2 py3-pygments py3-pypeg2 py3-pyqt5 py3-yaml qt5-qtbase
+	qt5-qtwebengine
+"
+makedepends="asciidoc py3-pytest py3-hypothesis py3-setuptools"
+source="
+	https://github.com/qutebrowser/qutebrowser/releases/download/v$pkgver/qutebrowser-$pkgver.tar.gz
+"
+builddir="$srcdir/$pkgname-$pkgver"
+options="!check"
+
+build() {
+	cd "$builddir"
+	a2x -f manpage doc/qutebrowser.1.asciidoc
+	python3 setup.py build
+}
+
+package() {
+	cd "$builddir"
+	python3 setup.py install --root="$pkgdir/" --optimize=1
+	install -Dm644 misc/qutebrowser.desktop \
+		"$pkgdir"/usr/share/applications/qutebrowser.desktop
+	for i in 16 24 32 48 64 128 256 512; do
+		install -Dm644 "icons/qutebrowser-${i}x$i.png" \
+			"$pkgdir/usr/share/icons/hicolor/${i}x$i/apps/qutebrowser.png"
+	done
+	install -Dm644 icons/qutebrowser.svg \
+		"$pkgdir/usr/share/icons/hicolor/scalable/apps/qutebrowser.svg"
+	mkdir -p "$pkgdir/usr/share/qutebrowser/userscripts"
+	install -Dm755 -t "$pkgdir/usr/share/qutebrowser/userscripts/" misc/userscripts/*
+}
+
+sha512sums="a77b786980326f67ffb933d019438933de3a6f43244bfc0f42f22a8f189480b093757b2d5d81de58ab774f39ee4442c2482be4f78ffcad7b73f03d028e2b455d  qutebrowser-1.4.1.tar.gz"
-- 
2.18.0

---

---

From: Natanael Copa <[email-masked]>
Date: Tue, 4 Sep 2018 11:31:51 +0200

On Sun,  5 Aug 2018 13:37:30 -0400

> +++ b/testing/qutebrowser/APKBUILD

I fixed py3-qt5, and updated the depends for qutebrowser. I also added
qt5-qtbase-sqlite to depends which seems to be required.

Thanks!

-nc

---