igt-gpu-tools: Fix reproducibility issue

Add a configuration option to pass in srcdir, removing hard coded
build paths from the binaries.

(From OE-Core rev: d7e92e3a22f0c87aff4f452b51f50ec417d2949b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2021-02-27 14:51:41 +00:00
parent 8b145a898a
commit 12e6dac3bf
3 changed files with 41 additions and 3 deletions

View File

@@ -36,7 +36,6 @@ exclude_packages = [
'go_',
'go-',
'gstreamer1.0-python',
'igt-gpu-tools',
'libaprutil',
'libid3tag',
'lttng-tools-dbg',

View File

@@ -0,0 +1,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)')

View File

@@ -10,7 +10,8 @@ inherit meson
SRCREV = "d16ad07e7f2a028e14d61f570931c87fa5ce404c"
PV = "1.25+git${SRCPV}"
SRC_URI = "git://gitlab.freedesktop.org/drm/igt-gpu-tools.git;protocol=https"
SRC_URI = "git://gitlab.freedesktop.org/drm/igt-gpu-tools.git;protocol=https \
file://reproducibility.patch"
S = "${WORKDIR}/git"
@@ -22,7 +23,7 @@ PACKAGE_BEFORE_PN = "${PN}-benchmarks ${PN}-tests"
PACKAGECONFIG[chamelium] = "-Dchamelium=enabled,-Dchamelium=disabled,gsl xmlrpc-c"
EXTRA_OEMESON = "-Ddocs=disabled -Drunner=enabled"
EXTRA_OEMESON = "-Ddocs=disabled -Drunner=enabled -Dsrcdir=/usr/src/debug/${PN}/${PV}-${PR}/git/"
COMPATIBLE_HOST = "(x86_64.*|i.86.*|arm.*|aarch64).*-linux"
COMPATIBLE_HOST_libc-musl_class-target = "null"
SECURITY_LDFLAGS = "${SECURITY_X_LDFLAGS}"