Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame] | 1 | From 2d1b65bd1272ad63b7fbd4babd9a8e8c296d15b5 Mon Sep 17 00:00:00 2001 |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 2 | From: Alexander Kanavin <alex.kanavin@gmail.com> |
| 3 | Date: Fri, 22 Feb 2019 13:22:06 +0100 |
| 4 | Subject: [PATCH] (target only) Work-around thumbnailer and pixdata |
| 5 | cross-compile failure |
| 6 | |
| 7 | Use native gdk-pixbuf-print-mime-types and gdk-pixbuf-pixdata |
| 8 | when generating the thumbnail metadata and resources. |
| 9 | |
| 10 | This works but the mime types will come from native |
| 11 | loader.cache (which will only contain in-tree loaders), not from the |
| 12 | target loader.cache. |
| 13 | |
| 14 | The upstream issue is https://bugzilla.gnome.org/show_bug.cgi?id=779057 |
| 15 | |
| 16 | Upstream-Status: Inappropriate [workaround] |
| 17 | Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame] | 18 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 19 | --- |
| 20 | build-aux/gen-thumbnailer.py | 2 -- |
| 21 | tests/meson.build | 11 +++++++++-- |
| 22 | thumbnailer/meson.build | 5 +---- |
| 23 | 3 files changed, 10 insertions(+), 8 deletions(-) |
| 24 | |
| 25 | diff --git a/build-aux/gen-thumbnailer.py b/build-aux/gen-thumbnailer.py |
| 26 | index 05ac821..c5b99ab 100644 |
| 27 | --- a/build-aux/gen-thumbnailer.py |
| 28 | +++ b/build-aux/gen-thumbnailer.py |
| 29 | @@ -20,8 +20,6 @@ argparser.add_argument('output', help='Output file') |
| 30 | args = argparser.parse_args() |
| 31 | |
| 32 | newenv = os.environ.copy() |
| 33 | -newenv['GDK_PIXBUF_PIXDATA'] = args.pixdata |
| 34 | -newenv['GDK_PIXBUF_MODULE_FILE'] = args.loaders |
| 35 | # 'nt': NT-based Windows, see https://docs.python.org/3/library/os.html |
| 36 | if os.name == 'nt': |
| 37 | gdk_pixbuf_dll_buildpath = os.path.dirname(args.pixdata) |
| 38 | diff --git a/tests/meson.build b/tests/meson.build |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame] | 39 | index 8ed7cc1..e011b77 100644 |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 40 | --- a/tests/meson.build |
| 41 | +++ b/tests/meson.build |
| 42 | @@ -1,12 +1,19 @@ |
| 43 | # Resources; we cannot use gnome.compile_resources() here, because we need to |
| 44 | # override the environment in order to use the utilities we just built instead |
| 45 | # of the system ones |
| 46 | + |
| 47 | +if not meson.is_cross_build() |
| 48 | +pixdata_binary = gdk_pixbuf_pixdata.full_path() |
| 49 | +else |
| 50 | +pixdata_binary = 'gdk-pixbuf-pixdata' |
| 51 | +endif |
| 52 | + |
| 53 | resources_c = custom_target('resources.c', |
| 54 | input: 'resources.gresource.xml', |
| 55 | output: 'resources.c', |
| 56 | command: [ |
| 57 | gen_resources, |
| 58 | - '--pixdata=@0@'.format(gdk_pixbuf_pixdata.full_path()), |
| 59 | + '--pixdata=@0@'.format(pixdata_binary), |
| 60 | '--loaders=@0@'.format(loaders_cache.full_path()), |
| 61 | '--sourcedir=@0@'.format(meson.current_source_dir()), |
| 62 | '--source', |
| 63 | @@ -24,7 +31,7 @@ resources_h = custom_target('resources.h', |
| 64 | output: 'resources.h', |
| 65 | command: [ |
| 66 | gen_resources, |
| 67 | - '--pixdata=@0@'.format(gdk_pixbuf_pixdata.full_path()), |
| 68 | + '--pixdata=@0@'.format(pixdata_binary), |
| 69 | '--loaders=@0@'.format(loaders_cache.full_path()), |
| 70 | '--sourcedir=@0@'.format(meson.current_source_dir()), |
| 71 | '--header', |
| 72 | diff --git a/thumbnailer/meson.build b/thumbnailer/meson.build |
| 73 | index aaafec8..71bd61b 100644 |
| 74 | --- a/thumbnailer/meson.build |
| 75 | +++ b/thumbnailer/meson.build |
| 76 | @@ -18,9 +18,7 @@ custom_target('thumbnailer', |
| 77 | output: 'gdk-pixbuf-thumbnailer.thumbnailer', |
| 78 | command: [ |
| 79 | gen_thumbnailer, |
| 80 | - '--printer=@0@'.format(gdk_pixbuf_print_mime_types.full_path()), |
| 81 | - '--pixdata=@0@'.format(gdk_pixbuf_pixdata.full_path()), |
| 82 | - '--loaders=@0@'.format(loaders_cache.full_path()), |
| 83 | + '--printer=gdk-pixbuf-print-mime-types', |
| 84 | '--bindir=@0@'.format(gdk_pixbuf_bindir), |
| 85 | '@INPUT@', |
| 86 | '@OUTPUT@', |
| 87 | @@ -28,7 +26,6 @@ custom_target('thumbnailer', |
| 88 | depends: [ |
| 89 | gdk_pixbuf_print_mime_types, |
| 90 | gdk_pixbuf_pixdata, |
| 91 | - loaders_cache, |
| 92 | ], |
| 93 | install: true, |
| 94 | install_dir: join_paths(gdk_pixbuf_datadir, 'thumbnailers')) |