Hi,

I've attached a trivial patch we discussed yesterday on #wayland channel.
The patch adds a sysroot prefix to the "pkgdatadir" variable. The
pkg-config automatically adds sysroot to paths returned by --cflags and
--libs but *NOT* to --variable.

The "pkgdatadir" in wayland-protocols.pc is actually a path pointing to the
protocol installation directory on the target system but in a
cross-compilation scenario we need pkg-config to return a temporary
location in the staging area on the build system just as it does for
--cflags and --libs.

The change only influences builds with PKG_CONFIG_SYSROOT_DIR environment
variable set.

There's another pkg-confing variable containing a path to the
wayland-scanner tool but I'm not sure how to handle that one correctly in
cross-compilation scenario.  The cross-compiled wayland-scanner is likely
to be useless on the build system. The pre-existing wayland-scanner on the
build system, if any, is also likely to be useless. The only scanner that
would actually work is the scanner compiled from wayland sources for the
build system architecture and installed somewhere with its own .pc file.
This implies that libs using scanner would need 2 independent pkg-config
setups.

My call would be to get rid of that variable and add
--with-wayland-scanner=/path/to/the/right/wayland-scanner config variable
to xkbcommon, wayland, weston and whatever uses wayland-scanner.

Cheers,
Tomek
From c09eed841ca77a3960aeb09428f97672900e8f77 Mon Sep 17 00:00:00 2001
From: Tomek Bury <[email protected]>
Date: Tue, 4 Jul 2017 13:14:17 +0100
Subject: [PATCH] Use sysroot prefix for pkgdatadir variable

The pc_sysroot is automatically added to cflags and libs but not
to 'pkg-config --variable'
---
 wayland-protocols.pc.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/wayland-protocols.pc.in b/wayland-protocols.pc.in
index a26744c..08c8fa7 100644
--- a/wayland-protocols.pc.in
+++ b/wayland-protocols.pc.in
@@ -1,6 +1,6 @@
 prefix=@prefix@
 datarootdir=@datarootdir@
-pkgdatadir=@datadir@/@PACKAGE@
+pkgdatadir=${pc_sysrootdir}/@datadir@/@PACKAGE@
 
 Name: Wayland Protocols
 Description: Wayland protocol files
-- 
1.9.1

_______________________________________________
wayland-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to