All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [RFC PATCH v2 0/8] Add pkg-meson infrastructure
@ 2018-05-15 19:51 Eric Le Bihan
  2018-05-15 19:51 ` [Buildroot] [RFC PATCH v2 1/8] pkg-meson: new infrastructure Eric Le Bihan
                   ` (8 more replies)
  0 siblings, 9 replies; 11+ messages in thread
From: Eric Le Bihan @ 2018-05-15 19:51 UTC (permalink / raw)
  To: buildroot

This series adds an infrastructure for Meson-based packages and converts the
existing ones.

v1->v2:

- drop use of package variables for program paths and options.
- fix host variant support.
- fix RPATH stripping.
- improve documentation.

Eric Le Bihan (8):
  pkg-meson: new infrastructure
  docs/manual: document pkg-meson infra
  meson: prevent RPATH stripping
  libmpdclient: convert to pkg-meson infra
  systemd: convert to pkg-meson infra
  ncmpc: convert to pkg-meson infra
  mpd-mpc: convert to pkg-meson infra
  enlightenment: convert to pkg-meson infra

 DEVELOPERS                                         |   1 +
 docs/manual/adding-packages-meson.txt              | 117 +++++++--------
 package/Makefile.in                                |   1 +
 package/enlightenment/enlightenment.mk             |  30 +---
 package/libmpdclient/libmpdclient.mk               |  32 +---
 ...y-fix-RPATH-if-install_rpath-is-not-empty.patch |  32 ++++
 package/mpd-mpc/mpd-mpc.mk                         |  26 +---
 package/ncmpc/ncmpc.mk                             |  27 +---
 package/pkg-meson.mk                               | 166 +++++++++++++++++++++
 package/systemd/systemd.mk                         |  32 +---
 10 files changed, 271 insertions(+), 193 deletions(-)
 create mode 100644 package/meson/0001-Only-fix-RPATH-if-install_rpath-is-not-empty.patch
 create mode 100644 package/pkg-meson.mk

-- 
2.14.3

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Buildroot] [RFC PATCH v2 1/8] pkg-meson: new infrastructure
  2018-05-15 19:51 [Buildroot] [RFC PATCH v2 0/8] Add pkg-meson infrastructure Eric Le Bihan
@ 2018-05-15 19:51 ` Eric Le Bihan
  2018-05-30 20:28   ` Thomas Petazzoni
  2018-05-15 19:51 ` [Buildroot] [RFC PATCH v2 2/8] docs/manual: document pkg-meson infra Eric Le Bihan
                   ` (7 subsequent siblings)
  8 siblings, 1 reply; 11+ messages in thread
From: Eric Le Bihan @ 2018-05-15 19:51 UTC (permalink / raw)
  To: buildroot

Add a new infrastructure to ease the development of packages that use Meson as
their build system.

Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
---
 DEVELOPERS           |   1 +
 package/Makefile.in  |   1 +
 package/pkg-meson.mk | 166 +++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 168 insertions(+)
 create mode 100644 package/pkg-meson.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index 43b1668343..997dc27d78 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -579,6 +579,7 @@ F:	package/hicolor-icon-theme/
 F:	package/jemalloc/
 F:	package/meson/
 F:	package/ninja/
+F:	package/pkg-meson.mk
 F:	package/rust-bin/
 F:	package/rust/
 F:	package/s6/
diff --git a/package/Makefile.in b/package/Makefile.in
index 4325f7b3a9..a268016cdf 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -447,3 +447,4 @@ include package/pkg-rebar.mk
 include package/pkg-kernel-module.mk
 include package/pkg-waf.mk
 include package/pkg-golang.mk
