blob: 2aa91647506e806bc2a6a034bb64277d781ad75e [file] [log] [blame]
Andrew Geisslerc926e172021-05-07 16:11:35 -05001From dcaf3106e2cca27f728a8bd26127430500a1136e Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Fri, 22 Feb 2019 13:22:06 +0100
4Subject: [PATCH] Work-around thumbnailer and pixdata cross-compile failure
5
6Use native gdk-pixbuf-print-mime-types and gdk-pixbuf-pixdata
7when generating the thumbnail metadata and resources.
8
9This works but the mime types will come from native
10loader.cache (which will only contain in-tree loaders), not from the
11target loader.cache.
12
13The upstream issue is https://bugzilla.gnome.org/show_bug.cgi?id=779057
14
15Upstream-Status: Inappropriate [workaround]
16Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
17
18---
19 tests/meson.build | 11 +++++++++--
20 thumbnailer/meson.build | 23 ++++++++++++++++++++++-
21 2 files changed, 31 insertions(+), 3 deletions(-)
22
23diff --git a/tests/meson.build b/tests/meson.build
24index 7c6cb11..07121f1 100644
25--- a/tests/meson.build
26+++ b/tests/meson.build
27@@ -8,13 +8,20 @@ if enabled_loaders.contains('png') and host_system != 'windows'
28 # Resources; we cannot use gnome.compile_resources() here, because we need to
29 # override the environment in order to use the utilities we just built instead
30 # of the system ones
31+
32+ if not meson.is_cross_build()
33+ pixdata_binary = gdk_pixbuf_pixdata.full_path()
34+ else
35+ pixdata_binary = 'gdk-pixbuf-pixdata'
36+ endif
37+
38 resources_c = custom_target('resources.c',
39 input: 'resources.gresource.xml',
40 output: 'resources.c',
41 command: [
42 gen_resources,
43 '--glib-compile-resources=@0@'.format(glib_compile_resources.full_path()),
44- '--pixdata=@0@'.format(gdk_pixbuf_pixdata.full_path()),
45+ '--pixdata=@0@'.format(pixdata_binary),
46 '--loaders=@0@'.format(loaders_cache.full_path()),
47 '--sourcedir=@0@'.format(meson.current_source_dir()),
48 '--source',
49@@ -33,7 +40,7 @@ if enabled_loaders.contains('png') and host_system != 'windows'
50 command: [
51 gen_resources,
52 '--glib-compile-resources=@0@'.format(glib_compile_resources.full_path()),
53- '--pixdata=@0@'.format(gdk_pixbuf_pixdata.full_path()),
54+ '--pixdata=@0@'.format(pixdata_binary),
55 '--loaders=@0@'.format(loaders_cache.full_path()),
56 '--sourcedir=@0@'.format(meson.current_source_dir()),
57 '--header',
58diff --git a/thumbnailer/meson.build b/thumbnailer/meson.build
59index 8c741e0..5a3b52a 100644
60--- a/thumbnailer/meson.build
61+++ b/thumbnailer/meson.build
62@@ -14,7 +14,27 @@ gdk_pixbuf_print_mime_types = executable('gdk-pixbuf-print-mime-types',
63 install: true,
64 dependencies: gdk_pixbuf_deps + [ gdkpixbuf_dep ])
65
66-custom_target('thumbnailer',
67+if meson.is_cross_build()
68+ custom_target('thumbnailer',
69+ input: 'gdk-pixbuf-thumbnailer.thumbnailer.in',
70+ output: 'gdk-pixbuf-thumbnailer.thumbnailer',
71+ command: [
72+ gen_thumbnailer,
73+ '--printer=gdk-pixbuf-print-mime-types',
74+ '--pixdata=@0@'.format(gdk_pixbuf_pixdata.full_path()),
75+ '--loaders=@0@'.format(loaders_cache.full_path()),
76+ '--bindir=@0@'.format(gdk_pixbuf_bindir),
77+ '@INPUT@',
78+ '@OUTPUT@',
79+ ],
80+ depends: [
81+ gdk_pixbuf_print_mime_types,
82+ gdk_pixbuf_pixdata,
83+ ],
84+ install: true,
85+ install_dir: join_paths(gdk_pixbuf_datadir, 'thumbnailers'))
86+else
87+ custom_target('thumbnailer',
88 input: 'gdk-pixbuf-thumbnailer.thumbnailer.in',
89 output: 'gdk-pixbuf-thumbnailer.thumbnailer',
90 command: [
91@@ -33,3 +53,4 @@ custom_target('thumbnailer',
92 ],
93 install: true,
94 install_dir: join_paths(gdk_pixbuf_datadir, 'thumbnailers'))
95+endif