python3: remove full path from .pyc
authorJérôme Pouiller <jezz@sysmic.org>
Tue, 20 Dec 2016 13:46:27 +0000 (14:46 +0100)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sat, 1 Apr 2017 16:31:19 +0000 (18:31 +0200)
.pyc files include path to source .py file. This patch changes the way
`pycompile.py' is launched in order to only keep the part relative to
$TARGET_DIR.

This work was sponsored by `BA Robotic Systems'.

Signed-off-by: Jérôme Pouiller <jezz@sysmic.org>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Reviewed-by: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/python3/python3.mk

index 6189aa8c7bc8824eadec62e437a8ed5dd597a070..74f81167ffd643cf72e00ad3a20e70465a5dd1f8 100644 (file)
@@ -247,9 +247,10 @@ endif
 define PYTHON3_CREATE_PYC_FILES
        $(PYTHON3_FIX_TIME)
        PYTHONPATH="$(PYTHON3_PATH)" \
-       $(HOST_DIR)/usr/bin/python$(PYTHON3_VERSION_MAJOR) \
-               support/scripts/pycompile.py $(if $(BR2_REPRODUCIBLE),--force) \
-               $(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)
+       cd $(TARGET_DIR) && $(HOST_DIR)/usr/bin/python$(PYTHON3_VERSION_MAJOR) \
+               $(TOPDIR)/support/scripts/pycompile.py \
+               $(if $(BR2_REPRODUCIBLE),--force) \
+               usr/lib/python$(PYTHON3_VERSION_MAJOR)
 endef
 
 ifeq ($(BR2_PACKAGE_PYTHON3_PYC_ONLY)$(BR2_PACKAGE_PYTHON3_PY_PYC),y)