+include package/pkg-meson.mk
diff --git a/package/pkg-meson.mk b/package/pkg-meson.mk
new file mode 100644
index 0000000000..474417125b
--- /dev/null
+++ b/package/pkg-meson.mk
@@ -0,0 +1,166 @@
+################################################################################
+# Meson package infrastructure
+#
+# This file implements an infrastructure that eases development of
+# package .mk files for Meson packages. It should be used for all
+# packages that use Meson as their build system.
+#
+# See the Buildroot documentation for details on the usage of this
+# infrastructure
+#
+# In terms of implementation, this Meson infrastructure requires
+# the .mk file to only specify metadata information about the
+# package: name, version, download URL, etc.
+#
+# We still allow the package .mk file to override what the different
+# steps are doing, if needed. For example, if <PKG>_BUILD_CMDS is
+# already defined, it is used as the list of commands to perform to
+# build the package, instead of the default Meson behaviour. The
+# package can also define some post operation hooks.
+#
+################################################################################
+
+
+################################################################################
+# inner-meson-package -- defines how the configuration, compilation and
+# installation of a Meson package should be done, implements a few hooks to
+# tune the build process and calls the generic package infrastructure to
+# generate the necessary make targets
+#
+#  argument 1 is the lowercase package name
+#  argument 2 is the uppercase package name, including a HOST_ prefix
+#             for host packages
+#  argument 3 is the uppercase package name, without the HOST_ prefix
+#             for host packages
+#  argument 4 is the type (target or host)
+################################################################################
+
+define inner-meson-package
+
+$(2)_CONF_ENV		?=
+$(2)_CONF_OPTS		?=
+$(2)_NINJA_ENV		?=
+$(2)_SRCDIR		= $$($(2)_DIR)/$$($(2)_SUBDIR)
+
+#
+# Pass PYTHONNOUSERSITE environment variable when invoking Meson or Ninja, so
+# $(HOST_DIR)/bin/python3 will not look for Meson modules in
+# $HOME/.local/lib/python3.x/site-packages
+#
+MESON		= PYTHONNOUSERSITE=y $(HOST_DIR)/bin/meson
+NINJA		= PYTHONNOUSERSITE=y $(HOST_DIR)/bin/ninja
+NINJA_OPTS	= $(if $(VERBOSE),-v) -j$(PARALLEL_JOBS)
+
+#
+# Configure step. Only define it if not already defined by the package
+# .mk file. And take care of the differences between host and target
+# packages.
+#
+ifndef $(2)_CONFIGURE_CMDS
+ifeq ($(4),target)
+
+# Configure package for target
+#
+#
+define $(2)_CONFIGURE_CMDS
+	rm -rf $$($$(PKG)_SRCDIR)/build
+	mkdir -p $$($$(PKG)_SRCDIR)/build
+	PATH=$$(BR_PATH) $$($$(PKG)_CONF_ENV) $$(MESON) \
+		--prefix=/usr \
+		--libdir=lib \
+		--default-library=$(if $(BR2_STATIC_LIBS),static,shared) \
+		--buildtype=$(if $(BR2_ENABLE_DEBUG),debug,release) \
+		--cross-file=$(HOST_DIR)/etc/meson/cross-compilation.conf \
+		$$($$(PKG)_CONF_OPTS) \
+		$$($$(PKG)_SRCDIR) $$($$(PKG)_SRCDIR)/build
+endef
+else
+
+# Configure package for host
+define $(2)_CONFIGURE_CMDS
+	rm -rf $$($$(PKG)_SRCDIR)/build
+	mkdir -p $$($$(PKG)_SRCDIR)/build
+	$$(HOST_CONFIGURE_OPTS) \
+	$$($$(PKG)_CONF_ENV) $$(MESON) \
+		--prefix="$$(HOST_DIR)" \
+		--libdir=lib \
+		--sysconfdir="$$(HOST_DIR)/etc" \
+		--localstatedir="$$(HOST_DIR)/var" \
+		--default-library=shared \
+		--buildtype=release \
+		$$($$(PKG)_CONF_OPTS) \
+		$$($$(PKG)_SRCDIR) $$($$(PKG)_SRCDIR)/build
+endef
+endif
+endif
+
+$(2)_DEPENDENCIES += host-meson
+
+#
+# Build step. Only define it if not already defined by the package .mk
+# file.
+#
+ifndef $(2)_BUILD_CMDS
+ifeq ($(4),target)
+define $(2)_BUILD_CMDS
+	$$(TARGET_MAKE_ENV) $$($$(PKG)_NINJA_ENV) \
+		$$(NINJA) $$(NINJA_OPTS) \
+		-C $$($$(PKG)_SRCDIR)/build
+endef
+else
+define $(2)_BUILD_CMDS
+	$$(HOST_MAKE_ENV) $$($$(PKG)_NINJA_ENV) \
+		$$(NINJA) $$(NINJA_OPTS) \
+		-C $$($$(PKG)_SRCDIR)/build
+endef
+endif
+endif
+
+#
+# Host installation step. Only define it if not already defined by the
+# package .mk file.
+#
+ifndef $(2)_INSTALL_CMDS
+define $(2)_INSTALL_CMDS
+	$$(HOST_MAKE_ENV) $$($$(PKG)_NINJA_ENV) \
+		$$(NINJA) $$(NINJA_OPTS) \
+		-C $$($$(PKG)_SRCDIR)/build install
+endef
+endif
+
+#
+# Staging installation step. Only define it if not already defined by
+# the package .mk file.
+#
+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
+endef
+endif
+
+#
+# Target installation step. Only define it if not already defined by
+# the package .mk file.
+#
+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
+endef
+endif
+
+# Call the generic package infrastructure to generate the necessary
+# make targets
+$(call inner-generic-package,$(1),$(2),$(3),$(4))
+
+endef
+
+################################################################################
+# meson-package -- the target generator macro for Meson packages
+################################################################################
+
+meson-package = $(call inner-meson-package,$(pkgname),$(call UPPERCASE,$(pkgname)),$(call UPPERCASE,$(pkgname)),target)
+host-meson-package = $(call inner-meson-package,host-$(pkgname),$(call UPPERCASE,host-$(pkgname)),$(call UPPERCASE,$(pkgname)),host)
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Buildroot] [RFC PATCH v2 2/8] docs/manual: document pkg-meson infra
  2018-05-15 19:51 [Buildroot] [RFC PATCH v2 0/8] Add pkg-meson infrastructure Eric Le Bihan
  2018-05-15 19:51 ` [Buildroot] [RFC PATCH v2 1/8] pkg-meson: new infrastructure Eric Le Bihan
@ 2018-05-15 19:51 ` Eric Le Bihan
  2018-05-15 19:51 ` [Buildroot] [RFC PATCH v2 3/8] meson: prevent RPATH stripping Eric Le Bihan
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Eric Le Bihan @ 2018-05-15 19:51 UTC (permalink / raw)
  To: buildroot

Update documentation about adding meson-based packages with instructions for
using pkg-meson infrastructure.

Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
---
 docs/manual/adding-packages-meson.txt | 117 ++++++++++++++++------------------
 1 file changed, 56 insertions(+), 61 deletions(-)

diff --git a/docs/manual/adding-packages-meson.txt b/docs/manual/adding-packages-meson.txt
index f8aa08fa91..c52fe10506 100644
--- a/docs/manual/adding-packages-meson.txt
+++ b/docs/manual/adding-packages-meson.txt
@@ -1,18 +1,18 @@
 // -*- mode:doc; -*-
 // vim: set syntax=asciidoc:
 
-=== Integration of Meson-based packages
+=== Infrastructure for Meson-based packages
 
 [[meson-package-tutorial]]
 
 ==== +meson-package+ tutorial
 
 http://mesonbuild.com[Meson] is an open source build system meant to be both
-extremely fast, and, even more importantly, as user friendly as possible.
+extremely fast, and, even more importantly, as user friendly as possible. It
+uses https://ninja-build.org[Ninja] as a companion tool to perform the actual
+build operations.
 
-Buildroot does not (yet) provide a dedicated package infrastructure for
-meson-based packages. So, we will explain how to write a +.mk+ file for such a
-package. Let's start with an example:
+Let's see how to write a +.mk+ file for a Meson-based package, with an example:
 
 ------------------------------
 01: ################################################################################
@@ -28,74 +28,69 @@ package. Let's start with an example:
 11: FOO_LICENSE_FILES = COPYING
 12: FOO_INSTALL_STAGING = YES
 13:
-14: FOO_DEPENDENCIES = host-meson host-pkgconf bar
+14: FOO_DEPENDENCIES = host-pkgconf bar
 15:
-16: FOO_CONF_OPTS += \
-17: 	--prefix=/usr \
-18: 	--buildtype $(if $(BR2_ENABLE_DEBUG),debug,release) \
-19: 	--cross-file $(HOST_DIR)/etc/meson/cross-compilation.conf
-20:
-21: FOO_NINJA_OPTS = $(if $(VERBOSE),-v) -j$(PARALLEL_JOBS)
+16: ifeq ($(BR2_PACKAGE_BAZ),y)
+17: FOO_CONF_OPTS += -Dbaz=true
+18: FOO_DEPENDENCIES += baz
+19: else
+20: FOO_CONF_OPTS += -Dbaz=false
+21: endif
 22:
-23: ifeq ($(BR2_PACKAGE_BAZ),y)
-24: FOO_CONF_OPTS += -Dbaz
-25: endif
-26:
-27: define FOO_CONFIGURE_CMDS
-28: 	rm -rf $(@D)/build
-29: 	mkdir -p $(@D)/build
-30: 	$(TARGET_MAKE_ENV) meson $(FOO_CONF_OPTS) $(@D) $(@D)/build
-31: endef
-32:
-33: define FOO_BUILD_CMDS
-34: 	$(TARGET_MAKE_ENV) ninja $(FOO_NINJA_OPTS) -C $(@D)/build
-35: endef
-36:
-37: define FOO_INSTALL_TARGET_CMDS
-38: 	$(TARGET_MAKE_ENV) DESTDIR=$(TARGET_DIR) ninja $(FOO_NINJA_OPTS) \
-39: 		-C $(@D)/build install
-40: endef
-41:
-42: define FOO_INSTALL_STAGING_CMDS
-43: 	$(TARGET_MAKE_ENV) DESTDIR=$(STAGING_DIR) ninja $(FOO_NINJA_OPTS) \
-44: 		-C $(@D)/build install
-45: endef
-46:
-47: $(eval $(generic-package))
+23: $(eval $(meson-package))
 --------------------------------
 
 The Makefile starts with the definition of the standard variables for package
 declaration (lines 7 to 11).
 
-As seen in line 47, it is based on the
-xref:generic-package-tutorial[+generic-package+ infrastructure]. So, it defines
-the variables required by this particular infrastructure, where Meson and its
-companion tool, Ninja, are invoked:
+On line line 23, we invoke the +meson-package+ macro that generates all the
+Makefile rules that actually allows the package to be built.
 
-* +FOO_CONFIGURE_CMDS+: the build directory required by Meson is created, and
-  Meson is invoked to generate the Ninja build file. The options required to
-  configure the cross-compilation of the package are passed via
-  +FOO_CONF_OPTS+.
+In the example, +host-pkgconf+ and +bar+ are declared as dependencies in
++FOO_DEPENDENCIES+ at line 14 because the Meson build file of +foo+ uses
+`pkg-config` to determine the compilation flags and libraries of package +bar+.
 
-* +FOO_BUILD_CMDS+: Ninja is invoked to perform the build.
+Note that it is not necessary to add +host-meson+ in the +FOO_DEPENDENCIES+
+variable of a package, since this basic dependency is automatically added as
+needed by the Meson package infrastructure.
 
-* +FOO_INSTALL_TARGET_CMDS+: Ninja is invoked to install the files generated
-  during the build step in the target directory.
-
-* +FOO_INSTALL_STAGING_CMDS+: Ninja is invoked to install the files generated
-  during the build step in the staging directory, as +FOO_INSTALL_STAGING+ is
-  set to "YES".
-
-In order to have Meson available for the build, +FOO_DEPENDENCIES+ needs to
-contain +host-meson+. In the example, +host-pkgconf+ and +bar+ are also
-declared as dependencies because the Meson build file of +foo+ uses `pkg-config`
-to determine the compilation flags and libraries of package +bar+.
-
-If the "baz" package is selected, then support for the "baz" feature in "foo"
-is activated by adding +-Dbaz+ to +FOO_CONF_OPTS+, as specified in the
-+meson_options.txt+ file in "foo" source tree.
+If the "baz" package is selected, then support for the "baz" feature in "foo" is
+activated by adding +-Dbaz=true+ to +FOO_CONF_OPTS+ at line 17, as specified in
+the +meson_options.txt+ file in "foo" source tree. The "baz" package is also
+added to +FOO_DEPENDENCIES+. Note that the support for +baz+ is explicitly
+disabled at line 20, if the package is not selected.
 
 To sum it up, to add a new meson-based package, the Makefile example can be
 copied verbatim then edited to replace all occurences of +FOO+ with the
 uppercase name of the new package and update the values of the standard
 variables.
+
+[[meson-package-reference]]
+
+==== +meson-package+ reference
+
+The main macro of the Meson package infrastructure is +meson-package+. It is
+similar to the +generic-package+ macro. The ability to have target and host
+packages is also available, with the +host-meson-package+ macro.
+
+Just like the generic infrastructure, the Meson infrastructure works by defining
+a number of variables before calling the +meson-package+ macro.
+
+First, all the package metadata information variables that exist in the generic
+infrastructure also exist in the Meson infrastructure: +FOO_VERSION+,
++FOO_SOURCE+, +FOO_PATCH+, +FOO_SITE+, +FOO_SUBDIR+, +FOO_DEPENDENCIES+,
++FOO_INSTALL_STAGING+, +FOO_INSTALL_TARGET+.
+
+A few additional variables, specific to the Meson infrastructure, can also be
+defined. Many of them are only useful in very specific cases, typical packages
+will therefore only use a few of them.
+
+* +FOO_CONF_ENV+, to specify additional environment variables to pass to
+  +meson+ for the configuration step. By default, empty.
+
+* +FOO_CONF_OPTS+, to specify additional options to pass to +meson+ for the
+  configuration step. By default, empty.
+
+* +FOO_NINJA_ENV+, to specify additional environment variables to pass to
+  +ninja+, meson companion tool in charge of the build operations. By default,
+  empty.
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Buildroot] [RFC PATCH v2 3/8] meson: prevent RPATH stripping
  2018-05-15 19:51 [Buildroot] [RFC PATCH v2 0/8] Add pkg-meson infrastructure Eric Le Bihan
  2018-05-15 19:51 ` [Buildroot] [RFC PATCH v2 1/8] pkg-meson: new infrastructure Eric Le Bihan
  2018-05-15 19:51 ` [Buildroot] [RFC PATCH v2 2/8] docs/manual: document pkg-meson infra Eric Le Bihan
@ 2018-05-15 19:51 ` Eric Le Bihan
  2018-05-15 19:51 ` [Buildroot] [RFC PATCH v2 4/8] libmpdclient: convert to pkg-meson infra Eric Le Bihan
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Eric Le Bihan @ 2018-05-15 19:51 UTC (permalink / raw)
  To: buildroot

By default, Meson strips RPATH from the executable it builds [1,2],
unless explicitly set via install_rpath.

This will make support/scripts/check-host-rpath fail when building the
host variant of a Meson-based package.

So add a patch to prevent RPATH from being stripped if install_rpath is
not set and notify user about it.

[1] https://github.com/mesonbuild/meson/issues/2567
[2] https://github.com/mesonbuild/meson/issues/314#issuecomment-157658562

Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
---
 ...y-fix-RPATH-if-install_rpath-is-not-empty.patch | 32 ++++++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 package/meson/0001-Only-fix-RPATH-if-install_rpath-is-not-empty.patch

diff --git a/package/meson/0001-Only-fix-RPATH-if-install_rpath-is-not-empty.patch b/package/meson/0001-Only-fix-RPATH-if-install_rpath-is-not-empty.patch
new file mode 100644
index 0000000000..03c1944258
--- /dev/null
+++ b/package/meson/0001-Only-fix-RPATH-if-install_rpath-is-not-empty.patch
@@ -0,0 +1,32 @@
+From 53e4920038d5562b7b672fec8b9469fc02eef4ad Mon Sep 17 00:00:00 2001
+From: Eric Le Bihan <eric.le.bihan.dev@free.fr>
+Date: Thu, 10 May 2018 21:57:49 +0200
+Subject: [PATCH] Only fix RPATH if install_rpath is not empty
+
+Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
+---
+ mesonbuild/scripts/meson_install.py | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/mesonbuild/scripts/meson_install.py b/mesonbuild/scripts/meson_install.py
+index 013f2a00..f7ff1dcc 100644
+--- a/mesonbuild/scripts/meson_install.py
++++ b/mesonbuild/scripts/meson_install.py
+@@ -368,7 +368,13 @@ def install_targets(d):
+                     printed_symlink_error = True
+         if os.path.isfile(outname):
+             try:
+-                depfixer.fix_rpath(outname, install_rpath, False)
++                # Buildroot check-host-rpath script expects RPATH
++                # But if install_rpath is empty, it will stripped.
++                # So, preserve it in this case
++                if install_rpath:
++                    depfixer.fix_rpath(outname, install_rpath, False)
++                else:
++                    print("Skipping RPATH fixing")
+             except SystemExit as e:
+                 if isinstance(e.code, int) and e.code == 0:
+                     pass
+-- 
+2.14.3
+
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Buildroot] [RFC PATCH v2 4/8] libmpdclient: convert to pkg-meson infra
  2018-05-15 19:51 [Buildroot] [RFC PATCH v2 0/8] Add pkg-meson infrastructure Eric Le Bihan
                   ` (2 preceding siblings ...)
  2018-05-15 19:51 ` [Buildroot] [RFC PATCH v2 3/8] meson: prevent RPATH stripping Eric Le Bihan
@ 2018-05-15 19:51 ` Eric Le Bihan
  2018-05-15 19:51 ` [Buildroot] [RFC PATCH v2 5/8] systemd: " Eric Le Bihan
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Eric Le Bihan @ 2018-05-15 19:51 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
---
 package/libmpdclient/libmpdclient.mk | 32 +-------------------------------
 1 file changed, 1 insertion(+), 31 deletions(-)

diff --git a/package/libmpdclient/libmpdclient.mk b/package/libmpdclient/libmpdclient.mk
index 6ff27241c0..c04536eb88 100644
--- a/package/libmpdclient/libmpdclient.mk
+++ b/package/libmpdclient/libmpdclient.mk
@@ -11,35 +11,5 @@ LIBMPDCLIENT_SITE = http://www.musicpd.org/download/libmpdclient/$(LIBMPDCLIENT_
 LIBMPDCLIENT_INSTALL_STAGING = YES
 LIBMPDCLIENT_LICENSE = BSD-3-Clause
 LIBMPDCLIENT_LICENSE_FILES = COPYING
-LIBMPDCLIENT_DEPENDENCIES = host-meson
 
-LIBMPDCLIENT_CONF_OPTS += \
-	--prefix=/usr \
-	--libdir=/usr/lib \
-	--default-library $(if $(BR2_STATIC_LIBS),static,shared) \
-	--buildtype $(if $(BR2_ENABLE_DEBUG),debug,release) \
-	--cross-file $(HOST_DIR)/etc/meson/cross-compilation.conf
-
-LIBMPDCLIENT_NINJA_OPTS = $(if $(VERBOSE),-v) -j$(PARALLEL_JOBS)
-
-define LIBMPDCLIENT_CONFIGURE_CMDS
-	rm -rf $(@D)/build
-	mkdir -p $(@D)/build
-	$(TARGET_MAKE_ENV) meson $(LIBMPDCLIENT_CONF_OPTS) $(@D) $(@D)/build
-endef
-
-define LIBMPDCLIENT_BUILD_CMDS
-	$(TARGET_MAKE_ENV) ninja $(LIBMPDCLIENT_NINJA_OPTS) -C $(@D)/build
-endef
-
-define LIBMPDCLIENT_INSTALL_TARGET_CMDS
-	$(TARGET_MAKE_ENV) DESTDIR=$(TARGET_DIR) \
-		ninja $(LIBMPDCLIENT_NINJA_OPTS) -C $(@D)/build install
-endef
-
-define LIBMPDCLIENT_INSTALL_STAGING_CMDS
-	$(TARGET_MAKE_ENV) DESTDIR=$(STAGING_DIR) \
-		ninja $(LIBMPDCLIENT_NINJA_OPTS) -C $(@D)/build install
-endef
-
-$(eval $(generic-package))
+$(eval $(meson-package))
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Buildroot] [RFC PATCH v2 5/8] systemd: convert to pkg-meson infra
  2018-05-15 19:51 [Buildroot] [RFC PATCH v2 0/8] Add pkg-meson infrastructure Eric Le Bihan
                   ` (3 preceding siblings ...)
  2018-05-15 19:51 ` [Buildroot] [RFC PATCH v2 4/8] libmpdclient: convert to pkg-meson infra Eric Le Bihan
@ 2018-05-15 19:51 ` Eric Le Bihan
  2018-05-15 19:51 ` [Buildroot] [RFC PATCH v2 6/8] ncmpc: " Eric Le Bihan
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Eric Le Bihan @ 2018-05-15 19:51 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
---
 package/systemd/systemd.mk | 32 +++-----------------------------
 1 file changed, 3 insertions(+), 29 deletions(-)

diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk
index db7fb43636..c52e4923a0 100644
--- a/package/systemd/systemd.mk
+++ b/package/systemd/systemd.mk
@@ -12,7 +12,6 @@ SYSTEMD_INSTALL_STAGING = YES
 SYSTEMD_DEPENDENCIES = \
 	host-gperf \
 	host-intltool \
-	host-meson \
 	kmod \
 	libcap \
 	util-linux
@@ -26,10 +25,6 @@ SYSTEMD_DEPENDENCIES += busybox
 endif
 
 SYSTEMD_CONF_OPTS += \
-	--prefix=/usr \
-	--libdir='/usr/lib' \
-	--buildtype $(if $(BR2_ENABLE_DEBUG),debug,release) \
-	--cross-file $(HOST_DIR)/etc/meson/cross-compilation.conf \
 	-Drootlibdir='/usr/lib' \
 	-Dblkid=true \
 	-Dman=false \
@@ -399,28 +394,7 @@ define SYSTEMD_INSTALL_INIT_SYSTEMD
 	$(SYSTEMD_INSTALL_NETWORK_CONFS)
 endef
 
-SYSTEMD_NINJA_OPTS = $(if $(VERBOSE),-v) -j$(PARALLEL_JOBS)
+SYSTEMD_CONF_ENV = $(HOST_UTF8_LOCALE_ENV)
+SYSTEMD_NINJA_ENV = $(HOST_UTF8_LOCALE_ENV)
 
-SYSTEMD_ENV = $(TARGET_MAKE_ENV) $(HOST_UTF8_LOCALE_ENV)
-
-define SYSTEMD_CONFIGURE_CMDS
-	rm -rf $(@D)/build
-	mkdir -p $(@D)/build
-	$(SYSTEMD_ENV) meson $(SYSTEMD_CONF_OPTS) $(@D) $(@D)/build
-endef
-
-define SYSTEMD_BUILD_CMDS
-	$(SYSTEMD_ENV) ninja $(SYSTEMD_NINJA_OPTS) -C $(@D)/build
-endef
-
-define SYSTEMD_INSTALL_TARGET_CMDS
-	$(SYSTEMD_ENV) DESTDIR=$(TARGET_DIR) ninja $(SYSTEMD_NINJA_OPTS) \
-		-C $(@D)/build install
-endef
-
-define SYSTEMD_INSTALL_STAGING_CMDS
-	$(SYSTEMD_ENV) DESTDIR=$(STAGING_DIR) ninja $(SYSTEMD_NINJA_OPTS) \
-		-C $(@D)/build install
-endef
-
-$(eval $(generic-package))
+$(eval $(meson-package))
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Buildroot] [RFC PATCH v2 6/8] ncmpc: convert to pkg-meson infra
  2018-05-15 19:51 [Buildroot] [RFC PATCH v2 0/8] Add pkg-meson infrastructure Eric Le Bihan
                   ` (4 preceding siblings ...)
  2018-05-15 19:51 ` [Buildroot] [RFC PATCH v2 5/8] systemd: " Eric Le Bihan
@ 2018-05-15 19:51 ` Eric Le Bihan
  2018-05-15 19:51 ` [Buildroot] [RFC PATCH v2 7/8] mpd-mpc: " Eric Le Bihan
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Eric Le Bihan @ 2018-05-15 19:51 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
---
 package/ncmpc/ncmpc.mk | 27 +++------------------------
 1 file changed, 3 insertions(+), 24 deletions(-)

diff --git a/package/ncmpc/ncmpc.mk b/package/ncmpc/ncmpc.mk
index 1d464b72de..d70ed46ea9 100644
--- a/package/ncmpc/ncmpc.mk
+++ b/package/ncmpc/ncmpc.mk
@@ -8,15 +8,11 @@ NCMPC_VERSION_MAJOR = 0
 NCMPC_VERSION = $(NCMPC_VERSION_MAJOR).29
 NCMPC_SOURCE = ncmpc-$(NCMPC_VERSION).tar.xz
 NCMPC_SITE = http://www.musicpd.org/download/ncmpc/$(NCMPC_VERSION_MAJOR)
-NCMPC_DEPENDENCIES = host-meson host-pkgconf libglib2 libmpdclient ncurses
+NCMPC_DEPENDENCIES = host-pkgconf libglib2 libmpdclient ncurses
 NCMPC_LICENSE = GPL-2.0+
 NCMPC_LICENSE_FILES = COPYING
 
-NCMPC_CONF_OPTS += \
-	--prefix=/usr \
-	-Dcurses=ncurses \
-	--buildtype $(if $(BR2_ENABLE_DEBUG),debug,release) \
-	--cross-file $(HOST_DIR)/etc/meson/cross-compilation.conf
+NCMPC_CONF_OPTS = -Dcurses=ncurses
 
 ifeq ($(BR2_PACKAGE_LIRC_TOOLS),y)
 NCMPC_DEPENDENCIES += lirc-tools
@@ -25,21 +21,4 @@ else
 NCMPC_CONF_OPTS += -Dlirc=false
 endif
 
-NCMPC_NINJA_OPTS = $(if $(VERBOSE),-v)
-
-define NCMPC_CONFIGURE_CMDS
-	rm -rf $(@D)/build
-	mkdir -p $(@D)/build
-	$(TARGET_MAKE_ENV) meson $(NCMPC_CONF_OPTS) $(@D) $(@D)/build
-endef
-
-define NCMPC_BUILD_CMDS
-	$(TARGET_MAKE_ENV) ninja $(NCMPC_NINJA_OPTS) -C $(@D)/build
-endef
-
-define NCMPC_INSTALL_TARGET_CMDS
-	$(TARGET_MAKE_ENV) DESTDIR=$(TARGET_DIR) \
-		ninja $(NCMPC_NINJA_OPTS) -C $(@D)/build install
-endef
-
-$(eval $(generic-package))
+$(eval $(meson-package))
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Buildroot] [RFC PATCH v2 7/8] mpd-mpc: convert to pkg-meson infra
  2018-05-15 19:51 [Buildroot] [RFC PATCH v2 0/8] Add pkg-meson infrastructure Eric Le Bihan
                   ` (5 preceding siblings ...)
  2018-05-15 19:51 ` [Buildroot] [RFC PATCH v2 6/8] ncmpc: " Eric Le Bihan
@ 2018-05-15 19:51 ` Eric Le Bihan
  2018-05-15 19:51 ` [Buildroot] [RFC PATCH v2 8/8] enlightenment: " Eric Le Bihan
  2018-05-30 20:27 ` [Buildroot] [RFC PATCH v2 0/8] Add pkg-meson infrastructure Thomas Petazzoni
  8 siblings, 0 replies; 11+ messages in thread
