summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO24
-rw-r--r--PKGBUILD36
-rw-r--r--aioh2-upstream-fixes-1.patch135
3 files changed, 195 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..d283c286580f
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,24 @@
+pkgbase = python-aioh2
+ pkgdesc = Client and server software to query DNS over HTTPS, using Google DNS-over-HTTPS protocol
+ pkgver = 0.2.2
+ pkgrel = 1
+ url = https://github.com/decentfox/aioh2
+ arch = x86_64
+ license = BSD
+ makedepends = python-coverage
+ makedepends = python-cryptography
+ makedepends = python-pyaml
+ makedepends = python-setuptools
+ makedepends = python-sphinx
+ makedepends = python-tox
+ makedepends = python-watchdog
+ makedepends = python-wheel
+ depends = python-h2
+ depends = python-priority
+ source = https://github.com/decentfox/aioh2/archive/v0.2.2.tar.gz
+ source = aioh2-upstream-fixes-1.patch
+ sha256sums = 250f79bfb4535225a6507d047427c0f94a1e3974a2b64b51ff3fef8970352d9a
+ sha256sums = 398fb996756899247a0836739821062681c09b46206ca64fba8a1d2cd721a3ec
+
+pkgname = python-aioh2
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..c04f9695b9a4
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,36 @@
+# Maintainer: DJ Lucas <dj@linuxfromscratch.org>
+
+pkgname=('python-aioh2')
+pkgver=0.2.2
+pkgrel=1
+pkgdesc="Client and server software to query DNS over HTTPS, using Google DNS-over-HTTPS protocol"
+pkgrelname='aioh2'
+url="https://github.com/decentfox/${pkgrelname}"
+arch=('x86_64')
+license=('BSD')
+makedepends=('python-coverage'
+ 'python-cryptography'
+ 'python-pyaml'
+ 'python-setuptools'
+ 'python-sphinx'
+ 'python-tox'
+ 'python-watchdog'
+ 'python-wheel')
+depends=('python-h2'
+ 'python-priority')
+source=("$url/archive/v$pkgver.tar.gz"
+ "aioh2-upstream-fixes-1.patch")
+sha256sums=('250f79bfb4535225a6507d047427c0f94a1e3974a2b64b51ff3fef8970352d9a'
+ '398fb996756899247a0836739821062681c09b46206ca64fba8a1d2cd721a3ec')
+
+build() {
+ cd "${srcdir}/${pkgrelname}-${pkgver}"
+ patch -Np1 -i "${srcdir}/aioh2-upstream-fixes-1.patch"
+ python3 setup.py build
+}
+
+package() {
+ cd "${srcdir}/${pkgrelname}-${pkgver}"
+ python3 setup.py install --root="${pkgdir}"
+}
+# vim:set ts=4 sw=4 et:
diff --git a/aioh2-upstream-fixes-1.patch b/aioh2-upstream-fixes-1.patch
new file mode 100644
index 000000000000..9ce014613bd6
--- /dev/null
+++ b/aioh2-upstream-fixes-1.patch
@@ -0,0 +1,135 @@
+Submitted by: DJ Lucas (dj_AT_linuxfromscratch_DOT_org)
+Date: 2019-12-29
+Initial Package Version: 0.2.2
+Upstream Status: Submitted
+Origin: https://github.com/URenko/aioh2/commit/933e5159aaef540d8154274cf08747ca17c878e8
+ https://github.com/URenko/aioh2/commit/8c1b5ab2399443087795fe52b71e43b652b1031f
+Description: Fixes build issues on Python-3.7+
+
+
+From e8105131ac13817f9d8dd432e2827a736085c69f Mon Sep 17 00:00:00 2001
+From: takeshix <takeshix@adversec.com>
+Date: Wed, 19 Dec 2018 15:01:43 +0100
+Subject: [PATCH] Make aioh2 work with Python >3.4
+
+The previous check for ensure_future() fails for Python 3.7. This fix
+should work for Python 3.4-3.7 and newer.
+---
+ aioh2/helper.py | 6 +++---
+ aioh2/protocol.py | 4 ++--
+ 2 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/aioh2/helper.py b/aioh2/helper.py
+index 3717931..9804564 100644
+--- a/aioh2/helper.py
++++ b/aioh2/helper.py
+@@ -4,7 +4,7 @@
+
+ from .protocol import H2Protocol
+
+-__all__ = ['open_connection', 'start_server']
++__all__ = ['open_connection', 'start_server', 'async_task']
+ if hasattr(socket, 'AF_UNIX'):
+ __all__.extend(['open_unix_connection', 'start_unix_server'])
+
+@@ -84,6 +84,6 @@ def factory():
+
+
+ if hasattr(asyncio, 'ensure_future'): # Python >= 3.5
+- async_task = asyncio.ensure_future
++ async_task = getattr(asyncio, 'ensure_future')
+ else:
+- async_task = asyncio.async
++ async_task = getattr(asyncio, 'async')
+diff --git a/aioh2/protocol.py b/aioh2/protocol.py
+index b4f1247..101c291 100644
+--- a/aioh2/protocol.py
++++ b/aioh2/protocol.py
+@@ -10,7 +10,7 @@
+ from h2.connection import H2Connection
+ from h2.exceptions import NoSuchStreamError, StreamClosedError, ProtocolError
+
+-from . import exceptions
++from . import exceptions, async_task
+
+ __all__ = ['H2Protocol']
+ logger = getLogger(__package__)
+@@ -380,7 +380,7 @@ def set_handler(self, handler):
+ if self._handler:
+ raise Exception('Handler was already set')
+ if handler:
+- self._handler = asyncio.async(handler, loop=self._loop)
++ self._handler = async_task(handler, loop=self._loop)
+
+ def close_connection(self):
+ self._transport.close()
+From 8c1b5ab2399443087795fe52b71e43b652b1031f Mon Sep 17 00:00:00 2001
+From: URenko <urenko@github.com>
+Date: Mon, 28 Jan 2019 13:22:34 +0800
+Subject: [PATCH] Fix async_task
+
+---
+ aioh2/helper.py | 7 +------
+ aioh2/protocol.py | 5 +++++
+ 2 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/aioh2/helper.py b/aioh2/helper.py
+index 9804564..d81dfba 100644
+--- a/aioh2/helper.py
++++ b/aioh2/helper.py
+@@ -4,7 +4,7 @@
+
+ from .protocol import H2Protocol
+
+-__all__ = ['open_connection', 'start_server', 'async_task']
++__all__ = ['open_connection', 'start_server']
+ if hasattr(socket, 'AF_UNIX'):
+ __all__.extend(['open_unix_connection', 'start_unix_server'])
+
+@@ -82,8 +82,3 @@ def factory():
+ # noinspection PyArgumentList
+ return (yield from loop.create_unix_server(factory, path, **kwargs))
+
+-
+-if hasattr(asyncio, 'ensure_future'): # Python >= 3.5
+- async_task = getattr(asyncio, 'ensure_future')
+-else:
+- async_task = getattr(asyncio, 'async')
+diff --git a/aioh2/protocol.py b/aioh2/protocol.py
+index 7ea86f1..fba886b 100644
+--- a/aioh2/protocol.py
++++ b/aioh2/protocol.py
+@@ -15,6 +15,11 @@
+ __all__ = ['H2Protocol']
+ logger = getLogger(__package__)
+
++if hasattr(asyncio, 'ensure_future'): # Python >= 3.5
++ async_task = getattr(asyncio, 'ensure_future')
++else:
++ async_task = getattr(asyncio, 'async')
++
+
+ @asyncio.coroutine
+ def _wait_for_events(*events_):
+From 933e5159aaef540d8154274cf08747ca17c878e8 Mon Sep 17 00:00:00 2001
+From: URenko <18209292+URenko@users.noreply.github.com>
+Date: Sat, 26 Jan 2019 12:42:37 +0800
+Subject: [PATCH] Update protocol.py
+
+---
+ aioh2/protocol.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/aioh2/protocol.py b/aioh2/protocol.py
+index 101c291..7ea86f1 100644
+--- a/aioh2/protocol.py
++++ b/aioh2/protocol.py
+@@ -10,7 +10,7 @@
+ from h2.connection import H2Connection
+ from h2.exceptions import NoSuchStreamError, StreamClosedError, ProtocolError
+
+-from . import exceptions, async_task
++from . import exceptions
+
+ __all__ = ['H2Protocol']
+ logger = getLogger(__package__)