summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorcarlwgeorge2017-01-08 12:15:57 -0600
committercarlwgeorge2017-01-08 12:17:50 -0600
commit3981a6d8006070ca7b3bd3b50cff6520a9755800 (patch)
tree9a4935648ef6e19b698538ada3c688a7dac3690f
parent801d6456e2934b8cf4dd033cbde2c52a17038287 (diff)
downloadaur-3981a6d8006070ca7b3bd3b50cff6520a9755800.tar.gz
use cython directly
-rw-r--r--0001-setup.py-Use-Cython-directly.patch41
-rw-r--r--PKGBUILD12
2 files changed, 50 insertions, 3 deletions
diff --git a/0001-setup.py-Use-Cython-directly.patch b/0001-setup.py-Use-Cython-directly.patch
new file mode 100644
index 000000000000..a10065f5fdb0
--- /dev/null
+++ b/0001-setup.py-Use-Cython-directly.patch
@@ -0,0 +1,41 @@
+From 79687e1a2d1d7177cca302a8ebd7ee176b291c0b Mon Sep 17 00:00:00 2001
+From: Igor Gnatenko <i.gnatenko.brain@gmail.com>
+Date: Sun, 1 Jan 2017 14:35:31 +0100
+Subject: [PATCH 1/2] setup.py: Use Cython directly
+
+Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
+---
+ setup.py | 12 +++++-------
+ 1 file changed, 5 insertions(+), 7 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index 419c6c8..943acf8 100644
+--- a/setup.py
++++ b/setup.py
+@@ -1,5 +1,5 @@
+ from setuptools import setup, Extension
+-
++from Cython.Build import cythonize
+
+ setup(
+ name='httptools',
+@@ -19,12 +19,10 @@ setup(
+ author_email='yury@magic.io',
+ license='MIT',
+ packages=['httptools', 'httptools.parser'],
+- ext_modules=[
+- Extension("httptools.parser.parser",
+- ["httptools/parser/parser.c",
+- "vendor/http-parser/http_parser.c"],
+- extra_compile_args=['-O2'])
+- ],
++ ext_modules=cythonize([
++ Extension("httptools.parser.parser", ["httptools/parser/parser.pyx"])
++ ]),
++ setup_requires=["Cython"],
+ provides=['httptools'],
+ include_package_data=True
+ )
+--
+2.11.0
+
diff --git a/PKGBUILD b/PKGBUILD
index 4afc9160e24a..00e3608a2381 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -12,8 +12,15 @@ url='https://github.com/MagicStack/httptools'
license=('MIT')
depends=('python')
makedepends=('python-setuptools' 'cython')
-source=("https://github.com/MagicStack/httptools/archive/v${pkgver}.tar.gz")
-sha256sums=('ce82e03f2d705b1efc03bed5773436f2466de755d2faaf08e902a0f025700053')
+source=("https://github.com/MagicStack/httptools/archive/v${pkgver}.tar.gz"
+ '0001-setup.py-Use-Cython-directly.patch')
+sha256sums=('ce82e03f2d705b1efc03bed5773436f2466de755d2faaf08e902a0f025700053'
+ 'f32dd7a31a858ec52c4ed7559a7dc358fb03702160bf388c7dbd4ad5802524d4')
+
+prepare() {
+ cd "${srcdir}/httptools-${pkgver}"
+ patch -p1 -i "${srcdir}/0001-setup.py-Use-Cython-directly.patch"
+}
package_python-httptools() {
cd "${srcdir}/httptools-${pkgver}"
@@ -27,6 +34,5 @@ package_python-httptools() {
popd
popd
- cython httptools/parser/parser.pyx
python setup.py install --root="${pkgdir}" --optimize=1
}