Commit 6ffab129 authored by Maxime Ripard's avatar Maxime Ripard Committed by Peter Korsgaard
Browse files

python3: Handle properly the pyc and py files on the target

parent 9976b37f
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -155,5 +155,27 @@ endef
ifneq ($(BR2_PACKAGE_PYTHON),y)
PYTHON3_POST_INSTALL_TARGET_HOOKS += PYTHON3_INSTALL_SYMLINK
endif

ifeq ($(BR2_PACKAGE_PYTHON3_PY_ONLY),y)
define PYTHON3_REMOVE_MODULES_FILES
	for i in `find $(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR) \
		 -name __pycache__` ; do \
		rm -rf $$i ; \
	done
endef
endif

ifeq ($(BR2_PACKAGE_PYTHON3_PYC_ONLY),y)
define PYTHON3_REMOVE_MODULES_FILES
	for i in `find $(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR) \
		 -name *.py` ; do \
		rm -f $$i ; \
	done
endef
endif

PYTHON3_POST_INSTALL_TARGET_HOOKS += PYTHON3_REMOVE_MODULES_FILES


$(eval $(autotools-package))
$(eval $(host-autotools-package))