[1/2] meson: add entry for libgcrypt-config in cross file

Message ID 20190403183202.19682-1-joerg.krause@embedded.rocks
State New
Headers show
Series
  • [1/2] meson: add entry for libgcrypt-config in cross file
Related show

Commit Message

Jörg Krause April 3, 2019, 6:32 p.m.
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.

Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
---
 package/meson/cross-compilation.conf.in | 1 +
 package/meson/meson.mk                  | 1 +
 package/pkg-meson.mk                    | 1 +
 3 files changed, 3 insertions(+)

Comments

Thomas Petazzoni April 3, 2019, 7:33 p.m. | #1
Hello,

On Wed,  3 Apr 2019 20:32:01 +0200
Jörg Krause <joerg.krause@embedded.rocks> wrote:

> 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.
> 
> Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
> ---
>  package/meson/cross-compilation.conf.in | 1 +
>  package/meson/meson.mk                  | 1 +
>  package/pkg-meson.mk                    | 1 +
>  3 files changed, 3 insertions(+)
> 
> diff --git a/package/meson/cross-compilation.conf.in b/package/meson/cross-compilation.conf.in
> index fc8e27f7eb..b68499a6fa 100644
> --- a/package/meson/cross-compilation.conf.in
> +++ b/package/meson/cross-compilation.conf.in
> @@ -9,6 +9,7 @@ cpp = '@TARGET_CROSS@g++'
>  ar = '@TARGET_CROSS@ar'
>  strip = '@TARGET_CROSS@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
Jörg Krause April 5, 2019, 6:58 a.m. | #2
Hello,

Am Mittwoch, den 03.04.2019, 21:33 +0200 schrieb Thomas Petazzoni:
> Hello,
> 
> On Wed,  3 Apr 2019 20:32:01 +0200
> Jörg Krause <joerg.krause@embedded.rocks> wrote:
> 
> > 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.
> > 
> > Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
> > ---
> >  package/meson/cross-compilation.conf.in | 1 +
> >  package/meson/meson.mk                  | 1 +
> >  package/pkg-meson.mk                    | 1 +
> >  3 files changed, 3 insertions(+)
> > 
> > diff --git a/package/meson/cross-compilation.conf.in b/package/meson/cross-compilation.conf.in
> > index fc8e27f7eb..b68499a6fa 100644
> > --- a/package/meson/cross-compilation.conf.in
> > +++ b/package/meson/cross-compilation.conf.in
> > @@ -9,6 +9,7 @@ cpp = '@TARGET_CROSS@g++'
> >  ar = '@TARGET_CROSS@ar'
> >  strip = '@TARGET_CROSS@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
Thomas Petazzoni April 13, 2019, 4:24 p.m. | #3
Hello Jörg,

+Peter Seiderer in Cc.

On Wed,  3 Apr 2019 20:32:01 +0200
Jörg Krause <joerg.krause@embedded.rocks> wrote:

> 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.
> 
> Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>

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

Patch

diff --git a/package/meson/cross-compilation.conf.in b/package/meson/cross-compilation.conf.in
index fc8e27f7eb..b68499a6fa 100644
--- a/package/meson/cross-compilation.conf.in
+++ b/package/meson/cross-compilation.conf.in
@@ -9,6 +9,7 @@  cpp = '@TARGET_CROSS@g++'
 ar = '@TARGET_CROSS@ar'
 strip = '@TARGET_CROSS@strip'
 pkgconfig = '@HOST_DIR@/usr/bin/pkg-config'
+libgcrypt-config = '@STAGING_DIR@/usr/bin/libgcrypt-config'
 
 [properties]
 needs_exe_wrapper = true
diff --git a/package/meson/meson.mk b/package/meson/meson.mk
index 49e27f5527..113ff058f7 100644
--- a/package/meson/meson.mk
+++ b/package/meson/meson.mk
@@ -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
diff --git a/package/pkg-meson.mk b/package/pkg-meson.mk
index 886fcf7205..6ec45b8b82 100644
--- a/package/pkg-meson.mk
+++ b/package/pkg-meson.mk
@@ -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) \