summaryrefslogtreecommitdiffstats
path: root/package/python3/python3.mk
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2014-09-30 23:38:57 +0200
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2014-10-05 14:32:41 +0200
commitce0f19e5f64364125448e91590e4843bb2f79570 (patch)
tree87720d0ca625e0f6f58260a046537596f9c2ebc0 /package/python3/python3.mk
parentd02af2fd5324da2b9357a4ad3328545d8db45488 (diff)
downloadbuildroot-ce0f19e5f64364125448e91590e4843bb2f79570.tar.gz
buildroot-ce0f19e5f64364125448e91590e4843bb2f79570.zip
python3: remove unneeded __pycache__ directories
The __pycache__ directories are only needed on PEP3147-enabled installations, which is not the choice Buildroot has made. However, during the build process of the target Python, the separation between the target and host Python is not entirely complete, and starting the host Python to byte-compile the target Python modules triggers the compilation of a bunch of __pycache__ directories by the host Python, which uses a PEP 3147 installation. For now, simply get rid of those useless directories after the installation of Python is completed. In the long term, it would be good to achieve a better isolation between the host and target build to avoid this issue. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'package/python3/python3.mk')
-rw-r--r--package/python3/python3.mk4
1 files changed, 4 insertions, 0 deletions
diff --git a/package/python3/python3.mk b/package/python3/python3.mk
index 812b0a7317..3b0155079d 100644
--- a/package/python3/python3.mk
+++ b/package/python3/python3.mk
@@ -142,6 +142,10 @@ define PYTHON3_REMOVE_USELESS_FILES
-type f -not -name pyconfig.h -a -not -name Makefile` ; do \
rm -f $$i ; \
done
+ rm -rf $(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/__pycache__/
+ rm -rf $(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/lib-dynload/sysconfigdata/__pycache__
+ rm -rf $(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/collections/__pycache__
+ rm -rf $(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/importlib/__pycache__
endef
PYTHON3_POST_INSTALL_TARGET_HOOKS += PYTHON3_REMOVE_USELESS_FILES
OpenPOWER on IntegriCloud