* [Buildroot] [PATCH v2 0/3] Add support for Meson build
@ 2017-07-27 9:55 Jörg Krause
2017-07-27 9:55 ` [Buildroot] [PATCH v3 1/3] meson: new package Jörg Krause
` (2 more replies)
0 siblings, 3 replies; 12+ messages in thread
From: Jörg Krause @ 2017-07-27 9:55 UTC (permalink / raw)
To: buildroot
Last year, Eric Le Bihan already proposed patches to support the Meson build
system [1], but the patches were rejected, as no package in Buildroot
required a Meson build.
This has changed, as the libmpdclient package has switched from autotools to
Meson.
Therefore, the patches from Eric are resubmitted with some changes as suggested
by Yann E. Morin.
[1] http://patchwork.ozlabs.org/patch/646685/
Eric Le Bihan (2):
meson: new package
docs/manual: document meson-based packages
J?rg Krause (1):
libmpdclient: bump to version 2.13
docs/manual/adding-packages-meson.txt | 80 +++++++++++++++++++++++++++++++++
docs/manual/adding-packages.txt | 2 +
package/libmpdclient/libmpdclient.hash | 4 +-
package/libmpdclient/libmpdclient.mk | 26 +++++++++--
package/meson/cross-compilation.conf.in | 15 +++++++
package/meson/meson.hash | 2 +
package/meson/meson.mk | 31 +++++++++++++
7 files changed, 155 insertions(+), 5 deletions(-)
create mode 100644 docs/manual/adding-packages-meson.txt
create mode 100644 package/meson/cross-compilation.conf.in
create mode 100644 package/meson/meson.hash
create mode 100644 package/meson/meson.mk
--
2.13.3
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Buildroot] [PATCH v3 1/3] meson: new package
2017-07-27 9:55 [Buildroot] [PATCH v2 0/3] Add support for Meson build Jörg Krause
@ 2017-07-27 9:55 ` Jörg Krause
2017-10-08 10:17 ` Yann E. MORIN
2017-10-20 19:45 ` Peter Seiderer
2017-07-27 9:55 ` [Buildroot] [PATCH v3 2/3] docs/manual: document meson-based packages Jörg Krause
2017-07-27 9:55 ` [Buildroot] [PATCH v2 3/3] libmpdclient: bump to version 2.13 Jörg Krause
2 siblings, 2 replies; 12+ messages in thread
From: Jörg Krause @ 2017-07-27 9:55 UTC (permalink / raw)
To: buildroot
From: Eric Le Bihan <eric.le.bihan.dev@free.fr>
This new package provides the host variant of the Meson Build System, an
open source build system meant to be both extremely fast, and as user
friendly as possible.
More precisely, Meson creates configuration files for the Ninja build
system.
Besides building Meson, it generates a configuration file
("$(HOST_DIR)/etc/meson/cross-compilation.conf") to be used when
cross-compiling a Meson-based project.
Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
[J?rg Krause:
* bump to version 0.41.2
* use explicit tarball release instead of github helper
* use explicit sed
* pass BR2_GCC_TARGET_CPU to cross file]
Signed-off-by: J?rg Krause <joerg.krause@embedded.rocks>
---
v3:
* fix missing mkdir
---
package/meson/cross-compilation.conf.in | 15 +++++++++++++++
package/meson/meson.hash | 2 ++
package/meson/meson.mk | 31 +++++++++++++++++++++++++++++++
3 files changed, 48 insertions(+)
create mode 100644 package/meson/cross-compilation.conf.in
create mode 100644 package/meson/meson.hash
create mode 100644 package/meson/meson.mk
diff --git a/package/meson/cross-compilation.conf.in b/package/meson/cross-compilation.conf.in
new file mode 100644
index 0000000000..d38fbb03cc
--- /dev/null
+++ b/package/meson/cross-compilation.conf.in
@@ -0,0 +1,15 @@
+# Note: in Meson terminology, what Buildroot calls the "host" system is the
+# "build" system and the "target" system is called the "host" system.
+
+[binaries]
+c = '@TARGET_CROSS at gcc'
+cpp = '@TARGET_CROSS at g++'
+ar = '@TARGET_CROSS at ar'
+strip = '@TARGET_CROSS at strip'
+pkgconfig = '@HOST_DIR@/usr/bin/pkg-config'
+
+[host_machine]
+system = 'linux'
+cpu_family ='@TARGET_ARCH@'
+cpu = '@TARGET_CPU@'
+endian = '@TARGET_ENDIAN@'
diff --git a/package/meson/meson.hash b/package/meson/meson.hash
new file mode 100644
index 0000000000..7f0de1d437
--- /dev/null
+++ b/package/meson/meson.hash
@@ -0,0 +1,2 @@
+# Locally generated
+sha256 074dd24fd068be0893e2e45bcc35c919d8e12777e9d6a7efdf72d4dc300867ca meson-0.41.2.tar.gz
diff --git a/package/meson/meson.mk b/package/meson/meson.mk
new file mode 100644
index 0000000000..e9f1ffe4d4
--- /dev/null
+++ b/package/meson/meson.mk
@@ -0,0 +1,31 @@
+################################################################################
+#
+# meson
+#
+################################################################################
+
+MESON_VERSION = 0.41.2
+MESON_SITE = https://github.com/mesonbuild/meson/releases/download/$(MESON_VERSION)
+MESON_LICENSE = Apache-2.0
+MESON_LICENSE_FILES = COPYING
+MESON_SETUP_TYPE = setuptools
+
+HOST_MESON_DEPENDENCIES = host-ninja
+HOST_MESON_NEEDS_HOST_PYTHON = python3
+
+HOST_MESON_TARGET_ENDIAN = $(shell echo $(BR2_ENDIAN) | tr 'A-Z' 'a-z')
+
+define HOST_MESON_INSTALL_CROSS_CONF
+ mkdir -p $(HOST_DIR)/etc/meson
+ sed -e 's;@TARGET_CROSS@;$(TARGET_CROSS);g' \
+ -e 's;@TARGET_ARCH@;$(ARCH);g' \
+ -e 's;@TARGET_CPU@;$(BR2_GCC_TARGET_CPU);g' \
+ -e 's;@TARGET_ENDIAN@;$(HOST_MESON_TARGET_ENDIAN);g' \
+ -e 's;@HOST_DIR@;$(HOST_DIR);g' \
+ $(HOST_MESON_PKGDIR)/cross-compilation.conf.in \
+ > $(HOST_DIR)/etc/meson/cross-compilation.conf
+endef
+
+HOST_MESON_POST_INSTALL_HOOKS += HOST_MESON_INSTALL_CROSS_CONF
+
+$(eval $(host-python-package))
--
2.13.3
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [Buildroot] [PATCH v3 2/3] docs/manual: document meson-based packages
2017-07-27 9:55 [Buildroot] [PATCH v2 0/3] Add support for Meson build Jörg Krause
2017-07-27 9:55 ` [Buildroot] [PATCH v3 1/3] meson: new package Jörg Krause
@ 2017-07-27 9:55 ` Jörg Krause
2017-10-08 10:03 ` Yann E. MORIN
2017-07-27 9:55 ` [Buildroot] [PATCH v2 3/3] libmpdclient: bump to version 2.13 Jörg Krause
2 siblings, 1 reply; 12+ messages in thread
From: Jörg Krause @ 2017-07-27 9:55 UTC (permalink / raw)
To: buildroot
From: Eric Le Bihan <eric.le.bihan.dev@free.fr>
Add instructions for adding a package which uses the Meson build system.
Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
[J?rg Krause:
* use one-liner for buildtype]
Signed-off-by: J?rg Krause <joerg.krause@embedded.rocks>
---
v3:
* none
---
docs/manual/adding-packages-meson.txt | 80 +++++++++++++++++++++++++++++++++++
docs/manual/adding-packages.txt | 2 +
2 files changed, 82 insertions(+)
create mode 100644 docs/manual/adding-packages-meson.txt
diff --git a/docs/manual/adding-packages-meson.txt b/docs/manual/adding-packages-meson.txt
new file mode 100644
index 0000000000..697f2520c7
--- /dev/null
+++ b/docs/manual/adding-packages-meson.txt
@@ -0,0 +1,80 @@
+// -*- mode:doc; -*-
+// vim: set syntax=asciidoc:
+
+=== Integration of 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.
+
+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:
+
+------------------------------
+01: ################################################################################
+02: #
+03: # foo
+04: #
+05: ################################################################################
+06:
+07: FOO_VERSION = 1.0
+08: FOO_SOURCE = foo-$(FOO_VERSION).tar.gz
+09: FOO_SITE = http://www.foosoftware.org/download
+10: FOO_LICENSE = GPLv3+
+11: FOO_LICENSE_FILES = COPYING
+12:
+13: FOO_DEPENDENCIES = host-meson host-pkgconf bar
+14:
+15: FOO_MESON_OPTS += \
+16: --prefix=/usr \
+17: --buildtype $(if $(BR2_ENABLE_DEBUG),debug,release) \
+18: --cross-file $(HOST_DIR)/etc/meson/cross-compilation.conf
+19:
+20: define FOO_CONFIGURE_CMDS
+21: rm -rf $(@D)/build
+22: mkdir -p $(@D)/build
+23: $(TARGET_MAKE_ENV) meson.py $(FOO_MESON_OPTS) $(@D) $(@D)/build
+24: endef
+25:
+26: define FOO_BUILD_CMDS
+27: $(TARGET_MAKE_ENV) ninja -C $(@D)/build
+28: endef
+29:
+30: define FOO_INSTALL_TARGET_CMDS
+31: $(TARGET_MAKE_ENV) DESTDIR=$(TARGET_DIR) ninja -C $(@D)/build install
+32: endef
+33:
+34: $(eval $(generic-package))
+--------------------------------
+
+The Makefile starts with the definition of the standard variables for package
+declaration (lines 7 to 11).
+
+As seen in line 34, 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:
+
+* +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_MESON_OPTS+.
+
+* +FOO_BUILD_CMDS+: Ninja is invoked to perform the build.
+
+* +FOO_INSTALL_TARGET_CMDS+: Ninja is invoked to install the files generated
+ during the build step.
+
+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+.
+
+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.
diff --git a/docs/manual/adding-packages.txt b/docs/manual/adding-packages.txt
index d577ff030e..e542124cf9 100644
--- a/docs/manual/adding-packages.txt
+++ b/docs/manual/adding-packages.txt
@@ -34,6 +34,8 @@ include::adding-packages-rebar.txt[]
include::adding-packages-waf.txt[]
+include::adding-packages-meson.txt[]
+
include::adding-packages-kernel-module.txt[]
include::adding-packages-asciidoc.txt[]
--
2.13.3
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [Buildroot] [PATCH v2 3/3] libmpdclient: bump to version 2.13
2017-07-27 9:55 [Buildroot] [PATCH v2 0/3] Add support for Meson build Jörg Krause
2017-07-27 9:55 ` [Buildroot] [PATCH v3 1/3] meson: new package Jörg Krause
2017-07-27 9:55 ` [Buildroot] [PATCH v3 2/3] docs/manual: document meson-based packages Jörg Krause
@ 2017-07-27 9:55 ` Jörg Krause
2017-10-21 12:26 ` Peter Seiderer
2 siblings, 1 reply; 12+ messages in thread
From: Jörg Krause @ 2017-07-27 9:55 UTC (permalink / raw)
To: buildroot
Signed-off-by: J?rg Krause <joerg.krause@embedded.rocks>
---
v2:
* none
---
package/libmpdclient/libmpdclient.hash | 4 ++--
package/libmpdclient/libmpdclient.mk | 26 +++++++++++++++++++++++---
2 files changed, 25 insertions(+), 5 deletions(-)
diff --git a/package/libmpdclient/libmpdclient.hash b/package/libmpdclient/libmpdclient.hash
index 2fd20a41fb..aa9434098f 100644
--- a/package/libmpdclient/libmpdclient.hash
+++ b/package/libmpdclient/libmpdclient.hash
@@ -1,2 +1,2 @@
-# Verified against http://www.musicpd.org/download/libmpdclient/2/libmpdclient-2.10.tar.xz.sig, sha256 locally computed
-sha256 4f08cde82dae70895f8e4532a6e9b54b201efd5591c6b5d6834895807ed2ff82 libmpdclient-2.10.tar.xz
+# Verified against http://www.musicpd.org/download/libmpdclient/2/libmpdclient-2.13.tar.xz.sig, sha256 locally computed
+sha256 5115bd52bc20a707c1ecc7587e6389c17305348e2132a66cf767c62fc55ed45d libmpdclient-2.13.tar.xz
diff --git a/package/libmpdclient/libmpdclient.mk b/package/libmpdclient/libmpdclient.mk
index 691aba9f71..9cd4f2bd2e 100644
--- a/package/libmpdclient/libmpdclient.mk
+++ b/package/libmpdclient/libmpdclient.mk
@@ -5,12 +5,32 @@
################################################################################
LIBMPDCLIENT_VERSION_MAJOR = 2
-LIBMPDCLIENT_VERSION = $(LIBMPDCLIENT_VERSION_MAJOR).10
+LIBMPDCLIENT_VERSION = $(LIBMPDCLIENT_VERSION_MAJOR).13
LIBMPDCLIENT_SOURCE = libmpdclient-$(LIBMPDCLIENT_VERSION).tar.xz
LIBMPDCLIENT_SITE = http://www.musicpd.org/download/libmpdclient/$(LIBMPDCLIENT_VERSION_MAJOR)
-LIBMPDCLIENT_CONF_ENV = ac_cv_prog_cc_c99='-std=gnu99'
LIBMPDCLIENT_INSTALL_STAGING = YES
LIBMPDCLIENT_LICENSE = BSD-3-Clause
LIBMPDCLIENT_LICENSE_FILES = COPYING
-$(eval $(autotools-package))
+LIBMPDCLIENT_DEPENDENCIES = host-meson host-pkgconf
+
+LIBMPDCLIENT_MESON_OPTS += \
+ --prefix=/usr \
+ --buildtype $(if $(BR2_ENABLE_DEBUG),debug,release) \
+ --cross-file $(HOST_DIR)/etc/meson/cross-compilation.conf
+
+define LIBMPDCLIENT_CONFIGURE_CMDS
+ rm -rf $(@D)/build
+ mkdir -p $(@D)/build
+ $(TARGET_MAKE_ENV) meson $(LIBMPDCLIENT_MESON_OPTS) $(@D) $(@D)/build
+endef
+
+define LIBMPDCLIENT_BUILD_CMDS
+ $(TARGET_MAKE_ENV) ninja -C $(@D)/build
+endef
+
+define LIBMPDCLIENT_INSTALL_TARGET_CMDS
+ $(TARGET_MAKE_ENV) DESTDIR=$(TARGET_DIR) ninja -C $(@D)/build install
+endef
+
+$(eval $(generic-package))
--
2.13.3
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [Buildroot] [PATCH v3 2/3] docs/manual: document meson-based packages
2017-07-27 9:55 ` [Buildroot] [PATCH v3 2/3] docs/manual: document meson-based packages Jörg Krause
@ 2017-10-08 10:03 ` Yann E. MORIN
2017-10-08 14:48 ` Eric Le Bihan
0 siblings, 1 reply; 12+ messages in thread
From: Yann E. MORIN @ 2017-10-08 10:03 UTC (permalink / raw)
To: buildroot
J?rg, ?ric, All,
On 2017-07-27 11:55 +0200, J?rg Krause spake thusly:
> From: Eric Le Bihan <eric.le.bihan.dev@free.fr>
>
> Add instructions for adding a package which uses the Meson build system.
>
> Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
> [J?rg Krause:
> * use one-liner for buildtype]
> Signed-off-by: J?rg Krause <joerg.krause@embedded.rocks>
> ---
> v3:
> * none
> ---
> docs/manual/adding-packages-meson.txt | 80 +++++++++++++++++++++++++++++++++++
> docs/manual/adding-packages.txt | 2 +
> 2 files changed, 82 insertions(+)
> create mode 100644 docs/manual/adding-packages-meson.txt
>
> diff --git a/docs/manual/adding-packages-meson.txt b/docs/manual/adding-packages-meson.txt
> new file mode 100644
> index 0000000000..697f2520c7
> --- /dev/null
> +++ b/docs/manual/adding-packages-meson.txt
> @@ -0,0 +1,80 @@
> +// -*- mode:doc; -*-
> +// vim: set syntax=asciidoc:
> +
> +=== Integration of 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.
> +
> +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:
> +
> +------------------------------
> +01: ################################################################################
> +02: #
> +03: # foo
We're not very consistent with the meta-name of the tutorial package.
Some infras use libfoo, others use foo, while there is also foobar.
Sigh...
foo is nice for me, but I'd settle for anything as long as it is
consistent.
> +04: #
> +05: ################################################################################
> +06:
> +07: FOO_VERSION = 1.0
> +08: FOO_SOURCE = foo-$(FOO_VERSION).tar.gz
> +09: FOO_SITE = http://www.foosoftware.org/download
> +10: FOO_LICENSE = GPLv3+
> +11: FOO_LICENSE_FILES = COPYING
> +12:
> +13: FOO_DEPENDENCIES = host-meson host-pkgconf bar
> +14:
> +15: FOO_MESON_OPTS += \
> +16: --prefix=/usr \
> +17: --buildtype $(if $(BR2_ENABLE_DEBUG),debug,release) \
> +18: --cross-file $(HOST_DIR)/etc/meson/cross-compilation.conf
Whether we one day add a meson-package infra or not, I think this
variable should be documented as FOO_CONF_OPTS for symetry with the
other package infras.
> +20: define FOO_CONFIGURE_CMDS
> +21: rm -rf $(@D)/build
We don't usually remove stuff created in a previous run, unless it
breaks the build.
> +22: mkdir -p $(@D)/build
> +23: $(TARGET_MAKE_ENV) meson.py $(FOO_MESON_OPTS) $(@D) $(@D)/build
> +24: endef
> +25:
> +26: define FOO_BUILD_CMDS
> +27: $(TARGET_MAKE_ENV) ninja -C $(@D)/build
Would the build accept additional options? I mean, do we need to prepare
to pass extra parameteres, like FOO_MAKE_OPTS does for autotools?
> +28: endef
> +29:
> +30: define FOO_INSTALL_TARGET_CMDS
> +31: $(TARGET_MAKE_ENV) DESTDIR=$(TARGET_DIR) ninja -C $(@D)/build install
Ditto FOO_INSTALL_TARGET_OPTS and FOO_INSTALL_STAGING_OPTS?
> +32: endef
If all the meson-based packages are just those three commands (configure,
build and install) and never deviates by more than the _OPTS stuff, then
I believe we should add the meson-package infra right away. And it
should be reasonably easy.
Regards,
Yann E. MORIN.
> +34: $(eval $(generic-package))
> +--------------------------------
> +
> +The Makefile starts with the definition of the standard variables for package
> +declaration (lines 7 to 11).
> +
> +As seen in line 34, 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:
> +
> +* +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_MESON_OPTS+.
> +
> +* +FOO_BUILD_CMDS+: Ninja is invoked to perform the build.
> +
> +* +FOO_INSTALL_TARGET_CMDS+: Ninja is invoked to install the files generated
> + during the build step.
> +
> +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+.
> +
> +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.
> diff --git a/docs/manual/adding-packages.txt b/docs/manual/adding-packages.txt
> index d577ff030e..e542124cf9 100644
> --- a/docs/manual/adding-packages.txt
> +++ b/docs/manual/adding-packages.txt
> @@ -34,6 +34,8 @@ include::adding-packages-rebar.txt[]
>
> include::adding-packages-waf.txt[]
>
> +include::adding-packages-meson.txt[]
> +
> include::adding-packages-kernel-module.txt[]
>
> include::adding-packages-asciidoc.txt[]
> --
> 2.13.3
>
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Buildroot] [PATCH v3 1/3] meson: new package
2017-07-27 9:55 ` [Buildroot] [PATCH v3 1/3] meson: new package Jörg Krause
@ 2017-10-08 10:17 ` Yann E. MORIN
2017-10-08 14:42 ` Eric Le Bihan
2017-10-20 19:45 ` Peter Seiderer
1 sibling, 1 reply; 12+ messages in thread
From: Yann E. MORIN @ 2017-10-08 10:17 UTC (permalink / raw)
To: buildroot
J?rg, ?ric, All,
On 2017-07-27 11:55 +0200, J?rg Krause spake thusly:
> From: Eric Le Bihan <eric.le.bihan.dev@free.fr>
>
> This new package provides the host variant of the Meson Build System, an
> open source build system meant to be both extremely fast, and as user
> friendly as possible.
>
> More precisely, Meson creates configuration files for the Ninja build
> system.
>
> Besides building Meson, it generates a configuration file
> ("$(HOST_DIR)/etc/meson/cross-compilation.conf") to be used when
> cross-compiling a Meson-based project.
>
> Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
> [J?rg Krause:
> * bump to version 0.41.2
> * use explicit tarball release instead of github helper
> * use explicit sed
> * pass BR2_GCC_TARGET_CPU to cross file]
>
> Signed-off-by: J?rg Krause <joerg.krause@embedded.rocks>
> ---
> v3:
> * fix missing mkdir
> ---
> package/meson/cross-compilation.conf.in | 15 +++++++++++++++
> package/meson/meson.hash | 2 ++
> package/meson/meson.mk | 31 +++++++++++++++++++++++++++++++
> 3 files changed, 48 insertions(+)
> create mode 100644 package/meson/cross-compilation.conf.in
> create mode 100644 package/meson/meson.hash
> create mode 100644 package/meson/meson.mk
>
> diff --git a/package/meson/cross-compilation.conf.in b/package/meson/cross-compilation.conf.in
> new file mode 100644
> index 0000000000..d38fbb03cc
> --- /dev/null
> +++ b/package/meson/cross-compilation.conf.in
And what about host packages that use meson?
> @@ -0,0 +1,15 @@
> +# Note: in Meson terminology, what Buildroot calls the "host" system is the
> +# "build" system and the "target" system is called the "host" system.
Yeah, pretty confusing, isn't it? Buildroot is wrong here, but since
we've been wrong for almost two decades now, we can't really change...
I'd still suggest a little rephrasing:
# Note: Buildroot's and Meson's terminologies differ about the meaning
# of 'build', 'host' and 'target':
# - Buildroot's 'host' is Meson's 'build'
# - Buildroot's 'target' is Meson's 'host'
Regards,
Yann E. MORIN.
> +[binaries]
> +c = '@TARGET_CROSS at gcc'
> +cpp = '@TARGET_CROSS at g++'
> +ar = '@TARGET_CROSS at ar'
> +strip = '@TARGET_CROSS at strip'
> +pkgconfig = '@HOST_DIR@/usr/bin/pkg-config'
> +
> +[host_machine]
> +system = 'linux'
> +cpu_family ='@TARGET_ARCH@'
> +cpu = '@TARGET_CPU@'
> +endian = '@TARGET_ENDIAN@'
> diff --git a/package/meson/meson.hash b/package/meson/meson.hash
> new file mode 100644
> index 0000000000..7f0de1d437
> --- /dev/null
> +++ b/package/meson/meson.hash
> @@ -0,0 +1,2 @@
> +# Locally generated
> +sha256 074dd24fd068be0893e2e45bcc35c919d8e12777e9d6a7efdf72d4dc300867ca meson-0.41.2.tar.gz
> diff --git a/package/meson/meson.mk b/package/meson/meson.mk
> new file mode 100644
> index 0000000000..e9f1ffe4d4
> --- /dev/null
> +++ b/package/meson/meson.mk
> @@ -0,0 +1,31 @@
> +################################################################################
> +#
> +# meson
> +#
> +################################################################################
> +
> +MESON_VERSION = 0.41.2
> +MESON_SITE = https://github.com/mesonbuild/meson/releases/download/$(MESON_VERSION)
> +MESON_LICENSE = Apache-2.0
> +MESON_LICENSE_FILES = COPYING
> +MESON_SETUP_TYPE = setuptools
> +
> +HOST_MESON_DEPENDENCIES = host-ninja
> +HOST_MESON_NEEDS_HOST_PYTHON = python3
> +
> +HOST_MESON_TARGET_ENDIAN = $(shell echo $(BR2_ENDIAN) | tr 'A-Z' 'a-z')
> +
> +define HOST_MESON_INSTALL_CROSS_CONF
> + mkdir -p $(HOST_DIR)/etc/meson
> + sed -e 's;@TARGET_CROSS@;$(TARGET_CROSS);g' \
> + -e 's;@TARGET_ARCH@;$(ARCH);g' \
> + -e 's;@TARGET_CPU@;$(BR2_GCC_TARGET_CPU);g' \
> + -e 's;@TARGET_ENDIAN@;$(HOST_MESON_TARGET_ENDIAN);g' \
> + -e 's;@HOST_DIR@;$(HOST_DIR);g' \
> + $(HOST_MESON_PKGDIR)/cross-compilation.conf.in \
> + > $(HOST_DIR)/etc/meson/cross-compilation.conf
> +endef
> +
> +HOST_MESON_POST_INSTALL_HOOKS += HOST_MESON_INSTALL_CROSS_CONF
> +
> +$(eval $(host-python-package))
> --
> 2.13.3
>
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Buildroot] [PATCH v3 1/3] meson: new package
2017-10-08 10:17 ` Yann E. MORIN
@ 2017-10-08 14:42 ` Eric Le Bihan
0 siblings, 0 replies; 12+ messages in thread
From: Eric Le Bihan @ 2017-10-08 14:42 UTC (permalink / raw)
To: buildroot
Hi!
On 17-10-08 12:17:54, Yann E. MORIN wrote:
> J?rg, ?ric, All,
>
> On 2017-07-27 11:55 +0200, J?rg Krause spake thusly:
> > From: Eric Le Bihan <eric.le.bihan.dev@free.fr>
> >
> > This new package provides the host variant of the Meson Build System, an
> > open source build system meant to be both extremely fast, and as user
> > friendly as possible.
> >
> > More precisely, Meson creates configuration files for the Ninja build
> > system.
> >
> > Besides building Meson, it generates a configuration file
> > ("$(HOST_DIR)/etc/meson/cross-compilation.conf") to be used when
> > cross-compiling a Meson-based project.
> >
> > Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
> > [J?rg Krause:
> > * bump to version 0.41.2
> > * use explicit tarball release instead of github helper
> > * use explicit sed
> > * pass BR2_GCC_TARGET_CPU to cross file]
> >
> > Signed-off-by: J?rg Krause <joerg.krause@embedded.rocks>
> > ---
> > v3:
> > * fix missing mkdir
> > ---
> > package/meson/cross-compilation.conf.in | 15 +++++++++++++++
> > package/meson/meson.hash | 2 ++
> > package/meson/meson.mk | 31 +++++++++++++++++++++++++++++++
> > 3 files changed, 48 insertions(+)
> > create mode 100644 package/meson/cross-compilation.conf.in
> > create mode 100644 package/meson/meson.hash
> > create mode 100644 package/meson/meson.mk
> >
> > diff --git a/package/meson/cross-compilation.conf.in b/package/meson/cross-compilation.conf.in
> > new file mode 100644
> > index 0000000000..d38fbb03cc
> > --- /dev/null
> > +++ b/package/meson/cross-compilation.conf.in
>
> And what about host packages that use meson?
Good question. I don't know about host packages that may switch to
Meson. But, out of curiosity, I'll try with a dummy package to see how
it would behave.
> > @@ -0,0 +1,15 @@
> > +# Note: in Meson terminology, what Buildroot calls the "host" system is the
> > +# "build" system and the "target" system is called the "host" system.
>
> Yeah, pretty confusing, isn't it? Buildroot is wrong here, but since
> we've been wrong for almost two decades now, we can't really change...
>
> I'd still suggest a little rephrasing:
>
> # Note: Buildroot's and Meson's terminologies differ about the meaning
> # of 'build', 'host' and 'target':
> # - Buildroot's 'host' is Meson's 'build'
> # - Buildroot's 'target' is Meson's 'host'
Looks sensible to me.
> Regards,
> Yann E. MORIN.
>
> > +[binaries]
> > +c = '@TARGET_CROSS at gcc'
> > +cpp = '@TARGET_CROSS at g++'
> > +ar = '@TARGET_CROSS at ar'
> > +strip = '@TARGET_CROSS at strip'
> > +pkgconfig = '@HOST_DIR@/usr/bin/pkg-config'
> > +
> > +[host_machine]
> > +system = 'linux'
> > +cpu_family ='@TARGET_ARCH@'
> > +cpu = '@TARGET_CPU@'
> > +endian = '@TARGET_ENDIAN@'
> > diff --git a/package/meson/meson.hash b/package/meson/meson.hash
> > new file mode 100644
> > index 0000000000..7f0de1d437
> > --- /dev/null
> > +++ b/package/meson/meson.hash
> > @@ -0,0 +1,2 @@
> > +# Locally generated
> > +sha256 074dd24fd068be0893e2e45bcc35c919d8e12777e9d6a7efdf72d4dc300867ca meson-0.41.2.tar.gz
> > diff --git a/package/meson/meson.mk b/package/meson/meson.mk
> > new file mode 100644
> > index 0000000000..e9f1ffe4d4
> > --- /dev/null
> > +++ b/package/meson/meson.mk
> > @@ -0,0 +1,31 @@
> > +################################################################################
> > +#
> > +# meson
> > +#
> > +################################################################################
> > +
> > +MESON_VERSION = 0.41.2
> > +MESON_SITE = https://github.com/mesonbuild/meson/releases/download/$(MESON_VERSION)
> > +MESON_LICENSE = Apache-2.0
> > +MESON_LICENSE_FILES = COPYING
> > +MESON_SETUP_TYPE = setuptools
> > +
> > +HOST_MESON_DEPENDENCIES = host-ninja
> > +HOST_MESON_NEEDS_HOST_PYTHON = python3
> > +
> > +HOST_MESON_TARGET_ENDIAN = $(shell echo $(BR2_ENDIAN) | tr 'A-Z' 'a-z')
> > +
> > +define HOST_MESON_INSTALL_CROSS_CONF
> > + mkdir -p $(HOST_DIR)/etc/meson
> > + sed -e 's;@TARGET_CROSS@;$(TARGET_CROSS);g' \
> > + -e 's;@TARGET_ARCH@;$(ARCH);g' \
> > + -e 's;@TARGET_CPU@;$(BR2_GCC_TARGET_CPU);g' \
> > + -e 's;@TARGET_ENDIAN@;$(HOST_MESON_TARGET_ENDIAN);g' \
> > + -e 's;@HOST_DIR@;$(HOST_DIR);g' \
> > + $(HOST_MESON_PKGDIR)/cross-compilation.conf.in \
> > + > $(HOST_DIR)/etc/meson/cross-compilation.conf
> > +endef
> > +
> > +HOST_MESON_POST_INSTALL_HOOKS += HOST_MESON_INSTALL_CROSS_CONF
> > +
> > +$(eval $(host-python-package))
> > --
> > 2.13.3
> >
Regards,
--
ELB
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Buildroot] [PATCH v3 2/3] docs/manual: document meson-based packages
2017-10-08 10:03 ` Yann E. MORIN
@ 2017-10-08 14:48 ` Eric Le Bihan
2017-10-08 16:48 ` Adrian Perez de Castro
0 siblings, 1 reply; 12+ messages in thread
From: Eric Le Bihan @ 2017-10-08 14:48 UTC (permalink / raw)
To: buildroot
On 17-10-08 12:03:41, Yann E. MORIN wrote:
> J?rg, ?ric, All,
>
> On 2017-07-27 11:55 +0200, J?rg Krause spake thusly:
> > From: Eric Le Bihan <eric.le.bihan.dev@free.fr>
> >
> > Add instructions for adding a package which uses the Meson build system.
> >
> > Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
> > [J?rg Krause:
> > * use one-liner for buildtype]
> > Signed-off-by: J?rg Krause <joerg.krause@embedded.rocks>
> > ---
> > v3:
> > * none
> > ---
> > docs/manual/adding-packages-meson.txt | 80 +++++++++++++++++++++++++++++++++++
> > docs/manual/adding-packages.txt | 2 +
> > 2 files changed, 82 insertions(+)
> > create mode 100644 docs/manual/adding-packages-meson.txt
> >
> > diff --git a/docs/manual/adding-packages-meson.txt b/docs/manual/adding-packages-meson.txt
> > new file mode 100644
> > index 0000000000..697f2520c7
> > --- /dev/null
> > +++ b/docs/manual/adding-packages-meson.txt
> > @@ -0,0 +1,80 @@
> > +// -*- mode:doc; -*-
> > +// vim: set syntax=asciidoc:
> > +
> > +=== Integration of 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.
> > +
> > +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:
> > +
> > +------------------------------
> > +01: ################################################################################
> > +02: #
> > +03: # foo
>
> We're not very consistent with the meta-name of the tutorial package.
> Some infras use libfoo, others use foo, while there is also foobar.
> Sigh...
>
> foo is nice for me, but I'd settle for anything as long as it is
> consistent.
>
> > +04: #
> > +05: ################################################################################
> > +06:
> > +07: FOO_VERSION = 1.0
> > +08: FOO_SOURCE = foo-$(FOO_VERSION).tar.gz
> > +09: FOO_SITE = http://www.foosoftware.org/download
> > +10: FOO_LICENSE = GPLv3+
> > +11: FOO_LICENSE_FILES = COPYING
> > +12:
> > +13: FOO_DEPENDENCIES = host-meson host-pkgconf bar
> > +14:
> > +15: FOO_MESON_OPTS += \
> > +16: --prefix=/usr \
> > +17: --buildtype $(if $(BR2_ENABLE_DEBUG),debug,release) \
> > +18: --cross-file $(HOST_DIR)/etc/meson/cross-compilation.conf
>
> Whether we one day add a meson-package infra or not, I think this
> variable should be documented as FOO_CONF_OPTS for symetry with the
> other package infras.
OK.
> > +20: define FOO_CONFIGURE_CMDS
> > +21: rm -rf $(@D)/build
>
> We don't usually remove stuff created in a previous run, unless it
> breaks the build.
OK.
> > +22: mkdir -p $(@D)/build
> > +23: $(TARGET_MAKE_ENV) meson.py $(FOO_MESON_OPTS) $(@D) $(@D)/build
> > +24: endef
> > +25:
> > +26: define FOO_BUILD_CMDS
> > +27: $(TARGET_MAKE_ENV) ninja -C $(@D)/build
>
> Would the build accept additional options? I mean, do we need to prepare
> to pass extra parameteres, like FOO_MAKE_OPTS does for autotools?
I'll check this.
> > +28: endef
> > +29:
> > +30: define FOO_INSTALL_TARGET_CMDS
> > +31: $(TARGET_MAKE_ENV) DESTDIR=$(TARGET_DIR) ninja -C $(@D)/build install
>
> Ditto FOO_INSTALL_TARGET_OPTS and FOO_INSTALL_STAGING_OPTS?
I did not know about these two (I should have read the other pkg-*.mk
more carefully). I'll check this.
> > +32: endef
>
> If all the meson-based packages are just those three commands (configure,
> build and install) and never deviates by more than the _OPTS stuff, then
> I believe we should add the meson-package infra right away. And it
> should be reasonably easy.
>
> Regards,
> Yann E. MORIN.
>
> > +34: $(eval $(generic-package))
> > +--------------------------------
> > +
> > +The Makefile starts with the definition of the standard variables for package
> > +declaration (lines 7 to 11).
> > +
> > +As seen in line 34, 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:
> > +
> > +* +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_MESON_OPTS+.
> > +
> > +* +FOO_BUILD_CMDS+: Ninja is invoked to perform the build.
> > +
> > +* +FOO_INSTALL_TARGET_CMDS+: Ninja is invoked to install the files generated
> > + during the build step.
> > +
> > +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+.
> > +
> > +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.
> > diff --git a/docs/manual/adding-packages.txt b/docs/manual/adding-packages.txt
> > index d577ff030e..e542124cf9 100644
> > --- a/docs/manual/adding-packages.txt
> > +++ b/docs/manual/adding-packages.txt
> > @@ -34,6 +34,8 @@ include::adding-packages-rebar.txt[]
> >
> > include::adding-packages-waf.txt[]
> >
> > +include::adding-packages-meson.txt[]
> > +
> > include::adding-packages-kernel-module.txt[]
> >
> > include::adding-packages-asciidoc.txt[]
> > --
> > 2.13.3
> >
Regards,
--
ELB
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Buildroot] [PATCH v3 2/3] docs/manual: document meson-based packages
2017-10-08 14:48 ` Eric Le Bihan
@ 2017-10-08 16:48 ` Adrian Perez de Castro
2017-10-08 18:05 ` Yann E. MORIN
0 siblings, 1 reply; 12+ messages in thread
From: Adrian Perez de Castro @ 2017-10-08 16:48 UTC (permalink / raw)
To: buildroot
Hello everybody,
On Sun, 8 Oct 2017 16:48:17 +0200, Eric Le Bihan <eric.le.bihan.dev@free.fr> wrote:
> On 17-10-08 12:03:41, Yann E. MORIN wrote:
> > J?rg, ?ric, All,
> >
> > On 2017-07-27 11:55 +0200, J?rg Krause spake thusly:
> > > From: Eric Le Bihan <eric.le.bihan.dev@free.fr>
> > >
> > > Add instructions for adding a package which uses the Meson build system.
> > >
> > > Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
> > > [J?rg Krause:
> > > * use one-liner for buildtype]
> > > Signed-off-by: J?rg Krause <joerg.krause@embedded.rocks>
> > > ---
> > > v3:
> > > * none
> > > ---
> > > docs/manual/adding-packages-meson.txt | 80 +++++++++++++++++++++++++++++++++++
> > > docs/manual/adding-packages.txt | 2 +
> > > 2 files changed, 82 insertions(+)
> > > create mode 100644 docs/manual/adding-packages-meson.txt
> > >
> > > diff --git a/docs/manual/adding-packages-meson.txt b/docs/manual/adding-packages-meson.txt
> > > new file mode 100644
> > > index 0000000000..697f2520c7
> > > --- /dev/null
> > > +++ b/docs/manual/adding-packages-meson.txt
> > > @@ -0,0 +1,80 @@
> > > +// -*- mode:doc; -*-
> > > +// vim: set syntax=asciidoc:
> > > +
> > > +=== Integration of 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.
> > > +
> > > +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:
> > > +
> > > +------------------------------
> > > +01: ################################################################################
> > > +02: #
> > > +03: # foo
> >
> > We're not very consistent with the meta-name of the tutorial package.
> > Some infras use libfoo, others use foo, while there is also foobar.
> > Sigh...
> >
> > foo is nice for me, but I'd settle for anything as long as it is
> > consistent.
> >
> > > +04: #
> > > +05: ################################################################################
> > > +06:
> > > +07: FOO_VERSION = 1.0
> > > +08: FOO_SOURCE = foo-$(FOO_VERSION).tar.gz
> > > +09: FOO_SITE = http://www.foosoftware.org/download
> > > +10: FOO_LICENSE = GPLv3+
> > > +11: FOO_LICENSE_FILES = COPYING
> > > +12:
> > > +13: FOO_DEPENDENCIES = host-meson host-pkgconf bar
> > > +14:
> > > +15: FOO_MESON_OPTS += \
> > > +16: --prefix=/usr \
> > > +17: --buildtype $(if $(BR2_ENABLE_DEBUG),debug,release) \
> > > +18: --cross-file $(HOST_DIR)/etc/meson/cross-compilation.conf
> >
> > Whether we one day add a meson-package infra or not, I think this
> > variable should be documented as FOO_CONF_OPTS for symetry with the
> > other package infras.
>
> OK.
>
> > > +20: define FOO_CONFIGURE_CMDS
> > > +21: rm -rf $(@D)/build
> >
> > We don't usually remove stuff created in a previous run, unless it
> > breaks the build.
>
> OK.
Though you may want/need to remove the build directory at least for the
?<pkg>-reconfigure? target because Meson will refuse to use an
already-configured build directory:
% mkdir build
% meson . build/
...
% meson . build/
Trying to run Meson on a build directory that has already been configured.
If you want to build it, just run your build command (e.g. ninja) inside the
build directory. Meson will autodetect any changes in your setup and regenerate
itself as required. Though it shouldn't be necessary, running ninja reconfigure
will force Meson to regenerate the build files.
If you want to change option values, use meson configure instead.
%
> > > +22: mkdir -p $(@D)/build
> > > +23: $(TARGET_MAKE_ENV) meson.py $(FOO_MESON_OPTS) $(@D) $(@D)/build
> > > +24: endef
> > > +25:
> > > +26: define FOO_BUILD_CMDS
> > > +27: $(TARGET_MAKE_ENV) ninja -C $(@D)/build
> >
> > Would the build accept additional options? I mean, do we need to prepare
> > to pass extra parameteres, like FOO_MAKE_OPTS does for autotools?
>
> I'll check this.
>
> > > +28: endef
> > > +29:
> > > +30: define FOO_INSTALL_TARGET_CMDS
> > > +31: $(TARGET_MAKE_ENV) DESTDIR=$(TARGET_DIR) ninja -C $(@D)/build install
> >
> > Ditto FOO_INSTALL_TARGET_OPTS and FOO_INSTALL_STAGING_OPTS?
>
> I did not know about these two (I should have read the other pkg-*.mk
> more carefully). I'll check this.
>
> > > +32: endef
> >
> > If all the meson-based packages are just those three commands (configure,
> > build and install) and never deviates by more than the _OPTS stuff, then
> > I believe we should add the meson-package infra right away. And it
> > should be reasonably easy.
> >
> > Regards,
> > Yann E. MORIN.
> >
> > > +34: $(eval $(generic-package))
> > > +--------------------------------
> > > +
> > > +The Makefile starts with the definition of the standard variables for package
> > > +declaration (lines 7 to 11).
> > > +
> > > +As seen in line 34, 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:
> > > +
> > > +* +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_MESON_OPTS+.
> > > +
> > > +* +FOO_BUILD_CMDS+: Ninja is invoked to perform the build.
> > > +
> > > +* +FOO_INSTALL_TARGET_CMDS+: Ninja is invoked to install the files generated
> > > + during the build step.
> > > +
> > > +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+.
> > > +
> > > +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.
> > > diff --git a/docs/manual/adding-packages.txt b/docs/manual/adding-packages.txt
> > > index d577ff030e..e542124cf9 100644
> > > --- a/docs/manual/adding-packages.txt
> > > +++ b/docs/manual/adding-packages.txt
> > > @@ -34,6 +34,8 @@ include::adding-packages-rebar.txt[]
> > >
> > > include::adding-packages-waf.txt[]
> > >
> > > +include::adding-packages-meson.txt[]
> > > +
> > > include::adding-packages-kernel-module.txt[]
> > >
> > > include::adding-packages-asciidoc.txt[]
> > > --
> > > 2.13.3
> > >
>
> Regards,
>
> --
> ELB
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20171008/fa0814a3/attachment.asc>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Buildroot] [PATCH v3 2/3] docs/manual: document meson-based packages
2017-10-08 16:48 ` Adrian Perez de Castro
@ 2017-10-08 18:05 ` Yann E. MORIN
0 siblings, 0 replies; 12+ messages in thread
From: Yann E. MORIN @ 2017-10-08 18:05 UTC (permalink / raw)
To: buildroot
Adrian, All,
On 2017-10-08 18:48 +0200, Adrian Perez de Castro spake thusly:
> On Sun, 8 Oct 2017 16:48:17 +0200, Eric Le Bihan <eric.le.bihan.dev@free.fr> wrote:
> > On 17-10-08 12:03:41, Yann E. MORIN wrote:
> > > On 2017-07-27 11:55 +0200, J?rg Krause spake thusly:
> > > > From: Eric Le Bihan <eric.le.bihan.dev@free.fr>
[--SNIP--]
> > > > +20: define FOO_CONFIGURE_CMDS
> > > > +21: rm -rf $(@D)/build
> > > We don't usually remove stuff created in a previous run, unless it
> > > breaks the build.
> > OK.
> Though you may want/need to remove the build directory at least for the
> ?<pkg>-reconfigure? target because Meson will refuse to use an
> already-configured build directory:
[--SNIP--]
This is a good reason to forcibly remove it, indeed.
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Buildroot] [PATCH v3 1/3] meson: new package
2017-07-27 9:55 ` [Buildroot] [PATCH v3 1/3] meson: new package Jörg Krause
2017-10-08 10:17 ` Yann E. MORIN
@ 2017-10-20 19:45 ` Peter Seiderer
1 sibling, 0 replies; 12+ messages in thread
From: Peter Seiderer @ 2017-10-20 19:45 UTC (permalink / raw)
To: buildroot
Hello J?rg, Eric,
On Thu, 27 Jul 2017 11:55:25 +0200, J?rg Krause <joerg.krause@embedded.rocks> wrote:
> From: Eric Le Bihan <eric.le.bihan.dev@free.fr>
>
> This new package provides the host variant of the Meson Build System, an
> open source build system meant to be both extremely fast, and as user
> friendly as possible.
>
> More precisely, Meson creates configuration files for the Ninja build
> system.
>
> Besides building Meson, it generates a configuration file
> ("$(HOST_DIR)/etc/meson/cross-compilation.conf") to be used when
> cross-compiling a Meson-based project.
>
> Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
> [J?rg Krause:
> * bump to version 0.41.2
> * use explicit tarball release instead of github helper
> * use explicit sed
> * pass BR2_GCC_TARGET_CPU to cross file]
>
> Signed-off-by: J?rg Krause <joerg.krause@embedded.rocks>
> ---
> v3:
> * fix missing mkdir
> ---
> package/meson/cross-compilation.conf.in | 15 +++++++++++++++
> package/meson/meson.hash | 2 ++
> package/meson/meson.mk | 31 +++++++++++++++++++++++++++++++
> 3 files changed, 48 insertions(+)
> create mode 100644 package/meson/cross-compilation.conf.in
> create mode 100644 package/meson/meson.hash
> create mode 100644 package/meson/meson.mk
>
> diff --git a/package/meson/cross-compilation.conf.in b/package/meson/cross-compilation.conf.in
> new file mode 100644
> index 0000000000..d38fbb03cc
> --- /dev/null
> +++ b/package/meson/cross-compilation.conf.in
> @@ -0,0 +1,15 @@
> +# Note: in Meson terminology, what Buildroot calls the "host" system is the
> +# "build" system and the "target" system is called the "host" system.
> +
> +[binaries]
> +c = '@TARGET_CROSS at gcc'
> +cpp = '@TARGET_CROSS at g++'
> +ar = '@TARGET_CROSS at ar'
> +strip = '@TARGET_CROSS at strip'
> +pkgconfig = '@HOST_DIR@/usr/bin/pkg-config'
> +
> +[host_machine]
> +system = 'linux'
> +cpu_family ='@TARGET_ARCH@'
> +cpu = '@TARGET_CPU@'
> +endian = '@TARGET_ENDIAN@'
> diff --git a/package/meson/meson.hash b/package/meson/meson.hash
> new file mode 100644
> index 0000000000..7f0de1d437
> --- /dev/null
> +++ b/package/meson/meson.hash
> @@ -0,0 +1,2 @@
> +# Locally generated
> +sha256 074dd24fd068be0893e2e45bcc35c919d8e12777e9d6a7efdf72d4dc300867ca meson-0.41.2.tar.gz
> diff --git a/package/meson/meson.mk b/package/meson/meson.mk
> new file mode 100644
> index 0000000000..e9f1ffe4d4
> --- /dev/null
> +++ b/package/meson/meson.mk
> @@ -0,0 +1,31 @@
> +################################################################################
> +#
> +# meson
> +#
> +################################################################################
> +
> +MESON_VERSION = 0.41.2
> +MESON_SITE = https://github.com/mesonbuild/meson/releases/download/$(MESON_VERSION)
> +MESON_LICENSE = Apache-2.0
> +MESON_LICENSE_FILES = COPYING
> +MESON_SETUP_TYPE = setuptools
> +
> +HOST_MESON_DEPENDENCIES = host-ninja
> +HOST_MESON_NEEDS_HOST_PYTHON = python3
> +
> +HOST_MESON_TARGET_ENDIAN = $(shell echo $(BR2_ENDIAN) | tr 'A-Z' 'a-z')
> +
> +define HOST_MESON_INSTALL_CROSS_CONF
> + mkdir -p $(HOST_DIR)/etc/meson
> + sed -e 's;@TARGET_CROSS@;$(TARGET_CROSS);g' \
> + -e 's;@TARGET_ARCH@;$(ARCH);g' \
> + -e 's;@TARGET_CPU@;$(BR2_GCC_TARGET_CPU);g' \
This leads to the following entry in the cross-compilation.conf file
cpu = '"cortex-a53"'
and a compile failure on a first try to enable meson build for gstreamer1
package. The following patch fixes the entry to
cpu = 'cortex-a53'
which fixes the gstreamer1 meson based build for me:
@ -14,12 +14,13 @@ HOST_MESON_DEPENDENCIES = host-ninja
HOST_MESON_NEEDS_HOST_PYTHON = python3
HOST_MESON_TARGET_ENDIAN = $(shell echo $(BR2_ENDIAN) | tr 'A-Z' 'a-z')
+HOST_MESON_TARGET_CPU = $(call qstrip,$(BR2_GCC_TARGET_CPU))
define HOST_MESON_INSTALL_CROSS_CONF
mkdir -p $(HOST_DIR)/etc/meson
sed -e 's;@TARGET_CROSS@;$(TARGET_CROSS);g' \
-e 's;@TARGET_ARCH@;$(ARCH);g' \
- -e 's;@TARGET_CPU@;$(BR2_GCC_TARGET_CPU);g' \
+ -e 's;@TARGET_CPU@;$(HOST_MESON_TARGET_CPU);g' \
-e 's;@TARGET_ENDIAN@;$(HOST_MESON_TARGET_ENDIAN);g' \
-e 's;@HOST_DIR@;$(HOST_DIR);g' \
$(HOST_MESON_PKGDIR)/cross-compilation.conf.in \
Regards,
Peter
Note: the next version of libinput (1.9.0) drops autotools support and
changed to using meson, see [1].
[1] https://lists.freedesktop.org/archives/wayland-devel/2017-October/035469.html
> + -e 's;@TARGET_ENDIAN@;$(HOST_MESON_TARGET_ENDIAN);g' \
> + -e 's;@HOST_DIR@;$(HOST_DIR);g' \
> + $(HOST_MESON_PKGDIR)/cross-compilation.conf.in \
> + > $(HOST_DIR)/etc/meson/cross-compilation.conf
> +endef
> +
> +HOST_MESON_POST_INSTALL_HOOKS += HOST_MESON_INSTALL_CROSS_CONF
> +
> +$(eval $(host-python-package))
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Buildroot] [PATCH v2 3/3] libmpdclient: bump to version 2.13
2017-07-27 9:55 ` [Buildroot] [PATCH v2 3/3] libmpdclient: bump to version 2.13 Jörg Krause
@ 2017-10-21 12:26 ` Peter Seiderer
0 siblings, 0 replies; 12+ messages in thread
From: Peter Seiderer @ 2017-10-21 12:26 UTC (permalink / raw)
To: buildroot
Hello J?rg, Eric,
On Thu, 27 Jul 2017 11:55:27 +0200, J?rg Krause <joerg.krause@embedded.rocks> wrote:
> Signed-off-by: J?rg Krause <joerg.krause@embedded.rocks>
> ---
> v2:
> * none
> ---
> package/libmpdclient/libmpdclient.hash | 4 ++--
> package/libmpdclient/libmpdclient.mk | 26 +++++++++++++++++++++++---
> 2 files changed, 25 insertions(+), 5 deletions(-)
>
> diff --git a/package/libmpdclient/libmpdclient.hash b/package/libmpdclient/libmpdclient.hash
> index 2fd20a41fb..aa9434098f 100644
> --- a/package/libmpdclient/libmpdclient.hash
> +++ b/package/libmpdclient/libmpdclient.hash
> @@ -1,2 +1,2 @@
> -# Verified against http://www.musicpd.org/download/libmpdclient/2/libmpdclient-2.10.tar.xz.sig, sha256 locally computed
> -sha256 4f08cde82dae70895f8e4532a6e9b54b201efd5591c6b5d6834895807ed2ff82 libmpdclient-2.10.tar.xz
> +# Verified against http://www.musicpd.org/download/libmpdclient/2/libmpdclient-2.13.tar.xz.sig, sha256 locally computed
> +sha256 5115bd52bc20a707c1ecc7587e6389c17305348e2132a66cf767c62fc55ed45d libmpdclient-2.13.tar.xz
> diff --git a/package/libmpdclient/libmpdclient.mk b/package/libmpdclient/libmpdclient.mk
> index 691aba9f71..9cd4f2bd2e 100644
> --- a/package/libmpdclient/libmpdclient.mk
> +++ b/package/libmpdclient/libmpdclient.mk
> @@ -5,12 +5,32 @@
> ################################################################################
>
> LIBMPDCLIENT_VERSION_MAJOR = 2
> -LIBMPDCLIENT_VERSION = $(LIBMPDCLIENT_VERSION_MAJOR).10
> +LIBMPDCLIENT_VERSION = $(LIBMPDCLIENT_VERSION_MAJOR).13
> LIBMPDCLIENT_SOURCE = libmpdclient-$(LIBMPDCLIENT_VERSION).tar.xz
> LIBMPDCLIENT_SITE = http://www.musicpd.org/download/libmpdclient/$(LIBMPDCLIENT_VERSION_MAJOR)
> -LIBMPDCLIENT_CONF_ENV = ac_cv_prog_cc_c99='-std=gnu99'
> LIBMPDCLIENT_INSTALL_STAGING = YES
> LIBMPDCLIENT_LICENSE = BSD-3-Clause
> LIBMPDCLIENT_LICENSE_FILES = COPYING
>
> -$(eval $(autotools-package))
> +LIBMPDCLIENT_DEPENDENCIES = host-meson host-pkgconf
> +
> +LIBMPDCLIENT_MESON_OPTS += \
> + --prefix=/usr \
> + --buildtype $(if $(BR2_ENABLE_DEBUG),debug,release) \
> + --cross-file $(HOST_DIR)/etc/meson/cross-compilation.conf
> +
> +define LIBMPDCLIENT_CONFIGURE_CMDS
> + rm -rf $(@D)/build
> + mkdir -p $(@D)/build
> + $(TARGET_MAKE_ENV) meson $(LIBMPDCLIENT_MESON_OPTS) $(@D) $(@D)/build
> +endef
> +
> +define LIBMPDCLIENT_BUILD_CMDS
> + $(TARGET_MAKE_ENV) ninja -C $(@D)/build
Better change to
$(TARGET_MAKE_ENV) ninja $(if $(VERBOSE),-v) -C $(@D)/build
to honour the buildroot 'make V=1' verbose mode...
Regards,
Peter
> +endef
> +
> +define LIBMPDCLIENT_INSTALL_TARGET_CMDS
> + $(TARGET_MAKE_ENV) DESTDIR=$(TARGET_DIR) ninja -C $(@D)/build install
> +endef
> +
> +$(eval $(generic-package))
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2017-10-21 12:26 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-27 9:55 [Buildroot] [PATCH v2 0/3] Add support for Meson build Jörg Krause
2017-07-27 9:55 ` [Buildroot] [PATCH v3 1/3] meson: new package Jörg Krause
2017-10-08 10:17 ` Yann E. MORIN
2017-10-08 14:42 ` Eric Le Bihan
2017-10-20 19:45 ` Peter Seiderer
2017-07-27 9:55 ` [Buildroot] [PATCH v3 2/3] docs/manual: document meson-based packages Jörg Krause
2017-10-08 10:03 ` Yann E. MORIN
2017-10-08 14:48 ` Eric Le Bihan
2017-10-08 16:48 ` Adrian Perez de Castro
2017-10-08 18:05 ` Yann E. MORIN
2017-07-27 9:55 ` [Buildroot] [PATCH v2 3/3] libmpdclient: bump to version 2.13 Jörg Krause
2017-10-21 12:26 ` Peter Seiderer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox