summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorlsf2020-09-23 23:29:29 +0200
committerlsf2020-09-23 23:29:29 +0200
commit817e5908c842243778caaa701a05bc849a1a2f08 (patch)
tree9b7e55aa0eb1dd96be18b1902f57ac3bc22eb1e7
downloadaur-817e5908c842243778caaa701a05bc849a1a2f08.tar.gz
initial commit
-rw-r--r--.SRCINFO22
-rw-r--r--PKGBUILD41
-rw-r--r--address_error.patch14
3 files changed, 77 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..41e1f8bc2e86
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,22 @@
+pkgbase = python-briar-wrapper-git
+ pkgdesc = A wrapper for the Briar headless API.
+ pkgver = 0.0.4.r1.gb8ac26b
+ pkgrel = 1
+ url = https://code.briarproject.org/briar/python-briar-wrapper
+ arch = any
+ license = GNU Affero GPL
+ makedepends = python-setuptools
+ makedepends = python-dephell
+ makedepends = git
+ depends = python
+ depends = python-websockets
+ depends = python-requests
+ depends = briar-headless-git
+ conflicts = python-briar-wrapper
+ source = git+https://code.briarproject.org/briar/python-briar-wrapper.git
+ source = address_error.patch
+ sha256sums = SKIP
+ sha256sums = dff2e1645420e76c543065d3bedcfe17fc4669bb01627f6ba43a66c225b52f18
+
+pkgname = python-briar-wrapper-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..646740e93798
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,41 @@
+pkgname=python-briar-wrapper-git
+_pkgname=python-briar-wrapper
+conflicts=('python-briar-wrapper')
+pkgver=0.0.4.r1.gb8ac26b
+pkgrel=1
+pkgdesc='A wrapper for the Briar headless API.'
+arch=('any')
+url='https://code.briarproject.org/briar/python-briar-wrapper'
+license=('GNU Affero GPL')
+makedepends=('python-setuptools' 'python-dephell' 'git')
+depends=('python' 'python-websockets' 'python-requests' 'briar-headless-git')
+source=("git+https://code.briarproject.org/briar/python-briar-wrapper.git"
+ 'address_error.patch')
+sha256sums=('SKIP'
+ 'dff2e1645420e76c543065d3bedcfe17fc4669bb01627f6ba43a66c225b52f18')
+
+pkgver() {
+ cd "${_pkgname}"
+ git describe --long --tags | sed -e 's/^v//' -e 's/-\([^-]*-g[^-]*\)$/-r\1/' -e 's/-/./g'
+}
+
+prepare() {
+ cd "${_pkgname}"
+ dephell deps convert --prereleases --from pyproject.toml --to setup.py
+ sed -E 's/packages=\[.*/packages=\["briar_wrapper", "briar_wrapper.models"\],/' -i setup.py
+
+ # fix uncaught OSError / 'Cannot assign requested address' while waiting for briar-headless to come up
+ patch -Np1 -i ../address_error.patch
+}
+
+build() {
+ cd "${srcdir}/${_pkgname}"
+
+ python setup.py build
+}
+
+package() {
+ cd "${srcdir}/${_pkgname}"
+
+ python setup.py install --root="$pkgdir/" --optimize=1 --skip-build
+}
diff --git a/address_error.patch b/address_error.patch
new file mode 100644
index 000000000000..3d86165c80ca
--- /dev/null
+++ b/address_error.patch
@@ -0,0 +1,14 @@
+diff --git a/briar_wrapper/api_thread.py b/briar_wrapper/api_thread.py
+index 18b5928..7b922b8 100644
+--- a/briar_wrapper/api_thread.py
++++ b/briar_wrapper/api_thread.py
+@@ -60,6 +60,8 @@ class ApiThread:
+ if http_error.code == 404:
+ return self._api.on_successful_startup(callback)
+ except URLError as url_error:
+- if not isinstance(url_error.reason, ConnectionRefusedError):
++ if (not isinstance(url_error.reason, ConnectionRefusedError)
++ and (isinstance(url_error.reason, OSError)
++ and url_error.reason.errno != 99)):
+ raise url_error
+ callback(False)