diff mbox series

[v5,1/2] package/pkg-meson: h files only into sysroot

Message ID 20241206213002.24669-2-vjardin@free.fr
State Superseded
Headers show
Series meson install with optional tags | expand

Commit Message

Vincent Jardin Dec. 6, 2024, 9:30 p.m. UTC
Many packages built with Buildroot and meson currently install header
files into both:
  - the target’s /usr/include, and
  - the sysroot’s /usr/include.

When FOO_MESON_INSTALL_TAGS = YES, ensure that header files are
installed exclusively in the staging (sysroot) target during the
build process.

The default is FOO_MESON_INSTALL_TAGS ?= NO in order to avoid
changing to this new behaviour for the time being.

Signed-off-by: Vincent Jardin <vjardin@free.fr>
Suggested-by: Robin Jarry <robin@jarry.cc>
Suggested-by: Brandon Maier <brandon.maier@gmail.com>
---
 package/pkg-meson.mk | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/package/pkg-meson.mk b/package/pkg-meson.mk
index bc805b799c..4568f8690e 100644
--- a/package/pkg-meson.mk
+++ b/package/pkg-meson.mk
@@ -220,10 +220,13 @@  endif
 ifndef $(2)_INSTALL_CMDS
 define $(2)_INSTALL_CMDS
 	$$(HOST_MAKE_ENV) $$($$(PKG)_NINJA_ENV) \
-		$$(NINJA) $$(NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/build install
+		$$(MESON) install -C $$($$(PKG)_SRCDIR)/build
 endef
 endif
 
+# Default values for Staging installation and Target installation
+$(2)_MESON_INSTALL_TAGS ?= NO
+
 #
 # Staging installation step. Only define it if not already defined by
 # the package .mk file.
@@ -231,7 +234,8 @@  endif
 ifndef $(2)_INSTALL_STAGING_CMDS
 define $(2)_INSTALL_STAGING_CMDS
 	$$(TARGET_MAKE_ENV) $$($$(PKG)_NINJA_ENV) DESTDIR=$$(STAGING_DIR) \
-		$$(NINJA) $$(NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/build install
+		$$(MESON) install -C \
+		  $$($$(PKG)_SRCDIR)/build $(if $(filter YES,$($(2)_MESON_INSTALL_TAGS)),--tags=runtime$(comma)devel)
 endef
 endif
 
@@ -242,7 +246,8 @@  endif
 ifndef $(2)_INSTALL_TARGET_CMDS
 define $(2)_INSTALL_TARGET_CMDS
 	$$(TARGET_MAKE_ENV) $$($$(PKG)_NINJA_ENV) DESTDIR=$$(TARGET_DIR) \
-		$$(NINJA) $$(NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/build install
+		$$(MESON) install -C \
+		  $$($$(PKG)_SRCDIR)/build $(if $(filter YES,$($(2)_MESON_INSTALL_TAGS)),--tags=runtime)
 endef
 endif