From: Eric Le Bihan @ 2018-05-15 19:51 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
---
 package/mpd-mpc/mpd-mpc.mk | 26 ++------------------------
 1 file changed, 2 insertions(+), 24 deletions(-)

diff --git a/package/mpd-mpc/mpd-mpc.mk b/package/mpd-mpc/mpd-mpc.mk
index 942530a561..0666339ff9 100644
--- a/package/mpd-mpc/mpd-mpc.mk
+++ b/package/mpd-mpc/mpd-mpc.mk
@@ -10,28 +10,6 @@ MPD_MPC_SITE = http://www.musicpd.org/download/mpc/$(MPD_MPC_VERSION_MAJOR)
 MPD_MPC_SOURCE = mpc-$(MPD_MPC_VERSION).tar.xz
 MPD_MPC_LICENSE = GPL-2.0+
 MPD_MPC_LICENSE_FILES = COPYING
-MPD_MPC_DEPENDENCIES = host-meson host-pkgconf libmpdclient
+MPD_MPC_DEPENDENCIES = host-pkgconf libmpdclient
 
-MPD_MPC_CONF_OPTS += \
-	--prefix=/usr \
-	--buildtype $(if $(BR2_ENABLE_DEBUG),debug,release) \
-	--cross-file $(HOST_DIR)/etc/meson/cross-compilation.conf
-
-MPD_MPC_NINJA_OPTS = $(if $(VERBOSE),-v) -j$(PARALLEL_JOBS)
-
-define MPD_MPC_CONFIGURE_CMDS
-	rm -rf $(@D)/build
-	mkdir -p $(@D)/build
-	$(TARGET_MAKE_ENV) meson $(MPD_MPC_CONF_OPTS) $(@D) $(@D)/build
-endef
-
-define MPD_MPC_BUILD_CMDS
-	$(TARGET_MAKE_ENV) ninja $(MPD_MPC_NINJA_OPTS) -C $(@D)/build
-endef
-
-define MPD_MPC_INSTALL_TARGET_CMDS
-	$(TARGET_MAKE_ENV) DESTDIR=$(TARGET_DIR) ninja $(MPD_MPC_NINJA_OPTS) \
-		-C $(@D)/build install
-endef
-
-$(eval $(generic-package))
+$(eval $(meson-package))
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Buildroot] [RFC PATCH v2 8/8] enlightenment: convert to pkg-meson infra
  2018-05-15 19:51 [Buildroot] [RFC PATCH v2 0/8] Add pkg-meson infrastructure Eric Le Bihan
                   ` (6 preceding siblings ...)
  2018-05-15 19:51 ` [Buildroot] [RFC PATCH v2 7/8] mpd-mpc: " Eric Le Bihan
