meson: add entry for libgcrypt-config in cross file
PATCH 1/2 meson: add entry for libgcrypt-config in cross file
Since version 0.49.0 the Meson build system has native support for looking for libgcrypt-config if no pkg-config file is found. As the latest version 1.8.4 of libgcrypt does not provide a .pc file, using libgcrypt-config is the only way for detecting the required libraries when linking agains libgrypt.
The libgcrypt-config entry is necessary for updating package mpd, which switched from the Autotools to the Meson build system when bumping from version 0.20 to 0.21.
--- package/meson/cross-compilation.conf.in | 1 + package/meson/meson.mk | 1 + package/pkg-meson.mk | 1 + 3 files changed, 3 insertions(+)
package/meson/cross-compilation.conf.in +1 -0
@@ -9,6 +9,7 @@ cpp = '@TARGET_CROSS at g++' ar = '@TARGET_CROSS at ar' strip = '@TARGET_CROSS at strip' pkgconfig = '@HOST_DIR@/usr/bin/pkg-config' +libgcrypt-config = '@STAGING_DIR@/usr/bin/libgcrypt-config' [properties] needs_exe_wrapper = true
package/meson/meson.mk +1 -0
@@ -61,6 +61,7 @@ define HOST_MESON_INSTALL_CROSS_CONF -e "s%@TARGET_LDFLAGS@%$(HOST_MESON_SED_LDFLAGS)%g" \ -e "s%@TARGET_CXXFLAGS@%$(HOST_MESON_SED_CXXFLAGS)%g" \ -e "s%@HOST_DIR@%$(HOST_DIR)%g" \ + -e "s%@STAGING_DIR@%$(STAGING_DIR)%g" \ $(HOST_MESON_PKGDIR)/cross-compilation.conf.in \ > $(HOST_DIR)/etc/meson/cross-compilation.conf endef
package/pkg-meson.mk +1 -0
@@ -71,6 +71,7 @@ define $(2)_CONFIGURE_CMDS -e "s%@TARGET_LDFLAGS@%$$(HOST_MESON_SED_LDFLAGS)%g" \ -e "s%@TARGET_CXXFLAGS@%$$(HOST_MESON_SED_CXXFLAGS)%g" \ -e "s%@HOST_DIR@%$$(HOST_DIR)%g" \ + -e "s%@STAGING_DIR@%$$(STAGING_DIR)%g" \ package/meson/cross-compilation.conf.in \ > $$($$(PKG)_SRCDIR)/build/cross-compilation.conf PATH=$$(BR_PATH) $$($$(PKG)_CONF_ENV) $$(MESON) \
Signature · 1 line
2.21.0
PATCH 2/2 package/mpd: bump to version 0.21.7
MPD changed from Autotools to the Meson build system.
Add config options for the qobuz and tidal plugins and group them together with the soundcloud plugin under "Commercial services".
Note, that MPD cannot be build with both Tremor (libvorbis soft float library) and libvorbis (hard float library) support. Therefore, default to Tremor on soft float targets and to libvorbis otherwise.
--- ...gure.ac-check-if-libatomic-is-needed.patch | 40 ---- package/mpd/Config.in | 36 +++- package/mpd/mpd.hash | 2 +- package/mpd/mpd.mk | 175 ++++++++++-------- 4 files changed, 121 insertions(+), 132 deletions(-) delete mode 100644 package/mpd/0001-configure.ac-check-if-libatomic-is-needed.patch
package/mpd/0001-configure.ac-check-if-libatomic-is-needed.patch deleted +0 -40
@@ -1,40 +0,0 @@ -From 8eaf14a17244aaf000b4d19e4fde4a637576939f Mon Sep 17 00:00:00 2001 -From: Thomas Petazzoni <[email protected]> -Date: Sun, 7 Feb 2016 21:40:47 +0100 -Subject: [PATCH] configure.ac: check if libatomic is needed - -The mpd source code uses the C++11 <atomic> functionality, which -internally is implemented using the __atomic_*() gcc built-ins. On -certain architectures, the __atomic_*() built-ins are implemented in -the libatomic library that comes with the rest of the gcc runtime. Due -to this, code using <atomic> might need to link against libatomic, -otherwise one hits build issues such as: - -GlobalEvents.cxx:(.text._ZN12GlobalEvents4EmitENS_5EventE+0x14): undefined reference to `__atomic_fetch_or_4' - -on an architecture like SPARC. - -To solve this, a configure.ac check is added to know if we need to -link against libatomic or not. - -Signed-off-by: Thomas Petazzoni <[email protected]> ---- - configure.ac | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/configure.ac b/configure.ac -index 107b45a..8e6fab7 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -233,6 +233,8 @@ if test x$have_pthread_setname_np = xyes; then - AC_DEFINE(HAVE_PTHREAD_SETNAME_NP, 1, [Is pthread_setname_np() available?]) - fi - -+AC_SEARCH_LIBS([__atomic_load_4], [atomic]) -+ - dnl --------------------------------------------------------------------------- - dnl Event loop selection - dnl --------------------------------------------------------------------------- --- -2.6.4 -
package/mpd/Config.in +27 -9
@@ -9,7 +9,6 @@ menuconfig BR2_PACKAGE_MPD depends on !BR2_TOOLCHAIN_HAS_GCC_BUG_64735 # exception_ptr select BR2_PACKAGE_BOOST select BR2_PACKAGE_LIBICONV if !BR2_ENABLE_LOCALE - select BR2_PACKAGE_MPD_TREMOR if !(BR2_PACKAGE_MPD_MAD || BR2_PACKAGE_MPD_MPG123 || BR2_PACKAGE_MPD_VORBIS || BR2_PACKAGE_MPD_WAVPACK || BR2_PACKAGE_MPD_FLAC || BR2_PACKAGE_MPD_MUSEPACK || BR2_PACKAGE_MPD_FFMPEG) help MPD is a flexible, powerful, server-side application for playing music. Through plugins and libraries
@@ -35,6 +34,29 @@ config BR2_PACKAGE_MPD_SQLITE Enable sqlite database support. If you don't use sqlite it will use an ASCII database. +comment "Commercial services" + +config BR2_PACKAGE_MPD_QOBUZ + bool "qobuz" + select BR2_PACKAGE_MPD_CURL + select BR2_PACKAGE_LIBGCRYPT + select BR2_PACKAGE_YAJL + help + Play songs from the commercial streaming service Qobuz. + +config BR2_PACKAGE_MPD_SOUNDCLOUD + bool "soundcloud" + select BR2_PACKAGE_YAJL + help + Enable soundcloud.com playlist support. + +config BR2_PACKAGE_MPD_TIDAL + bool "tidal" + select BR2_PACKAGE_MPD_CURL + select BR2_PACKAGE_YAJL + help + Play songs from the commercial streaming service TIDAL. + comment "Converter plugins" config BR2_PACKAGE_MPD_LIBSAMPLERATE
@@ -132,18 +154,20 @@ config BR2_PACKAGE_MPD_OPUS Select this if you want to play back OPUS encoded files. config BR2_PACKAGE_MPD_TREMOR - bool "tremor" + bool "tremor" if BR2_SOFT_FLOAT select BR2_PACKAGE_LIBOGG select BR2_PACKAGE_TREMOR + default y if BR2_SOFT_FLOAT help Enable vorbis input support. Select this if you want to play back OGG files on softfloat targets. config BR2_PACKAGE_MPD_VORBIS - bool "vorbis" + bool "vorbis" if !BR2_SOFT_FLOAT select BR2_PACKAGE_LIBOGG select BR2_PACKAGE_LIBVORBIS + default y if !BR2_SOFT_FLOAT help Enable vorbis input/streaming support. Select this if you want to play back OGG files on hardfloat
@@ -217,12 +241,6 @@ config BR2_PACKAGE_MPD_LIBSMBCLIENT help Enable Samba support. -config BR2_PACKAGE_MPD_SOUNDCLOUD - bool "soundcloud" - select BR2_PACKAGE_YAJL - help - Enable soundcloud.com playlist support. - comment "Output plugins" config BR2_PACKAGE_MPD_ALSA
package/mpd/mpd.hash +1 -1
@@ -1,3 +1,3 @@ # Locally calculated after checking pgp signature -sha256 503e5f9f237290f568ff7956ab2f9aed563594bf749f19b8fe994fb21434afea mpd-0.20.23.tar.xz +sha256 512062bc529bee04d4ccfaa2c6e720afc85bb071e49850a096b5ed518b3b412c mpd-0.21.7.tar.xz sha256 ab15fd526bd8dd18a9e77ebc139656bf4d33e97fc7238cd11bf60e2b9b8666c6 COPYING
package/mpd/mpd.mk +93 -82
375 lines not on this page · raw message
Signature · 1 line
2.21.0
PATCH 1/2 meson: add entry for libgcrypt-config in cross file
In reply to Jörg KrauseHello,
Quoted 22 lines · On Wed, 3 Apr 2019 20:32:01 +0200 J?rg Krause <[email protected]>…
Since version 0.49.0 the Meson build system has native support for looking for
libgcrypt-configif no pkg-config file is found. As the latest version 1.8.4 of libgcrypt does not provide a .pc file, usinglibgcrypt-configis the only way for detecting the required libraries when linking agains libgrypt.The
libgcrypt-configentry is necessary for updating package mpd, which switched from the Autotools to the Meson build system when bumping from version 0.20 to 0.21.Signed-off-by J?rg Krause <[email protected]>--- package/meson/cross-compilation.conf.in | 1 + package/meson/meson.mk | 1 + package/pkg-meson.mk | 1 + 3 files changed, 3 insertions(+)package/meson/cross-compilation.conf.in +0
-0
package/meson/cross-compilation.conf.in cpp = '@TARGET_CROSS at g++' · line 12
Quoted 4 lines
package/meson/cross-compilation.conf.in +1
-0@@ -9,6 +9,7 @@ cpp = '@TARGET_CROSS at g++' ar = '@TARGET_CROSS at ar' strip = '@TARGET_CROSS at strip' pkgconfig = '@HOST_DIR@/usr/bin/pkg-config' +libgcrypt-config = '@STAGING_DIR@/usr/bin/libgcrypt-config'
Hm, this is a bit annoying. We really have no other solution but to pass this through cross-compilation.conf ? It cannot be passed on the meson command line, on a per-package basis, like we do for the autotools ?
Thanks,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH 1/2 meson: add entry for libgcrypt-config in cross file
Hello,
Am Mittwoch, den 03.04.2019, 21:33 +0200 schrieb Thomas Petazzoni:
Quoted 22 lines
Hello,
Quoted 17 lines · On Wed, 3 Apr 2019 20:32:01 +0200 J?rg Krause <[email protected]>…
Since version 0.49.0 the Meson build system has native support for looking for
libgcrypt-configif no pkg-config file is found. As the latest version 1.8.4 of libgcrypt does not provide a .pc file, usinglibgcrypt-configis the only way for detecting the required libraries when linking agains libgrypt.The
libgcrypt-configentry is necessary for updating package mpd, which switched from the Autotools to the Meson build system when bumping from version 0.20 to 0.21.Signed-off-by J?rg Krause <[email protected]>--- package/meson/cross-compilation.conf.in | 1 + package/meson/meson.mk | 1 + package/pkg-meson.mk | 1 + 3 files changed, 3 insertions(+)
Quoted 13 lines
package/meson/cross-compilation.conf.in cpp = '@TARGET_CROSS at g++' · line 12
Quoted 9 lines
package/meson/cross-compilation.conf.in +1
-0@@ -9,6 +9,7 @@ cpp = '@TARGET_CROSS at g++' ar = '@TARGET_CROSS at ar' strip = '@TARGET_CROSS at strip' pkgconfig = '@HOST_DIR@/usr/bin/pkg-config' +libgcrypt-config = '@STAGING_DIR@/usr/bin/libgcrypt-config'Hm, this is a bit annoying. We really have no other solution but to pass this through cross-compilation.conf ? It cannot be passed on the meson command line, on a per-package basis, like we do for the autotools ?
I am not a Meson expert, but I did not find any options howto pass libgcrypt-config path through the command line.
Best regards
J?rg Krause
PATCH 1/2 meson: add entry for libgcrypt-config in cross file
In reply to Jörg KrauseHello J?rg,
+Peter Seiderer in Cc.
Quoted 11 lines · On Wed, 3 Apr 2019 20:32:01 +0200 J?rg Krause <[email protected]>…
Since version 0.49.0 the Meson build system has native support for looking for
libgcrypt-configif no pkg-config file is found. As the latest version 1.8.4 of libgcrypt does not provide a .pc file, usinglibgcrypt-configis the only way for detecting the required libraries when linking agains libgrypt.The
libgcrypt-configentry is necessary for updating package mpd, which switched from the Autotools to the Meson build system when bumping from version 0.20 to 0.21.Signed-off-by J?rg Krause <[email protected]>
As I said in my previous reply, I'm not too happy with this libgcrypt-config variable creeping into the global cross-compilation file. Can we instead look at extending what Peter Seiderer is doing in
http://patchwork.ozlabs.org/patch/1081486/ and allow some per-package additions to the per-package cross-compilation file ? Peter's patch does it for CFLAGS/CXXFLAGS/LDFLAGS, we could perhaps do the same with arbitrary program paths ?
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH 1/2 meson: add entry for libgcrypt-config in cross file
Hello J?rg, Thomas,
Quoted 19 lines · Thomas Petazzoni
Hello J?rg,
+Peter Seiderer in Cc.
Quoted 11 lines · On Wed, 3 Apr 2019 20:32:01 +0200 J?rg Krause <[email protected]>…
Since version 0.49.0 the Meson build system has native support for looking for
libgcrypt-configif no pkg-config file is found. As the latest version 1.8.4 of libgcrypt does not provide a .pc file, usinglibgcrypt-configis the only way for detecting the required libraries when linking agains libgrypt.The
libgcrypt-configentry is necessary for updating package mpd, which switched from the Autotools to the Meson build system when bumping from version 0.20 to 0.21.Signed-off-by J?rg Krause <[email protected]>
Quoted 7 lines
As I said in my previous reply, I'm not too happy with this libgcrypt-config variable creeping into the global cross-compilation file. Can we instead look at extending what Peter Seiderer is doing in
http://patchwork.ozlabs.org/patch/1081486/ and allow some per-package additions to the per-package cross-compilation file ? Peter's patch does it for CFLAGS/CXXFLAGS/LDFLAGS, we could perhaps do the same with arbitrary program paths ?
Something like the following (draft) should work:
package/meson/cross-compilation.conf.in +1 -0
@@ -9,6 +9,7 @@ cpp = '@TARGET_CROSS at g++' ar = '@TARGET_CROSS at ar' strip = '@TARGET_CROSS at strip' pkgconfig = '@HOST_DIR@/usr/bin/pkg-config' + at PKG_TARGET_BINARIES@ [properties] needs_exe_wrapper = true
package/meson/meson.mk +1 -0
@@ -60,6 +60,7 @@ define HOST_MESON_INSTALL_CROSS_CONF -e "s%@TARGET_CFLAGS@%$(HOST_MESON_SED_CFLAGS)%g" \ -e "s%@TARGET_LDFLAGS@%$(HOST_MESON_SED_LDFLAGS)%g" \ -e "s%@TARGET_CXXFLAGS@%$(HOST_MESON_SED_CXXFLAGS)%g" \ + -e "s%@PKG_TARGET_BINARIES@%%g" \ -e "s%@PKG_TARGET_CFLAGS@%%g" \ -e "s%@PKG_TARGET_LDFLAGS@%%g" \ -e "s%@PKG_TARGET_CXXFLAGS@%%g" \
package/pkg-meson.mk +1 -0
@@ -74,6 +74,7 @@ define $(2)_CONFIGURE_CMDS -e "s%@TARGET_CFLAGS@%$$(HOST_MESON_SED_CFLAGS)%g" \ -e "s%@TARGET_LDFLAGS@%$$(HOST_MESON_SED_LDFLAGS)%g" \ -e "s%@TARGET_CXXFLAGS@%$$(HOST_MESON_SED_CXXFLAGS)%g" \ + -e "s%@PKG_TARGET_BINARIES@%$$($$(PKG)_MESON_BINARIES)%g" \ -e "s%@PKG_TARGET_CFLAGS@%$$($$(PKG)_MESON_SED_CFLAGS)%g" \ -e "s%@PKG_TARGET_LDFLAGS@%$$($$(PKG)_MESON_SED_LDFLAGS)%g" \ -e "s%@PKG_TARGET_CXXFLAGS@%$$($$(PKG)_MESON_SED_CXXFLAGS)%g" \
and with:
MPD_MESON_BINARIES = libgcrypt-config = '$(STAGING_DIR)/usr/bin/libgcrypt-config'
Regards,
Peter
Quoted 4 lines
Thanks!
Thomas
PATCH 1/2 meson: add entry for libgcrypt-config in cross file
Hello Peter,
Quoted 71 lines · Peter Seiderer
Hello J?rg, Thomas,
Quoted 19 lines · Thomas Petazzoni
Hello J?rg,
+Peter Seiderer in Cc.
Quoted 11 lines · On Wed, 3 Apr 2019 20:32:01 +0200 J?rg Krause <[email protected]>…
Since version 0.49.0 the Meson build system has native support for looking for
libgcrypt-configif no pkg-config file is found. As the latest version 1.8.4 of libgcrypt does not provide a .pc file, usinglibgcrypt-configis the only way for detecting the required libraries when linking agains libgrypt.The
libgcrypt-configentry is necessary for updating package mpd, which switched from the Autotools to the Meson build system when bumping from version 0.20 to 0.21.Signed-off-by J?rg Krause <[email protected]>Quoted 7 lines
As I said in my previous reply, I'm not too happy with this libgcrypt-config variable creeping into the global cross-compilation file. Can we instead look at extending what Peter Seiderer is doing in
http://patchwork.ozlabs.org/patch/1081486/ and allow some per-package additions to the per-package cross-compilation file ? Peter's patch does it for CFLAGS/CXXFLAGS/LDFLAGS, we could perhaps do the same with arbitrary program paths ?Something like the following (draft) should work:
package/meson/cross-compilation.conf.in +1
-0@@ -9,6 +9,7 @@ cpp = '@TARGET_CROSS at g++' ar = '@TARGET_CROSS at ar' strip = '@TARGET_CROSS at strip' pkgconfig = '@HOST_DIR@/usr/bin/pkg-config' + at PKG_TARGET_BINARIES@ [properties] needs_exe_wrapper = truepackage/meson/meson.mk +1
-0@@ -60,6 +60,7 @@ define HOST_MESON_INSTALL_CROSS_CONF -e "s%@TARGET_CFLAGS@%$(HOST_MESON_SED_CFLAGS)%g" \ -e "s%@TARGET_LDFLAGS@%$(HOST_MESON_SED_LDFLAGS)%g" \ -e "s%@TARGET_CXXFLAGS@%$(HOST_MESON_SED_CXXFLAGS)%g" \ + -e "s%@PKG_TARGET_BINARIES@%%g" \ -e "s%@PKG_TARGET_CFLAGS@%%g" \ -e "s%@PKG_TARGET_LDFLAGS@%%g" \ -e "s%@PKG_TARGET_CXXFLAGS@%%g" \package/pkg-meson.mk +1
-0@@ -74,6 +74,7 @@ define $(2)_CONFIGURE_CMDS -e "s%@TARGET_CFLAGS@%$$(HOST_MESON_SED_CFLAGS)%g" \ -e "s%@TARGET_LDFLAGS@%$$(HOST_MESON_SED_LDFLAGS)%g" \ -e "s%@TARGET_CXXFLAGS@%$$(HOST_MESON_SED_CXXFLAGS)%g" \ + -e "s%@PKG_TARGET_BINARIES@%$$($$(PKG)_MESON_BINARIES)%g" \ -e "s%@PKG_TARGET_CFLAGS@%$$($$(PKG)_MESON_SED_CFLAGS)%g" \ -e "s%@PKG_TARGET_LDFLAGS@%$$($$(PKG)_MESON_SED_LDFLAGS)%g" \ -e "s%@PKG_TARGET_CXXFLAGS@%$$($$(PKG)_MESON_SED_CXXFLAGS)%g" \
Quoted 3 lines
and with:
MPD_MESON_BINARIES= libgcrypt-config = '$(STAGING_DIR)/usr/bin/libgcrypt-config'
Looks good to me. I will test and send an updated patch if Thomas agrees.
J?rg
PATCH 1/2 meson: add entry for libgcrypt-config in cross file
In reply to Peter SeidererHi Peter,
Quoted 71 lines · Peter Seiderer
Hello J?rg, Thomas,
Quoted 19 lines · Thomas Petazzoni
Hello J?rg,
+Peter Seiderer in Cc.
Quoted 11 lines · On Wed, 3 Apr 2019 20:32:01 +0200 J?rg Krause <[email protected]>…
Since version 0.49.0 the Meson build system has native support for looking for
libgcrypt-configif no pkg-config file is found. As the latest version 1.8.4 of libgcrypt does not provide a .pc file, usinglibgcrypt-configis the only way for detecting the required libraries when linking agains libgrypt.The
libgcrypt-configentry is necessary for updating package mpd, which switched from the Autotools to the Meson build system when bumping from version 0.20 to 0.21.Signed-off-by J?rg Krause <[email protected]>Quoted 7 lines
As I said in my previous reply, I'm not too happy with this libgcrypt-config variable creeping into the global cross-compilation file. Can we instead look at extending what Peter Seiderer is doing in
http://patchwork.ozlabs.org/patch/1081486/ and allow some per-package additions to the per-package cross-compilation file ? Peter's patch does it for CFLAGS/CXXFLAGS/LDFLAGS, we could perhaps do the same with arbitrary program paths ?Something like the following (draft) should work:
package/meson/cross-compilation.conf.in +1
-0@@ -9,6 +9,7 @@ cpp = '@TARGET_CROSS at g++' ar = '@TARGET_CROSS at ar' strip = '@TARGET_CROSS at strip' pkgconfig = '@HOST_DIR@/usr/bin/pkg-config' + at PKG_TARGET_BINARIES@ [properties] needs_exe_wrapper = truepackage/meson/meson.mk +1
-0@@ -60,6 +60,7 @@ define HOST_MESON_INSTALL_CROSS_CONF -e "s%@TARGET_CFLAGS@%$(HOST_MESON_SED_CFLAGS)%g" \ -e "s%@TARGET_LDFLAGS@%$(HOST_MESON_SED_LDFLAGS)%g" \ -e "s%@TARGET_CXXFLAGS@%$(HOST_MESON_SED_CXXFLAGS)%g" \ + -e "s%@PKG_TARGET_BINARIES@%%g" \ -e "s%@PKG_TARGET_CFLAGS@%%g" \ -e "s%@PKG_TARGET_LDFLAGS@%%g" \ -e "s%@PKG_TARGET_CXXFLAGS@%%g" \package/pkg-meson.mk +1
-0@@ -74,6 +74,7 @@ define $(2)_CONFIGURE_CMDS -e "s%@TARGET_CFLAGS@%$$(HOST_MESON_SED_CFLAGS)%g" \ -e "s%@TARGET_LDFLAGS@%$$(HOST_MESON_SED_LDFLAGS)%g" \ -e "s%@TARGET_CXXFLAGS@%$$(HOST_MESON_SED_CXXFLAGS)%g" \ + -e "s%@PKG_TARGET_BINARIES@%$$($$(PKG)_MESON_BINARIES)%g" \ -e "s%@PKG_TARGET_CFLAGS@%$$($$(PKG)_MESON_SED_CFLAGS)%g" \ -e "s%@PKG_TARGET_LDFLAGS@%$$($$(PKG)_MESON_SED_LDFLAGS)%g" \ -e "s%@PKG_TARGET_CXXFLAGS@%$$($$(PKG)_MESON_SED_CXXFLAGS)%g" \
Quoted 3 lines
and with:
MPD_MESON_BINARIES= libgcrypt-config = '$(STAGING_DIR)/usr/bin/libgcrypt-config'
I've just tested your draft. This still inserts libgcrypt-config in the global cross-compilation.conf.
I will send an updated version of the patch which does insert libgcrypt-config in the package cross file, but not in the global cross file.
Many thanks!
J?rg
PATCH 1/2 meson: add entry for libgcrypt-config in cross file
Hello J?rg,
Quoted 80 lines
Gesendet: Dienstag, 30. April 2019 um 10:11 Uhr
Von: "J?rg Krause" <[email protected]>
An: "Peter Seiderer" <[email protected]>, "Thomas Petazzoni" <[email protected]>
Cc: buildroot at buildroot.org
Betreff: Re: [Buildroot] [PATCH 1/2] meson: add entry for libgcrypt-config in cross fileHi Peter,
Quoted 71 lines · Peter Seiderer
Hello J?rg, Thomas,
Quoted 19 lines · Thomas Petazzoni
Hello J?rg,
+Peter Seiderer in Cc.
Quoted 11 lines · On Wed, 3 Apr 2019 20:32:01 +0200 J?rg Krause <[email protected]>…
Since version 0.49.0 the Meson build system has native support for looking for
libgcrypt-configif no pkg-config file is found. As the latest version 1.8.4 of libgcrypt does not provide a .pc file, usinglibgcrypt-configis the only way for detecting the required libraries when linking agains libgrypt.The
libgcrypt-configentry is necessary for updating package mpd, which switched from the Autotools to the Meson build system when bumping from version 0.20 to 0.21.Signed-off-by J?rg Krause <[email protected]>Quoted 7 lines
As I said in my previous reply, I'm not too happy with this libgcrypt-config variable creeping into the global cross-compilation file. Can we instead look at extending what Peter Seiderer is doing in
http://patchwork.ozlabs.org/patch/1081486/ and allow some per-package additions to the per-package cross-compilation file ? Peter's patch does it for CFLAGS/CXXFLAGS/LDFLAGS, we could perhaps do the same with arbitrary program paths ?Something like the following (draft) should work:
package/meson/cross-compilation.conf.in +1
-0@@ -9,6 +9,7 @@ cpp = '@TARGET_CROSS at g++' ar = '@TARGET_CROSS at ar' strip = '@TARGET_CROSS at strip' pkgconfig = '@HOST_DIR@/usr/bin/pkg-config' + at PKG_TARGET_BINARIES@ [properties] needs_exe_wrapper = truepackage/meson/meson.mk +1
-0@@ -60,6 +60,7 @@ define HOST_MESON_INSTALL_CROSS_CONF -e "s%@TARGET_CFLAGS@%$(HOST_MESON_SED_CFLAGS)%g" \ -e "s%@TARGET_LDFLAGS@%$(HOST_MESON_SED_LDFLAGS)%g" \ -e "s%@TARGET_CXXFLAGS@%$(HOST_MESON_SED_CXXFLAGS)%g" \ + -e "s%@PKG_TARGET_BINARIES@%%g" \ -e "s%@PKG_TARGET_CFLAGS@%%g" \ -e "s%@PKG_TARGET_LDFLAGS@%%g" \ -e "s%@PKG_TARGET_CXXFLAGS@%%g" \package/pkg-meson.mk +1
-0@@ -74,6 +74,7 @@ define $(2)_CONFIGURE_CMDS -e "s%@TARGET_CFLAGS@%$$(HOST_MESON_SED_CFLAGS)%g" \ -e "s%@TARGET_LDFLAGS@%$$(HOST_MESON_SED_LDFLAGS)%g" \ -e "s%@TARGET_CXXFLAGS@%$$(HOST_MESON_SED_CXXFLAGS)%g" \ + -e "s%@PKG_TARGET_BINARIES@%$$($$(PKG)_MESON_BINARIES)%g" \ -e "s%@PKG_TARGET_CFLAGS@%$$($$(PKG)_MESON_SED_CFLAGS)%g" \ -e "s%@PKG_TARGET_LDFLAGS@%$$($$(PKG)_MESON_SED_LDFLAGS)%g" \ -e "s%@PKG_TARGET_CXXFLAGS@%$$($$(PKG)_MESON_SED_CXXFLAGS)%g" \
Quoted 6 lines
Quoted 3 lines
and with:
MPD_MESON_BINARIES= libgcrypt-config = '$(STAGING_DIR)/usr/bin/libgcrypt-config'I've just tested your draft. This still inserts libgcrypt-config in the global cross-compilation.conf.
Are you sure? The
+ -e "s%@PKG_TARGET_BINARIES@%%g"
in package/meson/meson.mk should not add anything to the global file...
Would have expected the trick/non-trivial thing to add more than one binary entry (to get the newlines for the entries right)...
Regards,
Peter
Quoted 10 lines
I will send an updated version of the patch which does insert libgcrypt-config in the package cross file, but not in the global cross file.
Many thanks!
J?rg
PATCH 1/2 meson: add entry for libgcrypt-config in cross file
Hello Peter,
Quoted 89 lines · Peter Seiderer
Hello J?rg,
Quoted 80 lines
Gesendet: Dienstag, 30. April 2019 um 10:11 Uhr
Von: "J?rg Krause" <[email protected]>
An: "Peter Seiderer" <[email protected]>, "Thomas Petazzoni" <[email protected]>
Cc: buildroot at buildroot.org
Betreff: Re: [Buildroot] [PATCH 1/2] meson: add entry for libgcrypt-config in cross fileHi Peter,
Quoted 71 lines · Peter Seiderer
Hello J?rg, Thomas,
Quoted 19 lines · Thomas Petazzoni
Hello J?rg,
+Peter Seiderer in Cc.
Quoted 11 lines · On Wed, 3 Apr 2019 20:32:01 +0200 J?rg Krause <[email protected]>…
Since version 0.49.0 the Meson build system has native support for looking for
libgcrypt-configif no pkg-config file is found. As the latest version 1.8.4 of libgcrypt does not provide a .pc file, usinglibgcrypt-configis the only way for detecting the required libraries when linking agains libgrypt.The
libgcrypt-configentry is necessary for updating package mpd, which switched from the Autotools to the Meson build system when bumping from version 0.20 to 0.21.Signed-off-by J?rg Krause <[email protected]>Quoted 7 lines
As I said in my previous reply, I'm not too happy with this libgcrypt-config variable creeping into the global cross-compilation file. Can we instead look at extending what Peter Seiderer is doing in
http://patchwork.ozlabs.org/patch/1081486/ and allow some per-package additions to the per-package cross-compilation file ? Peter's patch does it for CFLAGS/CXXFLAGS/LDFLAGS, we could perhaps do the same with arbitrary program paths ?Something like the following (draft) should work:
package/meson/cross-compilation.conf.in +1
-0@@ -9,6 +9,7 @@ cpp = '@TARGET_CROSS at g++' ar = '@TARGET_CROSS at ar' strip = '@TARGET_CROSS at strip' pkgconfig = '@HOST_DIR@/usr/bin/pkg-config' + at PKG_TARGET_BINARIES@ [properties] needs_exe_wrapper = truepackage/meson/meson.mk +1
-0@@ -60,6 +60,7 @@ define HOST_MESON_INSTALL_CROSS_CONF -e "s%@TARGET_CFLAGS@%$(HOST_MESON_SED_CFLAGS)%g" \ -e "s%@TARGET_LDFLAGS@%$(HOST_MESON_SED_LDFLAGS)%g" \ -e "s%@TARGET_CXXFLAGS@%$(HOST_MESON_SED_CXXFLAGS)%g" \ + -e "s%@PKG_TARGET_BINARIES@%%g" \ -e "s%@PKG_TARGET_CFLAGS@%%g" \ -e "s%@PKG_TARGET_LDFLAGS@%%g" \ -e "s%@PKG_TARGET_CXXFLAGS@%%g" \package/pkg-meson.mk +1
-0@@ -74,6 +74,7 @@ define $(2)_CONFIGURE_CMDS -e "s%@TARGET_CFLAGS@%$$(HOST_MESON_SED_CFLAGS)%g" \ -e "s%@TARGET_LDFLAGS@%$$(HOST_MESON_SED_LDFLAGS)%g" \ -e "s%@TARGET_CXXFLAGS@%$$(HOST_MESON_SED_CXXFLAGS)%g" \ + -e "s%@PKG_TARGET_BINARIES@%$$($$(PKG)_MESON_BINARIES)%g" \ -e "s%@PKG_TARGET_CFLAGS@%$$($$(PKG)_MESON_SED_CFLAGS)%g" \ -e "s%@PKG_TARGET_LDFLAGS@%$$($$(PKG)_MESON_SED_LDFLAGS)%g" \ -e "s%@PKG_TARGET_CXXFLAGS@%$$($$(PKG)_MESON_SED_CXXFLAGS)%g" \Quoted 6 lines
Quoted 3 lines
and with:
MPD_MESON_BINARIES= libgcrypt-config = '$(STAGING_DIR)/usr/bin/libgcrypt-config'I've just tested your draft. This still inserts libgcrypt-config in the global cross-compilation.conf.
Quoted 5 lines
Are you sure? The
+ -e "s%@PKG_TARGET_BINARIES@%%g"
in
package/meson/meson.mkshould not add anything to the global file...
You're right! I missed that line, sorry.
Quoted 2 lines
Would have expected the trick/non-trivial thing to add more than one binary entry (to get the newlines for the entries right)...
That's indeed a difficult case to solve. I didn't managed to get multpile binary entries added to the [binaries] field, e.g.
PKG_TARGET_BINARIES = \ libgcrypt-config = '...' \ llvm-config = '...'
.. will not work.
I spent some time to find a magic rule which splits the Makefile variable into a proper newline seperated string which can be used by sed, but I failed.
Maybe you have an idea?
Best regards
J?rg Krause
PATCH 1/2 meson: add entry for libgcrypt-config in cross file
Quoted 3 lines · J?rg Krause
Hello Peter,
On Tue, 2019-04-30 at 10:27 +0200, Peter Seiderer wrote:
[snip]
Quoted 10 lines
Quoted 2 lines
Would have expected the trick/non-trivial thing to add more than one binary entry (to get the newlines for the entries right)...
That's indeed a difficult case to solve. I didn't managed to get multpile binary entries added to the [binaries] field, e.g.
PKG_TARGET_BINARIES = \ libgcrypt-config = '...' \ llvm-config = '...'
Quoted 7 lines
.. will not work.
I spent some time to find a magic rule which splits the
Makefilevariable into a proper newline seperated string which can be used by sed, but I failed.Maybe you have an idea?
Instead of sed, use the PRINTF macro and append to the file:
$Q$$(if $$($$(PKG)_TARGET_BINARIES),\ $$(call PRINTF,$$($$(PKG)_TARGET_BINARIES)) \ >> $$($$(PKG)_SRCDIR)/build/cross-compilation.conf
Completely unrelated to this, but I notice now some things in that pkg-meson.mk
that make me wonder what our coding style is in pkg-infra.mk files... Adding Yann and Eric in Cc for that.
- We usually use $(2), but here it's $$(PKG). Recently there was a patch that changed the $(PKG) back to $(2) in the download infra. So I think we really should be using $(2).
- meson infra builds in PKG_SRCDIR/build. That really should be PKG_BUILDDIR, with a default of $(2)_BUILDDIR ?= $$($(2)_SRCDIR)/build.
- I don't think it's appropriate to generate the cross-compilation.conf file in PKG_BUILDDIR. I think it should be at top level, i.e. $(@D).
Regards,
Arnout
PATCH 1/2 meson: add entry for libgcrypt-config in cross file
Hello Arnout,
Quoted 21 lines · Arnout Vandecappelle
Quoted 3 lines · J?rg Krause
Hello Peter,
On Tue, 2019-04-30 at 10:27 +0200, Peter Seiderer wrote:
[snip]
Quoted 16 lines
Quoted 2 lines
Would have expected the trick/non-trivial thing to add more than one binary entry (to get the newlines for the entries right)...
That's indeed a difficult case to solve. I didn't managed to get multpile binary entries added to the [binaries] field, e.g.
PKG_TARGET_BINARIES = \ libgcrypt-config = '...' \ llvm-config = '...'.. will not work.
I spent some time to find a magic rule which splits the
Makefilevariable into a proper newline seperated string which can be used by sed, but I failed.
Quoted 7 lines
Quoted 1 line
Maybe you have an idea?
Instead of sed, use the PRINTF macro and append to the file:
$Q$$(if $$($$(PKG)_TARGET_BINARIES),\ $$(call PRINTF,$$($$(PKG)_TARGET_BINARIES)) \ >> $$($$(PKG)_SRCDIR)/build/cross-compilation.conf
Simple appending will not work, the extra binaries must be under the '[binaries]' section (maybe reordering the sections in the cross-compilation.conf.in template will work), does the printf approach fix the newline problem for more than one entry?
Quoted 9 lines
Completely unrelated to this, but I notice now some things in that pkg-meson.mk
that make me wonder what our coding style is in pkg-infra.mk files... Adding Yann and Eric in Cc for that.- We usually use $(2), but here it's $$(PKG). Recently there was a patch that changed the $(PKG) back to $(2) in the download infra. So I think we really should be using $(2).
Any link to the relevant patch? Can test/rework my patch/pkg-meson.mk in case...
Quoted 3 lines
- meson infra builds in PKG_SRCDIR/build. That really should be
PKG_BUILDDIR, with a default of $(2)_BUILDDIR ?= $$($(2)_SRCDIR)/build.
O.k.
Quoted 3 lines
- I don't think it's appropriate to generate the cross-compilation.conf file in
PKG_BUILDDIR. I think it should be at top level, i.e. $(@D).
Why (I think more a matter of taste?)? With cross-compilation.conf in PKG_BUILDDIR (or in other words build) it is automatically removed/refreshed by pkg-meson.mk (see the rm command in the configure step) and there is no danger of potentially collision with an already source package provided version?
Regards,
Peter
Quoted 4 lines
Regards,
Arnout
PATCH 1/2 meson: add entry for libgcrypt-config in cross file
Quoted 29 lines · Peter Seiderer
Hello Arnout,
Quoted 25 lines · Arnout Vandecappelle
Quoted 3 lines · J?rg Krause
Hello Peter,
On Tue, 2019-04-30 at 10:27 +0200, Peter Seiderer wrote:
[snip]
Quoted 10 lines
Quoted 2 lines
Would have expected the trick/non-trivial thing to add more than one binary entry (to get the newlines for the entries right)...
That's indeed a difficult case to solve. I didn't managed to get multpile binary entries added to the [binaries] field, e.g.
PKG_TARGET_BINARIES = \ libgcrypt-config = '...' \ llvm-config = '...'Quoted 7 lines
.. will not work.
I spent some time to find a magic rule which splits the
Makefilevariable into a proper newline seperated string which can be used by sed, but I failed.Maybe you have an idea?
Instead of sed, use the PRINTF macro and append to the file:
Quoted 7 lines
Quoted 3 lines
$Q$$(if $$($$(PKG)_TARGET_BINARIES),\ $$(call PRINTF,$$($$(PKG)_TARGET_BINARIES)) \ >> $$($$(PKG)_SRCDIR)/build/cross-compilation.confSimple appending will not work, the extra binaries must be under the '[binaries]' section (maybe reordering the sections in the cross-compilation.conf.in template will work)
It should work if the [binaries] part is at the end, right? And if binaries is
empty, that's OK, no?
Alternatively, the [binaries] part could be included in the _TARGET_BINARIES
(which would then have to be renamed to _CROSS_COMPILATION_CONF). So for a package that needs libgcrypt-config, it would be
define FOO_CROSS_COMPILATION_CONF
[binaries]
libgcrypt-config = '$(STAGING_DIR)/usr/bin/libgcrypt-config' endef
Quoted 2 lines
, does the printf approach fix the newline problem for more than one entry?
It does, but you can't use _CROSS_COMPILATION_CONF = ..., you have to use
define, because the actual newlines have to be in the variable itself. Actually, you can still use = assignment, but then you need to use $(sep), i.e.:
FOO_CROSS_COMPILATION_CONF = [binaries]$(sep)libgcrypt-config = '$(STAGING_DIR)/usr/bin/libgcrypt-config'$(sep)
(which is ugly so don't do that :-)
Quoted 7 lines
Quoted 7 lines
Completely unrelated to this, but I notice now some things in that pkg-meson.mk
that make me wonder what our coding style is in pkg-infra.mk files... Adding Yann and Eric in Cc for that.
Quoted 5 lines
Quoted 3 lines
- We usually use $(2), but here it's $$(PKG). Recently there was a patch that changed the $(PKG) back to $(2) in the download infra. So I think we really should be using $(2).
Any link to the relevant patch? Can test/rework my
patch/pkg-meson.mkin case...
5a0d6813948fea2cdb88a2e35984520eec856dec
Note that the reasons for doing it in that patch don't apply here. However, I
feel it is better/easier to have a general rule to always do things the same way, which is diverged from only in specific cases when there is a good reason to diverge. Like we have the rule that in macros which get $(eval)'ed, we always use $$ (even though it's really needed only in a small minority of the instances).
It doesn't really matter which one we choose, $(PKG) or $(2), as long as it is
done consistently.
The advantage of $(PKG) is that it can be used in contexts where you don't have
a $(2). The advantage of $(2) is that it is less surprising - by the time $(PKG) gets expanded, it's hard to be sure which value it has (depends on the rule within which it is expanded).
Quoted 6 lines
Quoted 2 lines
- meson infra builds in PKG_SRCDIR/build. That really should be
PKG_BUILDDIR, with a default of $(2)_BUILDDIR ?= $$($(2)_SRCDIR)/build.O.k.
Quoted 1 line
Quoted 7 lines
Quoted 2 lines
- I don't think it's appropriate to generate the cross-compilation.conf file in
PKG_BUILDDIR. I think it should be at top level, i.e. $(@D).Why (I think more a matter of taste?)? With cross-compilation.conf in
PKG_BUILDDIR(or in other words build) it is automatically removed/refreshed by pkg-meson.mk (see the rm command in the configure step) and there is no danger of potentially collision with an already source package provided version?
It's a matter of taste unless there are additional reasons, and you gave
additional reasons, so it's no longer a matter of taste :-) Let's keep it in BUILDDIR.
Regards,
Arnout
PATCH 1/2 meson: add entry for libgcrypt-config in cross file
Hello Arnout,
Quoted 41 lines · Arnout Vandecappelle
Quoted 29 lines · Peter Seiderer
Hello Arnout,
Quoted 25 lines · Arnout Vandecappelle
Quoted 3 lines · J?rg Krause
Hello Peter,
On Tue, 2019-04-30 at 10:27 +0200, Peter Seiderer wrote:
[snip]
Quoted 10 lines
Quoted 2 lines
Would have expected the trick/non-trivial thing to add more than one binary entry (to get the newlines for the entries right)...
That's indeed a difficult case to solve. I didn't managed to get multpile binary entries added to the [binaries] field, e.g.
PKG_TARGET_BINARIES = \ libgcrypt-config = '...' \ llvm-config = '...'Quoted 7 lines
.. will not work.
I spent some time to find a magic rule which splits the
Makefilevariable into a proper newline seperated string which can be used by sed, but I failed.Maybe you have an idea?
Instead of sed, use the PRINTF macro and append to the file:
Quoted 7 lines
Quoted 3 lines
$Q$$(if $$($$(PKG)_TARGET_BINARIES),\ $$(call PRINTF,$$($$(PKG)_TARGET_BINARIES)) \ >> $$($$(PKG)_SRCDIR)/build/cross-compilation.confSimple appending will not work, the extra binaries must be under the '[binaries]' section (maybe reordering the sections in the cross-compilation.conf.in template will work)
It should work if the [binaries] part is at the end, right? And if binaries is
empty, that's OK, no?
Quoted 8 lines
Alternatively, the [binaries] part could be included in the
_TARGET_BINARIES
(which would then have to be renamed to_CROSS_COMPILATION_CONF). So for a package that needs libgcrypt-config, it would bedefine
FOO_CROSS_COMPILATION_CONF
[binaries]
libgcrypt-config = '$(STAGING_DIR)/usr/bin/libgcrypt-config' endef
With this and the printf approach I get the following in the cross-compilation.conf file (mind the leading spaces in the binaries line):
[host_machine]
system = 'linux'cpu_family ='arm'
cpu = 'cortex-a53'
endian = 'little'
[binaries]
libgcrypt-config = '.../host/arm-buildroot-linux-gnueabihf/sysroot/usr/bin/libgcrypt-config'
And meson complains with:
ERROR: Malformed value in cross file variable endian.
Regards,
Peter
Quoted 69 lines
Quoted 3 lines
, does the printf approach fix the newline problem for more than one entry?
It does, but you can't use
_CROSS_COMPILATION_CONF= ..., you have to use
define, because the actual newlines have to be in the variable itself. Actually, you can still use = assignment, but then you need to use $(sep), i.e.:
FOO_CROSS_COMPILATION_CONF= [binaries]$(sep)libgcrypt-config = '$(STAGING_DIR)/usr/bin/libgcrypt-config'$(sep)(which is ugly so don't do that :-)
Quoted 7 lines
Quoted 7 lines
Completely unrelated to this, but I notice now some things in that pkg-meson.mk
that make me wonder what our coding style is in pkg-infra.mk files... Adding Yann and Eric in Cc for that.Quoted 5 lines
Quoted 3 lines
- We usually use $(2), but here it's $$(PKG). Recently there was a patch that changed the $(PKG) back to $(2) in the download infra. So I think we really should be using $(2).
Any link to the relevant patch? Can test/rework my
patch/pkg-meson.mkin case...
5a0d6813948fea2cdb88a2e35984520eec856decNote that the reasons for doing it in that patch don't apply here. However, I
feel it is better/easier to have a general rule to always do things the same way, which is diverged from only in specific cases when there is a good reason to diverge. Like we have the rule that in macros which get $(eval)'ed, we always use $$ (even though it's really needed only in a small minority of the instances).It doesn't really matter which one we choose, $(PKG) or $(2), as long as it is
done consistently.The advantage of $(PKG) is that it can be used in contexts where you don't have
a $(2). The advantage of $(2) is that it is less surprising - by the time $(PKG) gets expanded, it's hard to be sure which value it has (depends on the rule within which it is expanded).Quoted 6 lines
Quoted 2 lines
- meson infra builds in PKG_SRCDIR/build. That really should be
PKG_BUILDDIR, with a default of $(2)_BUILDDIR ?= $$($(2)_SRCDIR)/build.O.k.
Quoted 1 line
Quoted 7 lines
Quoted 2 lines
- I don't think it's appropriate to generate the cross-compilation.conf file in
PKG_BUILDDIR. I think it should be at top level, i.e. $(@D).Why (I think more a matter of taste?)? With cross-compilation.conf in
PKG_BUILDDIR(or in other words build) it is automatically removed/refreshed by pkg-meson.mk (see the rm command in the configure step) and there is no danger of potentially collision with an already source package provided version?It's a matter of taste unless there are additional reasons, and you gave
additional reasons, so it's no longer a matter of taste :-) Let's keep it in BUILDDIR.Regards,
Arnout_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
PATCH 1/2 meson: add entry for libgcrypt-config in cross file
Quoted 57 lines · Peter Seiderer
Hello Arnout,
Quoted 41 lines · Arnout Vandecappelle
Quoted 29 lines · Peter Seiderer
Hello Arnout,
Quoted 25 lines · Arnout Vandecappelle
Quoted 3 lines · J?rg Krause
Hello Peter,
On Tue, 2019-04-30 at 10:27 +0200, Peter Seiderer wrote:
[snip]
Quoted 10 lines
Quoted 2 lines
Would have expected the trick/non-trivial thing to add more than one binary entry (to get the newlines for the entries right)...
That's indeed a difficult case to solve. I didn't managed to get multpile binary entries added to the [binaries] field, e.g.
PKG_TARGET_BINARIES = \ libgcrypt-config = '...' \ llvm-config = '...'Quoted 7 lines
.. will not work.
I spent some time to find a magic rule which splits the
Makefilevariable into a proper newline seperated string which can be used by sed, but I failed.Maybe you have an idea?
Instead of sed, use the PRINTF macro and append to the file:
Quoted 7 lines
Quoted 3 lines
$Q$$(if $$($$(PKG)_TARGET_BINARIES),\ $$(call PRINTF,$$($$(PKG)_TARGET_BINARIES)) \ >> $$($$(PKG)_SRCDIR)/build/cross-compilation.confSimple appending will not work, the extra binaries must be under the '[binaries]' section (maybe reordering the sections in the cross-compilation.conf.in template will work)
It should work if the [binaries] part is at the end, right? And if binaries is
empty, that's OK, no?Quoted 8 lines
Alternatively, the [binaries] part could be included in the
_TARGET_BINARIES
(which would then have to be renamed to_CROSS_COMPILATION_CONF). So for a package that needs libgcrypt-config, it would bedefine
FOO_CROSS_COMPILATION_CONF
[binaries]
libgcrypt-config = '$(STAGING_DIR)/usr/bin/libgcrypt-config' endefWith this and the printf approach I get the following in the cross-compilation.conf file (mind the leading spaces in the binaries line):
Quoted 7 lines
[
host_machine]
system = 'linux'cpu_family='arm'
cpu = 'cortex-a53'
endian = 'little'[binaries]
Oh yes, that's because of the newlines in the definition of PRINTF. make
replaces backslash-newline-space-space-space with a single space. Since there are three backslash-newlines in that macro, you get three spaces.
However, the definition of PERCENT and QUOTE is actually not needed, since
neither of those are special from make. So you could instead define the macro as:
printf '$(subst $(sep),\n,$(subst %,%%,$(subst ','\'',$(subst
\,\\,$(1)))))\n'
Syntax highlighting in vim is completely screwed up then, but it's the end of
the file so too bad :-)
If you think that that is still too long, you could define it in two steps:
shell-quote = '$(subst ','\'',$(subst \,\\,$(1)))' define PRINTF
printf $(subst $(sep),\n,$(subst %,%%,$(call shell-quote,$(1)$(sep))))
endef
But I'm not convinced that that is nicer.
Oh, and all of that is untested of course.
Regards,
Arnout
Quoted 79 lines
libgcrypt-config = '.../host/arm-buildroot-linux-gnueabihf/sysroot/usr/bin/libgcrypt-config'
And meson complains with:
ERROR: Malformed value in cross file variable endian.
Regards,
PeterQuoted 69 lines
Quoted 3 lines
, does the printf approach fix the newline problem for more than one entry?
It does, but you can't use
_CROSS_COMPILATION_CONF= ..., you have to use
define, because the actual newlines have to be in the variable itself. Actually, you can still use = assignment, but then you need to use $(sep), i.e.:
FOO_CROSS_COMPILATION_CONF= [binaries]$(sep)libgcrypt-config = '$(STAGING_DIR)/usr/bin/libgcrypt-config'$(sep)(which is ugly so don't do that :-)
Quoted 7 lines
Quoted 7 lines
Completely unrelated to this, but I notice now some things in that pkg-meson.mk
that make me wonder what our coding style is in pkg-infra.mk files... Adding Yann and Eric in Cc for that.Quoted 5 lines
Quoted 3 lines
- We usually use $(2), but here it's $$(PKG). Recently there was a patch that changed the $(PKG) back to $(2) in the download infra. So I think we really should be using $(2).
Any link to the relevant patch? Can test/rework my
patch/pkg-meson.mkin case...
5a0d6813948fea2cdb88a2e35984520eec856decNote that the reasons for doing it in that patch don't apply here. However, I
feel it is better/easier to have a general rule to always do things the same way, which is diverged from only in specific cases when there is a good reason to diverge. Like we have the rule that in macros which get $(eval)'ed, we always use $$ (even though it's really needed only in a small minority of the instances).It doesn't really matter which one we choose, $(PKG) or $(2), as long as it is
done consistently.The advantage of $(PKG) is that it can be used in contexts where you don't have
a $(2). The advantage of $(2) is that it is less surprising - by the time $(PKG) gets expanded, it's hard to be sure which value it has (depends on the rule within which it is expanded).Quoted 6 lines
Quoted 2 lines
- meson infra builds in PKG_SRCDIR/build. That really should be
PKG_BUILDDIR, with a default of $(2)_BUILDDIR ?= $$($(2)_SRCDIR)/build.O.k.
Quoted 1 line
Quoted 7 lines
Quoted 2 lines
- I don't think it's appropriate to generate the cross-compilation.conf file in
PKG_BUILDDIR. I think it should be at top level, i.e. $(@D).Why (I think more a matter of taste?)? With cross-compilation.conf in
PKG_BUILDDIR(or in other words build) it is automatically removed/refreshed by pkg-meson.mk (see the rm command in the configure step) and there is no danger of potentially collision with an already source package provided version?It's a matter of taste unless there are additional reasons, and you gave
additional reasons, so it's no longer a matter of taste :-) Let's keep it in BUILDDIR.Regards,
Arnout_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
PATCH 1/2 meson: add entry for libgcrypt-config in cross file
In reply to Arnout VandecappelleHi all,
thank you all for your ideas. Please take a look at my proposal below...
Quoted 54 lines · Arnout Vandecappelle
Quoted 29 lines · Peter Seiderer
Hello Arnout,
Quoted 25 lines · Arnout Vandecappelle
Quoted 3 lines · J?rg Krause
Hello Peter,
On Tue, 2019-04-30 at 10:27 +0200, Peter Seiderer wrote:
[snip]
Quoted 10 lines
Quoted 2 lines
Would have expected the trick/non-trivial thing to add more than one binary entry (to get the newlines for the entries right)...
That's indeed a difficult case to solve. I didn't managed to get multpile binary entries added to the [binaries] field, e.g.
PKG_TARGET_BINARIES = \ libgcrypt-config = '...' \ llvm-config = '...'Quoted 7 lines
.. will not work.
I spent some time to find a magic rule which splits the
Makefilevariable into a proper newline seperated string which can be used by sed, but I failed.Maybe you have an idea?
Instead of sed, use the PRINTF macro and append to the file:
Quoted 7 lines
Quoted 3 lines
$Q$$(if $$($$(PKG)_TARGET_BINARIES),\ $$(call PRINTF,$$($$(PKG)_TARGET_BINARIES)) \ >> $$($$(PKG)_SRCDIR)/build/cross-compilation.confSimple appending will not work, the extra binaries must be under the '[binaries]' section (maybe reordering the sections in the cross-compilation.conf.in template will work)
It should work if the [binaries] part is at the end, right? And if binaries is
empty, that's OK, no?Alternatively, the [binaries] part could be included in the
_TARGET_BINARIES
(which would then have to be renamed to_CROSS_COMPILATION_CONF). So for a package that needs libgcrypt-config, it would bedefine
FOO_CROSS_COMPILATION_CONF
[binaries]
libgcrypt-config = '$(STAGING_DIR)/usr/bin/libgcrypt-config' endefQuoted 2 lines
, does the printf approach fix the newline problem for more than one entry?
Quoted 8 lines
It does, but you can't use
_CROSS_COMPILATION_CONF= ..., you have to use
define, because the actual newlines have to be in the variable itself. Actually, you can still use = assignment, but then you need to use $(sep), i.e.:
FOO_CROSS_COMPILATION_CONF= [binaries]$(sep)libgcrypt-config = '$(STAGING_DIR)/usr/bin/libgcrypt-config'$(sep)(which is ugly so don't do that :-)
The package using the meson infrastructure defines:
define libfoo_MESON_CROSS_CONF_BINARIES libgcrypt-config = '$(STAGING_DIR)/usr/bin/libgcrypt-config' llvm-config = '$(STAGING_DIR)/usr/bin/llvm-config' endef
pkg-meson.mk is using PRINTF to a temporary file and sed is using this file as input for appending to the [binaries section]:
$Q$$(if $$($$(PKG)_MESON_CROSS_CONF_BINARIES), \
$$(call PRINTF,$$($$(PKG)_MESON_CROSS_CONF_BINARIES))) \
> $$($$(PKG)_SRCDIR)/build/cross-binaries.tmp
sed -i "s/^[ \t]*//" $$($$(PKG)_SRCDIR)/build/cross-binaries.tmp
sed -e "s%@TARGET_CROSS@%$$(TARGET_CROSS)%g" \
...
-e "/\[binaries\]/r $$($$(PKG)_SRCDIR)/build/cross-binaries.tmp" \
package/meson/cross-compilation.conf.in \
> $$($$(PKG)_SRCDIR)/build/cross-compilation.conf
rm -f $$($$(PKG)_SRCDIR)/build/cross-binaries.tmpBest regards
J?rg Krause
PATCH 1/2 meson: add entry for libgcrypt-config in cross file
Quoted 56 lines · J?rg Krause
Hi all,
thank you all for your ideas. Please take a look at my proposal below...
Quoted 50 lines · Arnout Vandecappelle
Quoted 29 lines · Peter Seiderer
Hello Arnout,
Quoted 25 lines · Arnout Vandecappelle
Quoted 3 lines · J?rg Krause
Hello Peter,
On Tue, 2019-04-30 at 10:27 +0200, Peter Seiderer wrote:
[snip]
Quoted 10 lines
Quoted 2 lines
Would have expected the trick/non-trivial thing to add more than one binary entry (to get the newlines for the entries right)...
That's indeed a difficult case to solve. I didn't managed to get multpile binary entries added to the [binaries] field, e.g.
PKG_TARGET_BINARIES = \ libgcrypt-config = '...' \ llvm-config = '...'Quoted 7 lines
.. will not work.
I spent some time to find a magic rule which splits the
Makefilevariable into a proper newline seperated string which can be used by sed, but I failed.Maybe you have an idea?
Instead of sed, use the PRINTF macro and append to the file:
Quoted 7 lines
Quoted 3 lines
$Q$$(if $$($$(PKG)_TARGET_BINARIES),\ $$(call PRINTF,$$($$(PKG)_TARGET_BINARIES)) \ >> $$($$(PKG)_SRCDIR)/build/cross-compilation.confSimple appending will not work, the extra binaries must be under the '[binaries]' section (maybe reordering the sections in the cross-compilation.conf.in template will work)
It should work if the [binaries] part is at the end, right? And if binaries is
empty, that's OK, no?Alternatively, the [binaries] part could be included in the
_TARGET_BINARIES
(which would then have to be renamed to_CROSS_COMPILATION_CONF). So for a package that needs libgcrypt-config, it would bedefine
FOO_CROSS_COMPILATION_CONF
[binaries]
libgcrypt-config = '$(STAGING_DIR)/usr/bin/libgcrypt-config' endef
Is there any reason why this proposal doesn't work? AFAIU, it should be no
problem to repeat the '[binaries]' part several times, right?
I'm insisting on this since I expect that we'll need to override something else
at some point as well.
Quoted 19 lines
Quoted 11 lines
Quoted 2 lines
, does the printf approach fix the newline problem for more than one entry?
It does, but you can't use
_CROSS_COMPILATION_CONF= ..., you have to use
define, because the actual newlines have to be in the variable itself. Actually, you can still use = assignment, but then you need to use $(sep), i.e.:
FOO_CROSS_COMPILATION_CONF= [binaries]$(sep)libgcrypt-config = '$(STAGING_DIR)/usr/bin/libgcrypt-config'$(sep)(which is ugly so don't do that :-)
The package using the meson infrastructure defines:
define libfoo_MESON_CROSS_CONF_BINARIES libgcrypt-config = '$(STAGING_DIR)/usr/bin/libgcrypt-config' llvm-config = '$(STAGING_DIR)/usr/bin/llvm-config' endef
Quoted 7 lines
pkg-meson.mk is using PRINTF to a temporary file and sed is using this file as input for appending to the [binaries section]:
$Q$$(if $$($$(PKG)_MESON_CROSS_CONF_BINARIES), \ $$(call PRINTF,$$($$(PKG)_MESON_CROSS_CONF_BINARIES))) \ > $$($$(PKG)_SRCDIR)/build/cross-binaries.tmp sed -i "s/^[ \t]*//" $$($$(PKG)_SRCDIR)/build/cross-binaries.tmp
I would rather have the PRINTF macro to be fixed not to insert these tabs. It's
just an artefact of how make works, and can be fairly easily fixed, either by reordering the newlines in the PRINTF definition, or by putting a $(strip) around it (although the latter has potential side effect since it also replaces all internal whitespace with a single space).
Quoted 3 lines
sed -e "s%@TARGET_CROSS@%$$(TARGET_CROSS)%g" \
...
-e "/\[binaries\]/r $$($$(PKG)_SRCDIR)/build/cross-binaries.tmp" \ Not many people understand the r command which makes this hard to read, but
it's acceptable for me.
Quoted 3 lines
package/meson/cross-compilation.conf.in \ > $$($$(PKG)_SRCDIR)/build/cross-compilation.confrm -f $$($$(PKG)_SRCDIR)/build/cross-binaries.tmp
Maybe, however, we should drop the cross-compilation.conf.in and generate
everything with PRINTF (assuming that PRINTF gets fixed first, of course):
define meson_cross_compilation_conf_template
# 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'
[binaries]
c = '$(TARGET_CROSS)gcc'
cpp = '$(TARGET_CROSS)g++'
ar = '$(TARGET_CROSS)ar'
strip = '$(TARGET_CROSS)strip'
pkgconfig = '$(HOST_DIR)/usr/bin/pkg-config'
$($(PKG)_MESON_CROSS_CONF_BINARIES)
[properties]needs_exe_wrapper = true
...
endef
$(call PRINTF,$(meson_cross_compilation_conf_template)) \ > $$($$(PKG)_SRCDIR)/build/cross-compilation.conf
(Note: even with the above, I would prefer to have a $($(PKG)_MESON_CROSS_CONF) that gets appended at the end and that has the [binaries] embedded in it; the above is assuming that that doesn't work for some reason.)
Regards,
Arnout
PATCH 1/2 meson: add entry for libgcrypt-config in cross file
Hi,
Quoted 53 lines · Arnout Vandecappelle
Quoted 51 lines · J?rg Krause
Hi all,
thank you all for your ideas. Please take a look at my proposal below...
Quoted 45 lines · Arnout Vandecappelle
Quoted 29 lines · Peter Seiderer
Hello Arnout,
Quoted 25 lines · Arnout Vandecappelle
Quoted 3 lines · J?rg Krause
Hello Peter,
On Tue, 2019-04-30 at 10:27 +0200, Peter Seiderer wrote:
[snip]
Quoted 10 lines
Quoted 2 lines
Would have expected the trick/non-trivial thing to add more than one binary entry (to get the newlines for the entries right)...
That's indeed a difficult case to solve. I didn't managed to get multpile binary entries added to the [binaries] field, e.g.
PKG_TARGET_BINARIES = \ libgcrypt-config = '...' \ llvm-config = '...'Quoted 7 lines
.. will not work.
I spent some time to find a magic rule which splits the
Makefilevariable into a proper newline seperated string which can be used by sed, but I failed.Maybe you have an idea?
Instead of sed, use the PRINTF macro and append to the file:
Quoted 7 lines
Quoted 3 lines
$Q$$(if $$($$(PKG)_TARGET_BINARIES),\ $$(call PRINTF,$$($$(PKG)_TARGET_BINARIES)) \ >> $$($$(PKG)_SRCDIR)/build/cross-compilation.confSimple appending will not work, the extra binaries must be under the '[binaries]' section (maybe reordering the sections in the cross-compilation.conf.in template will work)
It should work if the [binaries] part is at the end, right? And if binaries is
empty, that's OK, no?Alternatively, the [binaries] part could be included in the
_TARGET_BINARIES
(which would then have to be renamed to_CROSS_COMPILATION_CONF). So for a package that needs libgcrypt-config, it would be
Quoted 7 lines
Quoted 4 lines
Quoted 4 lines
define
FOO_CROSS_COMPILATION_CONF
[binaries]
libgcrypt-config = '$(STAGING_DIR)/usr/bin/libgcrypt-config' endefIs there any reason why this proposal doesn't work? AFAIU, it should be no
problem to repeat the '[binaries]' part several times, right?
Meson does not accept the same section name more than once. It fails with:
configparser.DuplicateSectionError: While reading from '/buildroot/output/build/mpd-0.21.9//build/cross-compilation.conf' [line 26] : section 'binaries' already exists
FAILED: build.ninja
Quoted 30 lines
I'm insisting on this since I expect that we'll need to override something else
at some point as well.Quoted 19 lines
Quoted 11 lines
Quoted 2 lines
, does the printf approach fix the newline problem for more than one entry?
It does, but you can't use
_CROSS_COMPILATION_CONF= ..., you have to use
define, because the actual newlines have to be in the variable itself. Actually, you can still use = assignment, but then you need to use $(sep), i.e.:
FOO_CROSS_COMPILATION_CONF= [binaries]$(sep)libgcrypt-config = '$(STAGING_DIR)/usr/bin/libgcrypt-config'$(sep)(which is ugly so don't do that :-)
The package using the meson infrastructure defines:
define libfoo_MESON_CROSS_CONF_BINARIES libgcrypt-config = '$(STAGING_DIR)/usr/bin/libgcrypt-config' llvm-config = '$(STAGING_DIR)/usr/bin/llvm-config' endefQuoted 7 lines
pkg-meson.mk is using PRINTF to a temporary file and sed is using this file as input for appending to the [binaries section]:
$Q$$(if $$($$(PKG)_MESON_CROSS_CONF_BINARIES), \ $$(call PRINTF,$$($$(PKG)_MESON_CROSS_CONF_BINARIES))) \ > $$($$(PKG)_SRCDIR)/build/cross-binaries.tmp sed -i "s/^[ \t]*//" $$($$(PKG)_SRCDIR)/build/cross-binaries.tmp
Quoted 5 lines
I would rather have the PRINTF macro to be fixed not to insert these tabs. It's
just an artefact of how make works, and can be fairly easily fixed, either by reordering the newlines in the PRINTF definition, or by putting a $(strip) around it (although the latter has potential side effect since it also replaces all internal whitespace with a single space).
I see! So, this should be fixed first.
Quoted 34 lines
Quoted 3 lines
sed -e "s%@TARGET_CROSS@%$$(TARGET_CROSS)%g" \ ... -e "/\[binaries\]/r $$($$(PKG)_SRCDIR)/build/cross-binaries.tmp" \Not many people understand the r command which makes this hard to read, but
it's acceptable for me.Quoted 3 lines
package/meson/cross-compilation.conf.in \ > $$($$(PKG)_SRCDIR)/build/cross-compilation.confrm -f $$($$(PKG)_SRCDIR)/build/cross-binaries.tmp
Maybe, however, we should drop the cross-compilation.conf.in and generate
everything with PRINTF (assuming that PRINTF gets fixed first, of course):define
meson_cross_compilation_conf_template
# 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'[binaries]
c = '$(TARGET_CROSS)gcc'
cpp = '$(TARGET_CROSS)g++'
ar = '$(TARGET_CROSS)ar'
strip = '$(TARGET_CROSS)strip'
pkgconfig = '$(HOST_DIR)/usr/bin/pkg-config'
$($(PKG)_MESON_CROSS_CONF_BINARIES)[properties]
needs_exe_wrapper= true
...
endef
Quoted 7 lines
$(call PRINTF,$(meson_cross_compilation_conf_template)) \ > $$($$(PKG)_SRCDIR)/build/cross-compilation.conf(Note: even with the above, I would prefer to have a $($(PKG)_MESON_CROSS_CONF) that gets appended at the end and that has the [binaries] embedded in it; the above is assuming that that doesn't work for some reason.)
As Meson does not accept duplicated sections, $($(PKG)_MESON_CROSS_CONF isn't an option. So, what does others think about:
a) using seds 'r' command?
b) drop the cross-compilation.conf.in and generate everything with PRINTF?
c) Something else
Best regards
J?rg Krause
PATCH 1/2 meson: add entry for libgcrypt-config in cross file
In reply to Arnout VandecappelleHello Arnout, J?rg,
Quoted 14 lines · Arnout Vandecappelle
Quoted 3 lines · J?rg Krause
Hello Peter,
On Tue, 2019-04-30 at 10:27 +0200, Peter Seiderer wrote:
[snip]
Quoted 9 lines
Quoted 2 lines
Would have expected the trick/non-trivial thing to add more than one binary entry (to get the newlines for the entries right)...
That's indeed a difficult case to solve. I didn't managed to get multpile binary entries added to the [binaries] field, e.g.
Quoted 7 lines
Quoted 7 lines
.. will not work.
I spent some time to find a magic rule which splits the
Makefilevariable into a proper newline seperated string which can be used by sed, but I failed.Maybe you have an idea?
The version with added '\n', like:
PKG_TARGET_BINARIES = \
libgcrypt-config = '...' \
\nllvm-config = '...'
works for the sed variant but not for the given printf one...
Regards,
Peter
Quoted 25 lines
Instead of sed, use the PRINTF macro and append to the file:
$Q$$(if $$($$(PKG)_TARGET_BINARIES),\ $$(call PRINTF,$$($$(PKG)_TARGET_BINARIES)) \ >> $$($$(PKG)_SRCDIR)/build/cross-compilation.confCompletely unrelated to this, but I notice now some things in that pkg-meson.mk
that make me wonder what our coding style is in pkg-infra.mk files... Adding Yann and Eric in Cc for that.- We usually use $(2), but here it's $$(PKG). Recently there was a patch that changed the $(PKG) back to $(2) in the download infra. So I think we really should be using $(2).
- meson infra builds in PKG_SRCDIR/build. That really should be
PKG_BUILDDIR, with a default of $(2)_BUILDDIR ?= $$($(2)_SRCDIR)/build.- I don't think it's appropriate to generate the cross-compilation.conf file in
PKG_BUILDDIR. I think it should be at top level, i.e. $(@D).Regards,
Arnout
PATCH 1/2 meson: add entry for libgcrypt-config in cross file
In reply to Arnout VandecappelleHello,
Quoted 2 lines · On Wed, 1 May 2019 13:13:03 +0200 Arnout Vandecappelle <[email protected]> wrote:
- I don't think it's appropriate to generate the cross-compilation.conf file in
PKG_BUILDDIR. I think it should be at top level, i.e. $(@D).
I'd say it depends the $(@D) of which step. Indeed, in the (admittedly long term) perspective of per-package out-of-tree build, the source tree would be shared between the host and target builds of a given package, and this cross-compilation.conf file would only make sense for the target variant of the package, and therefore it should be in the build directory of the target variant.
So, if this file is generated during the "configure" step, we are good, because $(@D) will point to the build directory. If it's generated in an earlier step, $(@D) points to the source directory (with per-package out-of-tree build implemented, of course).
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH 1/2 meson: add entry for libgcrypt-config in cross file
Quoted 15 lines · Thomas Petazzoni
Hello,
Quoted 2 lines · On Wed, 1 May 2019 13:13:03 +0200 Arnout Vandecappelle <[email protected]> wrote:
- I don't think it's appropriate to generate the cross-compilation.conf file in
PKG_BUILDDIR. I think it should be at top level, i.e. $(@D).I'd say it depends the $(@D) of which step. Indeed, in the (admittedly long term) perspective of per-package out-of-tree build, the source tree would be shared between the host and target builds of a given package, and this cross-compilation.conf file would only make sense for the target variant of the package, and therefore it should be in the build directory of the target variant.
Quoted 4 lines
So, if this file is generated during the "configure" step, we are good, because $(@D) will point to the build directory. If it's generated in an earlier step, $(@D) points to the source directory (with per-package out-of-tree build implemented, of course).
Similarly like for $(2) vs. $(PKG), I think we should have a "default" for how
to address "the directory where stuff happens". We currently use $(@D) in many places, but perhaps it's better to turn that into $(FOO_BUILDDIR).
Regards,
Arnout