diff --git a/package/pkg-python.mk b/package/pkg-python.mk index eacf75c165..c1640d71bb 100644 --- a/package/pkg-python.mk +++ b/package/pkg-python.mk @@ -324,6 +324,7 @@ $(2)_DOWNLOAD_POST_PROCESS = cargo $(2)_DOWNLOAD_DEPENDENCIES = host-rustc endif # SETUP_TYPE +ifeq ($(4),target) # # Build step. Only define it if not already defined by the package .mk # file. @@ -338,20 +339,6 @@ define $(2)_BUILD_CMDS endef endif -# -# Host installation step. Only define it if not already defined by the -# package .mk file. -# -ifndef $(2)_INSTALL_CMDS -define $(2)_INSTALL_CMDS - (cd $$($$(PKG)_BUILDDIR)/; \ - $$($$(PKG)_BASE_ENV) $$($$(PKG)_ENV) \ - $$(HOST_DIR)/bin/python3 \ - $$($$(PKG)_BASE_INSTALL_CMD) \ - $$($$(PKG)_INSTALL_OPTS)) -endef -endif - # # Target installation step. Only define it if not already defined by # the package .mk file. @@ -380,6 +367,38 @@ define $(2)_INSTALL_STAGING_CMDS endef endif +else # host + +# +# Host build step. Only define it if not already defined by the package .mk +# file. +# +ifndef $(2)_BUILD_CMDS +define $(2)_BUILD_CMDS + (cd $$($$(PKG)_BUILDDIR)/; \ + $$($$(PKG)_BASE_ENV) $$($$(PKG)_ENV) \ + $$(HOST_DIR)/bin/python3 \ + $$($$(PKG)_BASE_BUILD_CMD) \ + $$($$(PKG)_BUILD_OPTS)) +endef +endif + +# +# Host installation step. Only define it if not already defined by the +# package .mk file. +# +ifndef $(2)_INSTALL_CMDS +define $(2)_INSTALL_CMDS + (cd $$($$(PKG)_BUILDDIR)/; \ + $$($$(PKG)_BASE_ENV) $$($$(PKG)_ENV) \ + $$(HOST_DIR)/bin/python3 \ + $$($$(PKG)_BASE_INSTALL_CMD) \ + $$($$(PKG)_INSTALL_OPTS)) +endef +endif + +endif # host / target + # Call the generic package infrastructure to generate the necessary # make targets $(call inner-generic-package,$(1),$(2),$(3),$(4))