@ 2018-05-15 19:51 ` Eric Le Bihan
  2018-05-30 20:27 ` [Buildroot] [RFC PATCH v2 0/8] Add pkg-meson infrastructure Thomas Petazzoni
  8 siblings, 0 replies; 11+ messages in thread
From: Eric Le Bihan @ 2018-05-15 19:51 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
---
 package/enlightenment/enlightenment.mk | 30 ++++++------------------------
 1 file changed, 6 insertions(+), 24 deletions(-)

diff --git a/package/enlightenment/enlightenment.mk b/package/enlightenment/enlightenment.mk
index 480e9e9da8..5bc1c5d6de 100644
--- a/package/enlightenment/enlightenment.mk
+++ b/package/enlightenment/enlightenment.mk
@@ -13,14 +13,10 @@ ENLIGHTENMENT_LICENSE_FILES = COPYING
 ENLIGHTENMENT_DEPENDENCIES = \
 	host-pkgconf \
 	host-efl \
-	host-meson \
 	efl \
 	xcb-util-keysyms
 
-ENLIGHTENMENT_MESON_OPTS += \
-	--prefix=/usr \
-	--buildtype=$(if $(BR2_ENABLE_DEBUG),debug,release) \
-	--cross-file=$(HOST_DIR)/etc/meson/cross-compilation.conf \
+ENLIGHTENMENT_CONF_OPTS = \
 	-Dedje-cc=$(HOST_DIR)/bin/edje_cc \
 	-Deet=$(HOST_DIR)/bin/eet \
 	-Deldbus-codegen=$(HOST_DIR)/bin/eldbus-codegen \
