| 1 | This patch provides a correct library path when shared libraries referenced by
|
| 2 | typelibs are installed in a subdirectory of lib/ rather than directly
|
| 3 | underneath it. It works in combination with the
|
| 4 | gobject-introspection-absolute-shlib-path.patch patch that adds the
|
| 5 | '--fallback-library-path' option to its 'g-ir-scanner' command.
|
| 6 |
|
| 7 | Retrieved-from: <https://raw.githubusercontent.com/NixOS/nixpkgs/refs/heads/master/pkgs/by-name/me/meson/004-gir-fallback-path.patch>
|
| 8 |
|
| 9 | diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
|
| 10 | index 1c6952df7..9466a0b7d 100644
|
| 11 | |
| 12 | |
| 13 | @@ -923,6 +923,16 @@ class GnomeModule(ExtensionModule):
|
| 14 | if fatal_warnings:
|
| 15 | scan_command.append('--warn-error')
|
| 16 |
|
| 17 | + if len(set(girtarget.get_custom_install_dir()[0] for girtarget in girtargets if girtarget.get_custom_install_dir())) > 1:
|
| 18 | + raise MesonException('generate_gir tries to build multiple libraries with different install_dir at once: {}'.format(','.join([str(girtarget) for girtarget in girtargets])))
|
| 19 | +
|
| 20 | + if girtargets[0].get_custom_install_dir():
|
| 21 | + fallback_libpath = girtargets[0].get_custom_install_dir()[0]
|
| 22 | + else:
|
| 23 | + fallback_libpath = None
|
| 24 | + if fallback_libpath is not None and isinstance(fallback_libpath, str) and len(fallback_libpath) > 0 and fallback_libpath[0] == "/":
|
| 25 | + scan_command += ['--fallback-library-path=' + fallback_libpath]
|
| 26 | +
|
| 27 | generated_files = [f for f in libsources if isinstance(f, (GeneratedList, CustomTarget, CustomTargetIndex))]
|
| 28 |
|
| 29 | scan_target = self._make_gir_target(state, girfile, scan_command, generated_files, depends, kwargs)
|