summaryrefslogtreecommitdiff
path: root/lang/python
diff options
context:
space:
mode:
authorJeffery To <jeffery.to@gmail.com>2020-04-15 15:11:01 +0800
committerJeffery To <jeffery.to@gmail.com>2020-04-19 01:56:23 +0800
commitc9b260f5ae9aee3de15f704ee454acfdef4c7579 (patch)
tree4dd48a97b22b4ade9ec2544a23211b2baf18b4e2 /lang/python
parent3cdca38dce01553766b032d8bbfce08a35d6555e (diff)
python3: Add canned recipe to invoke filespec processing
This extracts filespec export and processing into Py3Package/ProcessFilespec. This also allows the filespec variable to be explicitly set to an empty value, to bypass filespec processing. (The default filespec is also available as Py3Package/filespec/Default to be explicitly assigned to the filespec variable.) Signed-off-by: Jeffery To <jeffery.to@gmail.com>
Diffstat (limited to 'lang/python')
-rw-r--r--lang/python/python3-package.mk29
1 files changed, 17 insertions, 12 deletions
diff --git a/lang/python/python3-package.mk b/lang/python/python3-package.mk
index 6fab0f5cd..b8ab01348 100644
--- a/lang/python/python3-package.mk
+++ b/lang/python/python3-package.mk
@@ -121,6 +121,19 @@ endef
# Py3Package
+define Py3Package/filespec/Default
++|$(PYTHON3_PKG_DIR)
+endef
+
+# $(1) => package name
+# $(2) => src directory
+# $(3) => dest directory
+define Py3Package/ProcessFilespec
+ $(eval $(call shexport,Py3Package/$(1)/filespec))
+ $(SHELL) $(python3_mk_path)python-package-install.sh \
+ "$(2)" "$(3)" "$$$$$(call shvar,Py3Package/$(1)/filespec)"
+endef
+
define Py3Package
define Package/$(1)-src
@@ -144,10 +157,8 @@ define Py3Package
endef
# Add default PyPackage filespec none defined
- ifndef Py3Package/$(1)/filespec
- define Py3Package/$(1)/filespec
- +|$(PYTHON3_PKG_DIR)
- endef
+ ifeq ($(origin Py3Package/$(1)/filespec),undefined)
+ Py3Package/$(1)/filespec=$$(Py3Package/filespec/Default)
endif
ifndef Py3Package/$(1)/install
@@ -160,13 +171,9 @@ define Py3Package
endif
ifndef Package/$(1)/install
- $(call shexport,Py3Package/$(1)/filespec)
-
define Package/$(1)/install
$$(call Py3Package/$(1)/install,$$(1))
- $(SHELL) $(python3_mk_path)python-package-install.sh \
- "$(PKG_INSTALL_DIR)" "$$(1)" \
- "$$$$$$$$$$(call shvar,Py3Package/$(1)/filespec)"
+ $$(call Py3Package/ProcessFilespec,$(1),$(PKG_INSTALL_DIR),$$(1))
$(FIND) $$(1) -name '*.exe' -delete
$$(call Python3/CompileAll,$$(1))
$$(call Python3/DeleteSourceFiles,$$(1))
@@ -178,9 +185,7 @@ define Py3Package
define Package/$(1)-src/install
$$(call Py3Package/$(1)/install,$$(1))
- $(SHELL) $(python3_mk_path)python-package-install.sh \
- "$(PKG_INSTALL_DIR)" "$$(1)" \
- "$$$$$$$$$$(call shvar,Py3Package/$(1)/filespec)"
+ $$(call Py3Package/ProcessFilespec,$(1),$(PKG_INSTALL_DIR),$$(1))
$$(call Python3/DeleteNonSourceFiles,$$(1))
$$(call Python3/DeleteEmptyDirs,$$(1))
endef