@@ -30,38 +26,24 @@ ENLIGHTENMENT_MESON_OPTS += \
 ENLIGHTENMENT_INSTALL_STAGING = YES
 
 ifeq ($(BR2_PACKAGE_SYSTEMD),y)
-ENLIGHTENMENT_MESON_OPTS += -Dsystemd=true
+ENLIGHTENMENT_CONF_OPTS += -Dsystemd=true
 ENLIGHTENMENT_DEPENDENCIES += systemd
 else
-ENLIGHTENMENT_MESON_OPTS += -Dsystemd=false
+ENLIGHTENMENT_CONF_OPTS += -Dsystemd=false
 endif
 
 # alsa backend needs mixer support
 ifeq ($(BR2_PACKAGE_ALSA_LIB)$(BR2_PACKAGE_ALSA_LIB_MIXER),yy)
-ENLIGHTENMENT_MESON_OPTS += -Dmixer=true
+ENLIGHTENMENT_CONF_OPTS += -Dmixer=true
 ENLIGHTENMENT_DEPENDENCIES += alsa-lib
 else
-ENLIGHTENMENT_MESON_OPTS += -Dmixer=false
+ENLIGHTENMENT_CONF_OPTS += -Dmixer=false
 endif
 
 ifeq ($(BR2_PACKAGE_XKEYBOARD_CONFIG),y)
 ENLIGHTENMENT_DEPENDENCIES += xkeyboard-config
 endif
 
