1From 303d5c4fef1760ede5786bc62c7012dd7ae93722 Mon Sep 17 00:00:00 2001
2From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
3Date: Sun, 8 Nov 2020 23:46:49 +0100
4Subject: [PATCH] wscript: use find_program to find wayland-scanner
5
6Use find_program instead of check_cfg to find wayland-scanner. This will
7fix the following build failure when cross-compiling:
8
9[ 3/73] Compiling doc/glmark2.1.in
10/bin/sh: 1: /usr/bin/wayland-scanner: not found
11
12Fixes:
13 - http://autobuild.buildroot.org/results//361dc40e558e2646cb93f405c7b1f621d400fea3
14
15Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
16---
17 src/wscript_build | 2 +-
18 wscript           | 3 +--
19 2 files changed, 2 insertions(+), 3 deletions(-)
20
21diff --git a/src/wscript_build b/src/wscript_build
22index bbe7a77..ed3e8d6 100644
23--- a/src/wscript_build
24+++ b/src/wscript_build
25@@ -51,7 +51,7 @@ else:
26
27 if 'WAYLAND_SCANNER_wayland_scanner' in bld.env.keys():
28     def wayland_scanner_cmd(arg, src):
29-        return '%s %s < %s > ${TGT}' % (bld.env['WAYLAND_SCANNER_wayland_scanner'], arg, src)
30+        return '%s %s < %s > ${TGT}' % (bld.env['WAYLAND_SCANNER_wayland_scanner'][0], arg, src)
31
32     def wayland_proto_src_path(proto, ver):
33         wp_dir = bld.env['WAYLAND_PROTOCOLS_pkgdatadir']
34diff --git a/wscript b/wscript
35index e09fa78..fe2494f 100644
36--- a/wscript
37+++ b/wscript
38@@ -227,8 +227,7 @@ def configure_linux(ctx):
39         # wayland-protocols >= 1.12 required for xdg-shell stable
40         ctx.check_cfg(package = 'wayland-protocols', atleast_version = '1.12',
41                       variables = ['pkgdatadir'], uselib_store = 'WAYLAND_PROTOCOLS')
42-        ctx.check_cfg(package = 'wayland-scanner', variables = ['wayland_scanner'],
43-                      uselib_store = 'WAYLAND_SCANNER')
44+        ctx.find_program('wayland-scanner', var = 'WAYLAND_SCANNER_wayland_scanner')
45
46     # Prepend CXX flags so that they can be overriden by the
47     # CXXFLAGS environment variable
48--
492.28.0
50
51