diff options
author | carlwgeorge | 2017-01-08 12:19:44 -0600 |
---|---|---|
committer | carlwgeorge | 2017-01-08 12:19:44 -0600 |
commit | 773dd2b8ed46b233f6937c73c1fafc081832141b (patch) | |
tree | a88b3a398e7d3ee481a82aad723fed83bb662740 | |
parent | 3981a6d8006070ca7b3bd3b50cff6520a9755800 (diff) | |
download | aur-773dd2b8ed46b233f6937c73c1fafc081832141b.tar.gz |
use system http-parser
-rw-r--r-- | 0002-use-system-http_parser.patch | 42 | ||||
-rw-r--r-- | PKGBUILD | 24 |
2 files changed, 49 insertions, 17 deletions
diff --git a/0002-use-system-http_parser.patch b/0002-use-system-http_parser.patch new file mode 100644 index 000000000000..556531cde4ad --- /dev/null +++ b/0002-use-system-http_parser.patch @@ -0,0 +1,42 @@ +From 5cfb2edc6541bb1bc74cd5973a2a3323b1e085e2 Mon Sep 17 00:00:00 2001 +From: Igor Gnatenko <i.gnatenko.brain@gmail.com> +Date: Sun, 1 Jan 2017 14:37:03 +0100 +Subject: [PATCH 2/2] use system http_parser + +Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com> +--- + httptools/parser/cparser.pxd | 2 +- + setup.py | 4 +++- + 2 files changed, 4 insertions(+), 2 deletions(-) + +diff --git a/httptools/parser/cparser.pxd b/httptools/parser/cparser.pxd +index bad2060..7644a1c 100644 +--- a/httptools/parser/cparser.pxd ++++ b/httptools/parser/cparser.pxd +@@ -1,7 +1,7 @@ + from libc.stdint cimport uint16_t, uint32_t, uint64_t + + +-cdef extern from "../../vendor/http-parser/http_parser.h": ++cdef extern from "http_parser.h": + ctypedef int (*http_data_cb) (http_parser*, + const char *at, + size_t length) except -1 +diff --git a/setup.py b/setup.py +index 943acf8..dfe7268 100644 +--- a/setup.py ++++ b/setup.py +@@ -20,7 +20,9 @@ setup( + license='MIT', + packages=['httptools', 'httptools.parser'], + ext_modules=cythonize([ +- Extension("httptools.parser.parser", ["httptools/parser/parser.pyx"]) ++ Extension("httptools.parser.parser", ++ ["httptools/parser/parser.pyx"], ++ libraries=['http_parser']) + ]), + setup_requires=["Cython"], + provides=['httptools'], +-- +2.11.0 + @@ -1,8 +1,5 @@ # Maintainer: mdraw.gh at gmail dot com -# If anyone knows how to make the http-parser submodule work -# without this ugly hack in package(), please tell me! - pkgname=('python-httptools') pkgver='0.0.9' pkgrel=2 @@ -10,29 +7,22 @@ pkgdesc='Fast HTTP parser' arch=('i686' 'x86_64') url='https://github.com/MagicStack/httptools' license=('MIT') -depends=('python') -makedepends=('python-setuptools' 'cython') +makedepends=('python-setuptools' 'cython' 'http-parser') source=("https://github.com/MagicStack/httptools/archive/v${pkgver}.tar.gz" - '0001-setup.py-Use-Cython-directly.patch') + '0001-setup.py-Use-Cython-directly.patch' + '0002-use-system-http_parser.patch') sha256sums=('ce82e03f2d705b1efc03bed5773436f2466de755d2faaf08e902a0f025700053' - 'f32dd7a31a858ec52c4ed7559a7dc358fb03702160bf388c7dbd4ad5802524d4') + 'f32dd7a31a858ec52c4ed7559a7dc358fb03702160bf388c7dbd4ad5802524d4' + '42e9d6041eb5c5fece89596e9ca2b5dc718aceda5892eb3144d0bd849633b10a') prepare() { cd "${srcdir}/httptools-${pkgver}" patch -p1 -i "${srcdir}/0001-setup.py-Use-Cython-directly.patch" + patch -p1 -i "${srcdir}/0002-use-system-http_parser.patch" } package_python-httptools() { + depends=('python' 'http-parser') cd "${srcdir}/httptools-${pkgver}" - - # Git submodule workaround - pushd vendor - rm -rf http-parser - git clone https://github.com/nodejs/http-parser.git - pushd http-parser - git checkout '9b0d5b3' # re-check this hash when updating - popd - popd - python setup.py install --root="${pkgdir}" --optimize=1 } |