summaryrefslogtreecommitdiffstats
path: root/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/0001-meson.build-allow-a-subset-of-tests-in-cross-compile.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/0001-meson.build-allow-a-subset-of-tests-in-cross-compile.patch')
-rw-r--r--meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/0001-meson.build-allow-a-subset-of-tests-in-cross-compile.patch66
1 files changed, 66 insertions, 0 deletions
diff --git a/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/0001-meson.build-allow-a-subset-of-tests-in-cross-compile.patch b/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/0001-meson.build-allow-a-subset-of-tests-in-cross-compile.patch
new file mode 100644
index 0000000000..3d685db774
--- /dev/null
+++ b/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/0001-meson.build-allow-a-subset-of-tests-in-cross-compile.patch
@@ -0,0 +1,66 @@
1From 4bfb696fd125f044e3df9f6983c4ad518d9552c7 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex@linutronix.de>
3Date: Thu, 26 Jan 2023 20:29:46 +0100
4Subject: [PATCH] meson.build: allow (a subset of) tests in cross compile
5 settings
6
7There is no need to completely disable tests: most of them
8do not require running target executables at build time,
9and so can be built and installed.
10
11This requires inserting a couple of specific guards around
12items that do require running target executables.
13
14Upstream-Status: Submitted [https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/merge_requests/150]
15Signed-off-by: Alexander Kanavin <alex@linutronix.de>
16---
17 meson.build | 6 +++---
18 tests/meson.build | 10 ++++++----
19 2 files changed, 9 insertions(+), 7 deletions(-)
20
21diff --git a/meson.build b/meson.build
22index 78f3683..e0feaee 100644
23--- a/meson.build
24+++ b/meson.build
25@@ -390,10 +390,10 @@ subdir('gdk-pixbuf')
26 # i18n
27 subdir('po')
28
29+if get_option('tests')
30+ subdir('tests')
31+endif
32 if not meson.is_cross_build()
33- if get_option('tests')
34- subdir('tests')
35- endif
36 subdir('thumbnailer')
37 endif
38
39diff --git a/tests/meson.build b/tests/meson.build
40index 78d0ad9..0c9e64e 100644
41--- a/tests/meson.build
42+++ b/tests/meson.build
43@@ -4,7 +4,7 @@
44 # gdk-pixbuf-pixdata from build directory because it needs all DLL locations in
45 # $PATH. Ideally we should use gnome.compile_resources() and let Meson deal with
46 # this problem: See https://github.com/mesonbuild/meson/issues/8266.
47-if enabled_loaders.contains('png') and host_system != 'windows'
48+if enabled_loaders.contains('png') and host_system != 'windows' and not meson.is_cross_build()
49 # Resources; we cannot use gnome.compile_resources() here, because we need to
50 # override the environment in order to use the utilities we just built instead
51 # of the system ones
52@@ -172,9 +172,11 @@ endif
53 test_deps = gdk_pixbuf_deps + [ gdkpixbuf_dep, ]
54 test_args = [ '-k' ]
55 test_env = environment()
56-test_env.set('G_TEST_SRCDIR', meson.current_source_dir())
57-test_env.set('G_TEST_BUILDDIR', meson.current_build_dir())
58-test_env.set('GDK_PIXBUF_MODULE_FILE', loaders_cache.full_path())
59+if not meson.is_cross_build()
60+ test_env.set('G_TEST_SRCDIR', meson.current_source_dir())
61+ test_env.set('G_TEST_BUILDDIR', meson.current_build_dir())
62+ test_env.set('GDK_PIXBUF_MODULE_FILE', loaders_cache.full_path())
63+endif
64
65 foreach test_name, test_data: installed_tests
66 test_sources = [ test_name + '.c', 'test-common.c' ]