summaryrefslogtreecommitdiff
path: root/package/python-gunicorn
diff options
context:
space:
mode:
authorMaxime Hadjinlian <maxime.hadjinlian@gmail.com>2017-02-06 20:36:31 +0100
committerPeter Korsgaard <peter@korsgaard.com>2017-02-06 22:49:44 +0100
commit9b76356bd2e7ae06cc8b5341d2e90fceb42727f8 (patch)
tree0dc4edf3986f87d3e9688e04420ca72dd590e04f /package/python-gunicorn
parent896ae3f9616d124c934f09d14de8cdc61ef0cec4 (diff)
python-gunicorn: fix build issue with python2
Fix: http://autobuild.buildroot.org/results/b2d/b2d43dd3c52cc9f586009a10a40f97b07548322d/build-end.log The issue arise from the fact that we compile all *.py files, but the _gaiohttp.py file is using Python3 ("yield from") syntax which causes an error. So if we are using Python2, delete this file as it won't ever be imported anyway as it is checked by gunicorn in the __init__.py file of the worker module. Signed-off-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Diffstat (limited to 'package/python-gunicorn')
-rw-r--r--package/python-gunicorn/python-gunicorn.mk12
1 files changed, 12 insertions, 0 deletions
diff --git a/package/python-gunicorn/python-gunicorn.mk b/package/python-gunicorn/python-gunicorn.mk
index 426e80973..cfb7da110 100644
--- a/package/python-gunicorn/python-gunicorn.mk
+++ b/package/python-gunicorn/python-gunicorn.mk
@@ -11,4 +11,16 @@ PYTHON_GUNICORN_SETUP_TYPE = setuptools
PYTHON_GUNICORN_LICENSE = MIT
PYTHON_GUNICORN_LICENSE_FILES = LICENSE
+# At the end of the build, we try to compile all py files using the host python
+# that has been built.
+# The GAIO HTTP Worker is only compatible with Python3.4.2 and up. So don't try
+# to compile it with python 2.x
+ifeq ($(BR2_PACKAGE_PYTHON),y)
+define PYTHON_GUNICORN_REMOVE_GAIO_WORKER
+ find $(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages/ \
+ -name "_gaiohttp.py" -exec rm -f {} \;
+endef
+PYTHON_GUNICORN_POST_INSTALL_TARGET_HOOKS += PYTHON_GUNICORN_REMOVE_GAIO_WORKER
+endif
+
$(eval $(python-package))