summaryrefslogtreecommitdiff
path: root/lang/python/python3/files/python3-package-setuptools.mk
diff options
context:
space:
mode:
authorJeffery To <jeffery.to@gmail.com>2020-05-21 20:02:13 +0800
committerJeffery To <jeffery.to@gmail.com>2020-05-21 20:15:24 +0800
commit6dac29693f3c6f3feb35018d31868f9db522d285 (patch)
treec02c465d1f61e3ad1763eac25ec6b51dd67f13e6 /lang/python/python3/files/python3-package-setuptools.mk
parent49ac1e8b740d5371ebe7a4a7fc4655ef03f223d9 (diff)
python3-setuptools: Fix error when installing from source
When a Python package is installed from source (i.e. using setup.py) into a custom location (with --home), setuptools may want to create a site.py file in the custom location. This file is created based on the source code of site-patch.py, a file bundled with setuptools. Because the normal OpenWrt setuptools package does not contain Python source code, this file is missing and the installation will end with an error. This copies site-patch.py to site-patch.py.txt so that it will be included in python3-setuptools, and patches setuptools to look for this file. See https://github.com/openwrt/packages/issues/12223 Signed-off-by: Jeffery To <jeffery.to@gmail.com> (cherry picked from commit 70a7f736c5d6fb9ebec1acc8b3e8ca77704361bf)
Diffstat (limited to 'lang/python/python3/files/python3-package-setuptools.mk')
-rw-r--r--lang/python/python3/files/python3-package-setuptools.mk3
1 files changed, 3 insertions, 0 deletions
diff --git a/lang/python/python3/files/python3-package-setuptools.mk b/lang/python/python3/files/python3-package-setuptools.mk
index 64a86b81d..3a562c262 100644
--- a/lang/python/python3/files/python3-package-setuptools.mk
+++ b/lang/python/python3/files/python3-package-setuptools.mk
@@ -24,6 +24,9 @@ define Py3Package/python3-setuptools/install
$(PKG_BUILD_DIR)/install-setuptools/usr/lib/python$(PYTHON3_VERSION)/site-packages/setuptools-$(PYTHON3_SETUPTOOLS_VERSION).dist-info \
$(PKG_BUILD_DIR)/install-setuptools/usr/lib/python$(PYTHON3_VERSION)/site-packages/easy_install.py \
$(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages
+ $(CP) \
+ $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages/setuptools/site-patch.py \
+ $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages/setuptools/site-patch.py.txt
find $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages/ -path '*/__pycache__/*' -delete
find $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages/ -type d -name __pycache__ -delete
endef