summaryrefslogtreecommitdiffstats
path: root/meta/recipes-graphics/igt-gpu-tools/igt-gpu-tools/reproducibility.patch
blob: 39e36d8737887664cd387565529bf321d36c11a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
meson: Allow source location to be configurable

Hardcoding a build source path into a binary when cross compiling isn't
appropriate and breaks build reproducibility. Allow the srcdir to be
specified by an optional configuration option to meson.

Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
Upstream-Status: Submitted [https://lists.freedesktop.org/archives/igt-dev/2021-February/029443.html]

Index: git/lib/meson.build
===================================================================
--- git.orig/lib/meson.build
+++ git/lib/meson.build
@@ -122,7 +122,11 @@ if chamelium.found()
 	lib_sources += 'igt_chamelium_stream.c'
 endif
 
-srcdir = join_paths(meson.source_root(), 'tests')
+if get_option('srcdir') != ''
+    srcdir = join_paths(get_option('srcdir'), 'tests')
+else
+    srcdir = join_paths(meson.source_root(), 'tests')
+endif
 
 lib_version = vcs_tag(input : 'version.h.in', output : 'version.h',
 		      fallback : 'NO-GIT',
Index: git/meson_options.txt
===================================================================
--- git.orig/meson_options.txt
+++ git/meson_options.txt
@@ -50,3 +50,7 @@ option('use_rpath',
        type : 'boolean',
        value : false,
        description : 'Set runpath on installed executables for libigt.so')
+
+option('srcdir',
+       type : 'string',
+       description : 'Path to source code to be compiled into binaries (optional)')