aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Peter Korsgaard <peter@korsgaard.com>2020-10-11 11:09:30 +0200
committerGravatar Peter Korsgaard <peter@korsgaard.com>2020-10-12 10:56:46 +0200
commit896993e3bbf1a2c1a684dd62b3fa0f0e95092a20 (patch)
tree7729bbfe79d5f425c86f2e73433b65f92a39f894
parentce3b6156bd4f79b291188d267d60e6fc3ceb81d3 (diff)
downloadbuildroot-896993e3bbf1a2c1a684dd62b3fa0f0e95092a20.tar.gz
buildroot-896993e3bbf1a2c1a684dd62b3fa0f0e95092a20.tar.bz2
package/python-pymodbus: drop asyncio files for python 2.x to fix pycompile issue
Pymodbus has optional support for asyncio. Pycompile unfortunately errors out on these files when running under Python 2.x: ../scripts/pycompile.py .. error: File "/usr/lib/python2.7/site-packages/pymodbus/client/asynchronous/asyncio/__init__.py", line 257 yield from self._connect() ^ SyntaxError: invalid syntax As a workaround, simply drop the unusable files from TARGET_DIR if building for python 2.x. Fixes: http://autobuild.buildroot.net/results/cc4/cc48927cbe9ae6c2d8b12d65467ec40df82febf6/ Signed-off-by: Peter Korsgaard <peter@korsgaard.com> (cherry picked from commit 7d417ed7f3c5979a50ca97bdeeb8f97ba9394586) Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
-rw-r--r--package/python-pymodbus/python-pymodbus.mk9
1 files changed, 9 insertions, 0 deletions
diff --git a/package/python-pymodbus/python-pymodbus.mk b/package/python-pymodbus/python-pymodbus.mk
index d96e21a55c..9135a4d0c4 100644
--- a/package/python-pymodbus/python-pymodbus.mk
+++ b/package/python-pymodbus/python-pymodbus.mk
@@ -11,4 +11,13 @@ PYTHON_PYMODBUS_SETUP_TYPE = setuptools
PYTHON_PYMODBUS_LICENSE = BSD-3-Clause
PYTHON_PYMODBUS_LICENSE_FILES = doc/LICENSE
+ifeq ($(BR2_PACKAGE_PYTHON),y)
+# only needed/valid for python 3.x
+define PYTHON_PYMODBUS_RM_PY3_FILES
+ rm -rf $(TARGET_DIR)/usr/lib/python*/site-packages/pymodbus/client/asynchronous/asyncio
+endef
+
+PYTHON_PYMODBUS_POST_INSTALL_TARGET_HOOKS += PYTHON_PYMODBUS_RM_PY3_FILES
+endif
+
$(eval $(python-package))