All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [git commit] package/jailhouse: move conditional build/install to macro
@ 2023-11-25 21:02 Yann E. MORIN
  0 siblings, 0 replies; only message in thread
From: Yann E. MORIN @ 2023-11-25 21:02 UTC (permalink / raw)
  To: buildroot

commit: https://git.buildroot.net/buildroot/commit/?id=fde20964c71202589568d84de0c3bb4c3d6e9b17
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master

The usual way of having conditional build and installation of parts
of a generic-package, is to conditionally define macros that do that
build and installation, and unconditionally expand the macros in the
_BUILD_CMDS and _INSTALL_CMDS.

Do that in jailhouse, which used to use an ad-hoc conditional block
directly in _BUILD_CMDS and _INSTALL_CMDS.

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
---
 package/jailhouse/jailhouse.mk | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

diff --git a/package/jailhouse/jailhouse.mk b/package/jailhouse/jailhouse.mk
index 6356c5a7aa..913be765bd 100644
--- a/package/jailhouse/jailhouse.mk
+++ b/package/jailhouse/jailhouse.mk
@@ -30,11 +30,26 @@ JAILHOUSE_MAKE_OPTS += \
 	PYTHON_PIP_USABLE="no"
 endif
 
+ifeq ($(BR2_PACKAGE_JAILHOUSE_HELPER_SCRIPTS),y)
+define JAILHOUSE_BUILD_HELPER_SCRIPTS
+	cd $(@D) && \
+	$(PKG_PYTHON_SETUPTOOLS_ENV) \
+	$(HOST_DIR)/bin/python setup.py \
+		build
+endef
+define JAILHOUSE_INSTALL_HELPER_SCRIPTS
+	cd $(@D) && \
+	$(PKG_PYTHON_SETUPTOOLS_ENV) \
+	$(HOST_DIR)/bin/python setup.py \
+		install --no-compile \
+		$(PKG_PYTHON_SETUPTOOLS_INSTALL_TARGET_OPTS)
+endef
+endif
+
 define JAILHOUSE_BUILD_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) $(JAILHOUSE_MAKE_OPTS) -C $(@D)
 
-	$(if $(BR2_PACKAGE_JAILHOUSE_HELPER_SCRIPTS), \
-		cd $(@D) && $(PKG_PYTHON_SETUPTOOLS_ENV) $(HOST_DIR)/bin/python setup.py build)
+	$(JAILHOUSE_BUILD_HELPER_SCRIPTS)
 endef
 
 define JAILHOUSE_INSTALL_TARGET_CMDS
@@ -47,8 +62,7 @@ define JAILHOUSE_INSTALL_TARGET_CMDS
 	$(INSTALL) -d -m 0755 $(TARGET_DIR)/usr/local/libexec/jailhouse/demos
 	$(INSTALL) -D -m 0755 $(@D)/inmates/demos/*/*.bin $(TARGET_DIR)/usr/local/libexec/jailhouse/demos
 
-	$(if $(BR2_PACKAGE_JAILHOUSE_HELPER_SCRIPTS), \
-		cd $(@D) && $(PKG_PYTHON_SETUPTOOLS_ENV) $(HOST_DIR)/bin/python setup.py install --no-compile $(PKG_PYTHON_SETUPTOOLS_INSTALL_TARGET_OPTS))
+	$(JAILHOUSE_INSTALL_HELPER_SCRIPTS)
 endef
 
 $(eval $(generic-package))
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-12-04 20:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-25 21:02 [Buildroot] [git commit] package/jailhouse: move conditional build/install to macro Yann E. MORIN

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.