+++ /dev/null
-From e46317a80e9d37d7b9c4cbf43ff1d60c3ac21fff Mon Sep 17 00:00:00 2001
-From: Ross Burton <ross.burton@arm.com>
-Date: Mon, 11 May 2026 12:34:53 +0100
-Subject: [PATCH 1/2] gdk-pixbuf-loader/meson_install: improve argument parsing
- and logic
-
-Make the arguments more explicit by changing the path arguments to be
-specified with options, such as --queryloaders <path>. Previously one of
-the paths had an option, but the others were order-based.
-
-Check that either all of the paths have been set or --show-cross-message
-has been passed. If this is not the case, print the usage and exit.
-
-Clean up Path usage, as the options are using pathlib.Path types in the
-parser another Path instance does not need to be created.
-
-None of this changes the underlying logic, just makes it more consistent
-and explicit.
-
-Upstream-Status: Submitted [https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/1194]
-Signed-off-by: Ross Burton <ross.burton@arm.com>
----
- gdk-pixbuf-loader/meson.build | 4 +++-
- gdk-pixbuf-loader/meson_install.py | 23 +++++++++++------------
- 2 files changed, 14 insertions(+), 13 deletions(-)
-
-diff --git a/gdk-pixbuf-loader/meson.build b/gdk-pixbuf-loader/meson.build
-index 951d2d1c9..c7c017978 100644
---- a/gdk-pixbuf-loader/meson.build
-+++ b/gdk-pixbuf-loader/meson.build
-@@ -43,9 +43,11 @@ else
- endif
-
- pixbufloader_svg_install_args = [
-- '--gdk-pixbuf-moduledir',
-+ '--moduledir',
- pixbuf_dep.get_variable(pkgconfig: 'gdk_pixbuf_moduledir', pkgconfig_define: ['prefix', prefix]),
-+ '--queryloaders',
- gdk_pixbuf_query_loaders,
-+ '--cache-file',
- pixbuf_dep.get_variable(pkgconfig: 'gdk_pixbuf_cache_file', pkgconfig_define: ['prefix', prefix])
- ]
-
-diff --git a/gdk-pixbuf-loader/meson_install.py b/gdk-pixbuf-loader/meson_install.py
-index ff003350f..d9bbbe433 100644
---- a/gdk-pixbuf-loader/meson_install.py
-+++ b/gdk-pixbuf-loader/meson_install.py
-@@ -6,29 +6,28 @@ import os
- import subprocess
- import sys
-
--argparse = ArgumentParser('Deploy loaders.cache')
--
--argparse.add_argument('--gdk-pixbuf-moduledir', type=Path)
--argparse.add_argument('gdk_pixbuf_queryloaders', type=Path)
--argparse.add_argument('gdk_pixbuf_cache_file', type=Path)
--argparse.add_argument('--show-cross-message', action='store_true')
--
- if __name__ == '__main__':
-+ argparse = ArgumentParser(description='Deploy loaders.cache. Pass required paths, or --show-cross-message.')
-+ argparse.add_argument('--queryloaders', type=Path, metavar="PATH", help="gdk-pixbuf-queryloaders to run")
-+ argparse.add_argument('--moduledir', type=Path, metavar="PATH", help="installed gdk-pixbuf module directory")
-+ argparse.add_argument('--cache-file', type=Path, metavar="PATH", help="module cache file to write")
-+ argparse.add_argument('--show-cross-message', action='store_true', help="tell the user to run query-loaders manually")
- args = argparse.parse_args()
-
-- cache_file: Path = args.gdk_pixbuf_cache_file
-+ if not(args.show_cross_message or (args.queryloaders and args.moduledir and args.cache_file)):
-+ argparse.print_help()
-+ sys.exit(1)
-
- if args.show_cross_message or os.environ.get("DESTDIR"):
- print('*** Note: Please run gdk-pixbuf-queryloaders manually ' +
- 'against the newly-built gdkpixbuf-svg loader', file=sys.stderr)
- else:
- env = os.environ.copy()
-- env['GDK_PIXBUF_MODULEDIR'] = Path(args.gdk_pixbuf_moduledir).as_posix()
-- with cache_file.open('w', encoding='utf-8') as f:
-+ env['GDK_PIXBUF_MODULEDIR'] = args.moduledir.as_posix()
-+ with args.cache_file.open('w', encoding='utf-8') as f:
- subprocess.run(
-- [Path(args.gdk_pixbuf_queryloaders).as_posix()],
-+ [args.queryloaders.as_posix()],
- env=env,
- stdout=f,
- check=True
- )
--
---
-2.43.0
-
-
-From 85e11b2c1c6b2a27949a0e3e883c01e4b48060e0 Mon Sep 17 00:00:00 2001
-From: Ross Burton <ross.burton@arm.com>
-Date: Mon, 11 May 2026 12:46:08 +0100
-Subject: [PATCH 2/2] gdk-pixbuf-loader: fix install logic in cross builds
-
-The logic in this install rule was getting complicated, but it should be
-quite simple really:
-
-- In native builds we can run host binaries. Look for the
- gdk-pixbuf-query-loaders tool and run it when installing.
-- In cross builds we might be able to run host binaries, if an executable
- wrapper has been set _and_ if the target sysroot contains executables.
-
-The presence of target executables isn't a given, as some systems (such
-as OpenEmbedded) strip the target sysroot down to headers are libraries.
-
-So the logic should be:
-
-- In native builds, look for query-loaders and fail if not found.
-- In cross builds where you can run host binaries, look for query-loaders
- but allow it to be missing.
-- In cross builds where you cannot run host binaries, there's no use in
- looking for query-loaders.
-
-Then either pass the paths or --show-cross-message to meson_install.py,
-depending on whether query-loaders was found or not.
-
-This fixes the case where Meson can run host executables, but the target
-sysroot does not actually contain gdk-pixbuf-query-loaders.
----
- gdk-pixbuf-loader/meson.build | 28 +++++++++++++---------------
- 1 file changed, 13 insertions(+), 15 deletions(-)
-
-diff --git a/gdk-pixbuf-loader/meson.build b/gdk-pixbuf-loader/meson.build
-index c7c017978..4f88ba037 100644
---- a/gdk-pixbuf-loader/meson.build
-+++ b/gdk-pixbuf-loader/meson.build
-@@ -37,23 +37,21 @@ pixbuf_thumbnailer = configure_file(
- )
-
- if meson.can_run_host_binaries()
-- gdk_pixbuf_query_loaders = find_program(pixbuf_dep.get_variable(pkgconfig: 'gdk_pixbuf_query_loaders', default_value: 'gdk-pixbuf-query-loaders')).path()
--else
-- gdk_pixbuf_query_loaders = pixbuf_dep.get_variable(pkgconfig: 'gdk_pixbuf_query_loaders', pkgconfig_define: ['prefix', prefix])
-+ gdk_pixbuf_query_loaders = find_program(pixbuf_dep.get_variable(pkgconfig: 'gdk_pixbuf_query_loaders', default_value: 'gdk-pixbuf-query-loaders'), required: not meson.is_cross_build())
- endif
-
--pixbufloader_svg_install_args = [
-- '--moduledir',
-- pixbuf_dep.get_variable(pkgconfig: 'gdk_pixbuf_moduledir', pkgconfig_define: ['prefix', prefix]),
-- '--queryloaders',
-- gdk_pixbuf_query_loaders,
-- '--cache-file',
-- pixbuf_dep.get_variable(pkgconfig: 'gdk_pixbuf_cache_file', pkgconfig_define: ['prefix', prefix])
--]
--
--# Tell people to run gdk-pixbuf-query-loaders manually for cross builds
--if not meson.can_run_host_binaries()
-- pixbufloader_svg_install_args += '--show-cross-message'
-+if meson.can_run_host_binaries() and gdk_pixbuf_query_loaders.found()
-+ pixbufloader_svg_install_args = [
-+ '--moduledir',
-+ pixbuf_dep.get_variable(pkgconfig: 'gdk_pixbuf_moduledir', pkgconfig_define: ['prefix', prefix]),
-+ '--queryloaders',
-+ gdk_pixbuf_query_loaders.full_path(),
-+ '--cache-file',
-+ pixbuf_dep.get_variable(pkgconfig: 'gdk_pixbuf_cache_file', pkgconfig_define: ['prefix', prefix])
-+ ]
-+else
-+ # Tell people to run gdk-pixbuf-query-loaders manually for cross builds
-+ pixbufloader_svg_install_args = ['--show-cross-message']
- endif
-
- meson.add_install_script(
---
-2.43.0
-