-define ENLIGHTENMENT_CONFIGURE_CMDS
-	rm -rf $(@D)/build
-	mkdir -p $(@D)/build
-	$(TARGET_MAKE_ENV) meson $(ENLIGHTENMENT_MESON_OPTS) $(@D) $(@D)/build
-endef
-
-define ENLIGHTENMENT_BUILD_CMDS
-	$(TARGET_MAKE_ENV) ninja -C $(@D)/build
-endef
-
-define ENLIGHTENMENT_INSTALL_TARGET_CMDS
-	$(TARGET_MAKE_ENV) DESTDIR=$(TARGET_DIR) ninja -C $(@D)/build install
-endef
-
 define ENLIGHTENMENT_REMOVE_DOCUMENTATION
 	rm -rf $(TARGET_DIR)/usr/share/enlightenment/doc/
 	rm -f $(TARGET_DIR)/usr/share/enlightenment/COPYING
@@ -69,4 +51,4 @@ define ENLIGHTENMENT_REMOVE_DOCUMENTATION
 endef
 ENLIGHTENMENT_POST_INSTALL_TARGET_HOOKS += ENLIGHTENMENT_REMOVE_DOCUMENTATION
 
-$(eval $(generic-package))
+$(eval $(meson-package))
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Buildroot] [RFC PATCH v2 0/8] Add pkg-meson infrastructure
  2018-05-15 19:51 [Buildroot] [RFC PATCH v2 0/8] Add pkg-meson infrastructure Eric Le Bihan
                   ` (7 preceding siblings ...)
  2018-05-15 19:51 ` [Buildroot] [RFC PATCH v2 8/8] enlightenment: " Eric Le Bihan
