Allow to specify wayland-protocols datadir

Submitted by Marius-cristian Vlad on Dec. 12, 2017, 9:10 p.m.

Details

Message ID 20171212211018.813-1-marius-cristian.vlad@nxp.com
State New
Headers show
Series "Allow to specify wayland-protocols datadir" ( rev: 1 ) in Wayland

Not browsing as part of any series.

Commit Message

Marius-cristian Vlad Dec. 12, 2017, 9:10 p.m.
This is particularly useful when cross-compiling and we need to specify a custom
datadir path for wayland-protocols. Cross-compilation toolchain is usually
immutable, and in this way we can modify wayland-protocols independently from
what the toolchain provides.

Signed-off-by: Marius Vlad <marius-cristian.vlad@nxp.com>
---
 configure.ac | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/configure.ac b/configure.ac
index d1b5f47..11ebc21 100644
--- a/configure.ac
+++ b/configure.ac
@@ -213,7 +213,13 @@  PKG_CHECK_MODULES(COMPOSITOR, [$COMPOSITOR_MODULES])
 
 PKG_CHECK_MODULES(WAYLAND_PROTOCOLS, [wayland-protocols >= 1.8],
 		  [ac_wayland_protocols_pkgdatadir=`$PKG_CONFIG --variable=pkgdatadir wayland-protocols`])
-AC_SUBST(WAYLAND_PROTOCOLS_DATADIR, $ac_wayland_protocols_pkgdatadir)
+AC_ARG_WITH(wayland-protocols-datadir-path,
+               AS_HELP_STRING([--with-wayland-protocols-datadir-path=PATH],
+               [Path to wayland-protocols]),
+               [WAYLAND_PROTOCOLS_DATADIR="$withval"],
+               [WAYLAND_PROTOCOLS_DATADIR="$ac_wayland_protocols_pkgdatadir"])
+
+AC_SUBST([WAYLAND_PROTOCOLS_DATADIR])
 
 AC_ARG_ENABLE(wayland-compositor, [  --enable-wayland-compositor],,
 	      enable_wayland_compositor=yes)

Comments

On Tue, 12 Dec 2017 23:10:18 +0200
Marius Vlad <marius-cristian.vlad@nxp.com> wrote:

> This is particularly useful when cross-compiling and we need to specify a custom
> datadir path for wayland-protocols. Cross-compilation toolchain is usually
> immutable, and in this way we can modify wayland-protocols independently from
> what the toolchain provides.
> 
> Signed-off-by: Marius Vlad <marius-cristian.vlad@nxp.com>
> ---
>  configure.ac | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/configure.ac b/configure.ac
> index d1b5f47..11ebc21 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -213,7 +213,13 @@ PKG_CHECK_MODULES(COMPOSITOR, [$COMPOSITOR_MODULES])
>  
>  PKG_CHECK_MODULES(WAYLAND_PROTOCOLS, [wayland-protocols >= 1.8],
>  		  [ac_wayland_protocols_pkgdatadir=`$PKG_CONFIG --variable=pkgdatadir wayland-protocols`])
> -AC_SUBST(WAYLAND_PROTOCOLS_DATADIR, $ac_wayland_protocols_pkgdatadir)
> +AC_ARG_WITH(wayland-protocols-datadir-path,
> +               AS_HELP_STRING([--with-wayland-protocols-datadir-path=PATH],
> +               [Path to wayland-protocols]),
> +               [WAYLAND_PROTOCOLS_DATADIR="$withval"],
> +               [WAYLAND_PROTOCOLS_DATADIR="$ac_wayland_protocols_pkgdatadir"])
> +
> +AC_SUBST([WAYLAND_PROTOCOLS_DATADIR])
>  
>  AC_ARG_ENABLE(wayland-compositor, [  --enable-wayland-compositor],,
>  	      enable_wayland_compositor=yes)

Hi Marius,

I noticed this patch did not land. Would we need something like this
for Meson in Weston?

This seems to be a Weston patch, but the only thing hinting at that is
the context in the diff.


Thanks,
pq
On Fri, Jan 18, 2019 at 11:53:07AM +0200, Pekka Paalanen wrote:
> On Tue, 12 Dec 2017 23:10:18 +0200
> Marius Vlad <marius-cristian.vlad@nxp.com> wrote:
> 
> > This is particularly useful when cross-compiling and we need to specify a custom
> > datadir path for wayland-protocols. Cross-compilation toolchain is usually
> > immutable, and in this way we can modify wayland-protocols independently from
> > what the toolchain provides.
> > 
> > Signed-off-by: Marius Vlad <marius-cristian.vlad@nxp.com>
> > ---
> >  configure.ac | 8 +++++++-
> >  1 file changed, 7 insertions(+), 1 deletion(-)
> > 
> > diff --git a/configure.ac b/configure.ac
> > index d1b5f47..11ebc21 100644
> > --- a/configure.ac
> > +++ b/configure.ac
> > @@ -213,7 +213,13 @@ PKG_CHECK_MODULES(COMPOSITOR, [$COMPOSITOR_MODULES])
> >  
> >  PKG_CHECK_MODULES(WAYLAND_PROTOCOLS, [wayland-protocols >= 1.8],
> >  		  [ac_wayland_protocols_pkgdatadir=`$PKG_CONFIG --variable=pkgdatadir wayland-protocols`])
> > -AC_SUBST(WAYLAND_PROTOCOLS_DATADIR, $ac_wayland_protocols_pkgdatadir)
> > +AC_ARG_WITH(wayland-protocols-datadir-path,
> > +               AS_HELP_STRING([--with-wayland-protocols-datadir-path=PATH],
> > +               [Path to wayland-protocols]),
> > +               [WAYLAND_PROTOCOLS_DATADIR="$withval"],
> > +               [WAYLAND_PROTOCOLS_DATADIR="$ac_wayland_protocols_pkgdatadir"])
> > +
> > +AC_SUBST([WAYLAND_PROTOCOLS_DATADIR])
> >  
> >  AC_ARG_ENABLE(wayland-compositor, [  --enable-wayland-compositor],,
> >  	      enable_wayland_compositor=yes)
> 
> Hi Marius,
Hi Pekka,
> 
> I noticed this patch did not land. Would we need something like this
> for Meson in Weston?

I get the feeling that people when cross-compiling don't really use
cross-compilers but instead resort to various way of faking other ARCH
systems. This includes the typical cross-deboostrap with
qemu-static-arm.

The above path tries to fix the issue of having to specify
PKG_CONFIG_WAYLAND_PROTOCOLS_PKGDATADIR to get wayland-protocols from
other directory that the regular (install) path. The problem is
exacerbated when using cross toolchains which modify PKG_CONFIG vars and
use other SYSROOT. Under yocto for instance I have to modify PKG_CONFIG
vars to make weston choose another datadir for wayland-protocols along
side exporting PKG_CONFIG_WAYLAND_PROTOCOLS_PKGDATADIR.

I might be wrong but I believe yocto itself deals with this by
maintaining some off the shelf patches.

I have in plan of writing a cross file for meson and testing various
cross-toolchains like OSELAS/yocto/linaro/debian. Think that something
equivalent will be needed as meson uses pkg-config as well, but I
haven't had time to go over it. Somehow this implies automated ways of
generating cross file(s) as to tackle various toolchain environments,
which to be honest autotools dealt a lot better that meson at
this point.
> 
> This seems to be a Weston patch, but the only thing hinting at that is
> the context in the diff.
> 
> 
> Thanks,
> pq