summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorlsf2020-11-11 18:53:35 +0100
committerlsf2020-11-11 18:53:35 +0100
commita7fd83c856ea7e2c9cd944ac52a8181148eecf8f (patch)
tree55925fdca348d3f2cbc1c1c185f8c76b402f2d55
downloadaur-a7fd83c856ea7e2c9cd944ac52a8181148eecf8f.tar.gz
initial commit
-rw-r--r--.SRCINFO22
-rw-r--r--PKGBUILD35
-rw-r--r--address_error.patch14
3 files changed, 71 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..2c1122a292b
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,22 @@
+pkgbase = python-briar-wrapper
+ pkgdesc = A wrapper for the Briar headless API.
+ pkgver = 0.0.6
+ 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
+ conflicts = python-briar-wrapper-git
+ source = git+https://code.briarproject.org/briar/python-briar-wrapper.git#tag=0.0.6
+ source = address_error.patch
+ sha256sums = SKIP
+ sha256sums = dff2e1645420e76c543065d3bedcfe17fc4669bb01627f6ba43a66c225b52f18
+
+pkgname = python-briar-wrapper
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..3a3450e075b
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,35 @@
+pkgname=python-briar-wrapper
+conflicts=('python-briar-wrapper-git')
+pkgver=0.0.6
+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')
+source=("git+https://code.briarproject.org/briar/python-briar-wrapper.git#tag=${pkgver}"
+ 'address_error.patch')
+sha256sums=('SKIP'
+ 'dff2e1645420e76c543065d3bedcfe17fc4669bb01627f6ba43a66c225b52f18')
+
+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 00000000000..3d86165c80c
--- /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)