diff mbox series

[06/10] package/python-flit-core: instantiate _INSTALL_CMDS

Message ID 20230930221727.1458825-7-arnout@mind.be
State Accepted
Headers show
Series package/pkg-python.mk: refactor setup-type variables | expand

Commit Message

Arnout Vandecappelle Sept. 30, 2023, 10:16 p.m. UTC
host-python-flit-core is the only package that overrides
_BASE_INSTALL_CMD. Since we're going to remove that variable in a
follow-up patch, we no longer will be able to do that.

Since host-python-flit-core is really a special case, it makes sense to
define HOST_PYTHON_FLIT_CORE_INSTALL_CMDS in its entirety.

While we're at it, also instantiate
HOST_PKG_PYTHON_PEP517_BOOTSTRAP_INSTALL_OPTS directly there. This
variable is not used anywhere else, and it's a bit confusing to have it
in pkg-python.mk - it looks like a mistake.

Signed-off-by: Arnout Vandecappelle <arnout@mind.be>
---
 package/pkg-python.mk                        | 3 ---
 package/python-flit-core/python-flit-core.mk | 9 +++++++--
 2 files changed, 7 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/package/pkg-python.mk b/package/pkg-python.mk
index 5f8ef14262..be9756acc4 100644
--- a/package/pkg-python.mk
+++ b/package/pkg-python.mk
@@ -177,9 +177,6 @@  HOST_PKG_PYTHON_PEP517_INSTALL_OPTS = \
 	--scripts=$(HOST_DIR)/bin \
 	--data=$(HOST_DIR)
 
-HOST_PKG_PYTHON_PEP517_BOOTSTRAP_INSTALL_OPTS = \
-	--installdir=$(HOST_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages
-
 # Target flit packages
 PKG_PYTHON_FLIT_ENV = \
 	$(PKG_PYTHON_PEP517_ENV)
diff --git a/package/python-flit-core/python-flit-core.mk b/package/python-flit-core/python-flit-core.mk
index ea887a0258..34e58d03ca 100644
--- a/package/python-flit-core/python-flit-core.mk
+++ b/package/python-flit-core/python-flit-core.mk
@@ -13,7 +13,12 @@  PYTHON_FLIT_CORE_SETUP_TYPE = flit-bootstrap
 
 # Use flit built in bootstrap_install for installing host-python-flit-core.
 # This is due to host-python-installer depending on host-python-flit-core.
-#
-HOST_PYTHON_FLIT_CORE_BASE_INSTALL_CMD = -m bootstrap_install dist/* $(HOST_PKG_PYTHON_PEP517_BOOTSTRAP_INSTALL_OPTS)
+define HOST_PYTHON_FLIT_CORE_INSTALL_CMDS
+	cd $($(PKG)_BUILDDIR)/; \
+		$(HOST_PKG_PYTHON_FLIT_BOOTSTRAP_ENV) \
+		$(HOST_DIR)/bin/python3 \
+		-m bootstrap_install dist/* \
+		--installdir=$(HOST_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages
+endef
 
 $(eval $(host-python-package))