@ 2018-05-30 20:27 ` Thomas Petazzoni
  8 siblings, 0 replies; 11+ messages in thread
From: Thomas Petazzoni @ 2018-05-30 20:27 UTC (permalink / raw)
  To: buildroot

Hello,

On Tue, 15 May 2018 21:51:51 +0200, Eric Le Bihan wrote:

> Eric Le Bihan (8):
>   pkg-meson: new infrastructure
>   docs/manual: document pkg-meson infra
>   meson: prevent RPATH stripping
>   libmpdclient: convert to pkg-meson infra
>   systemd: convert to pkg-meson infra
>   ncmpc: convert to pkg-meson infra
>   mpd-mpc: convert to pkg-meson infra
>   enlightenment: convert to pkg-meson infra

Thanks, I've applied this patch series to the next branch. I've made a
few changes on PATCH 1/8, I'll comment on this patch.

Thanks a lot for this work!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Buildroot] [RFC PATCH v2 1/8] pkg-meson: new infrastructure
  2018-05-15 19:51 ` [Buildroot] [RFC PATCH v2 1/8] pkg-meson: new infrastructure Eric Le Bihan
@ 2018-05-30 20:28   ` Thomas Petazzoni
  0 siblings, 0 replies; 11+ messages in thread
From: Thomas Petazzoni @ 2018-05-30 20:28 UTC (permalink / raw)
  To: buildroot

Hello,

On Tue, 15 May 2018 21:51:52 +0200, Eric Le Bihan wrote:
> Add a new infrastructure to ease the development of packages that use Meson as
> their build system.
> 
> Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>

As I said, I've applied to next, with the following changes:

    [Thomas:
     - move global variables definition outside of the inner-meson-package
       macro
     - for consistency, remove double quote around value passed to meson
       in the host configure step.
     - minor formatting fixes.]

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-05-30 20:28 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-15 19:51 [Buildroot] [RFC PATCH v2 0/8] Add pkg-meson infrastructure Eric Le Bihan
2018-05-15 19:51 ` [Buildroot] [RFC PATCH v2 1/8] pkg-meson: new infrastructure Eric Le Bihan
2018-05-30 20:28   ` Thomas Petazzoni
2018-05-15 19:51 ` [Buildroot] [RFC PATCH v2 2/8] docs/manual: document pkg-meson infra Eric Le Bihan
2018-05-15 19:51 ` [Buildroot] [RFC PATCH v2 3/8] meson: prevent RPATH stripping Eric Le Bihan
2018-05-15 19:51 ` [Buildroot] [RFC PATCH v2 4/8] libmpdclient: convert to pkg-meson infra Eric Le Bihan
2018-05-15 19:51 ` [Buildroot] [RFC PATCH v2 5/8] systemd: " Eric Le Bihan
2018-05-15 19:51 ` [Buildroot] [RFC PATCH v2 6/8] ncmpc: " Eric Le Bihan
2018-05-15 19:51 ` [Buildroot] [RFC PATCH v2 7/8] mpd-mpc: " Eric Le Bihan
2018-05-15 19:51 ` [Buildroot] [RFC PATCH v2 8/8] enlightenment: " Eric Le Bihan
2018-05-30 20:27 ` [Buildroot] [RFC PATCH v2 0/8] Add pkg-meson infrastructure Thomas Petazzoni

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.