guix_mirror_bot pushed a commit to branch gnome-team
in repository guix.

commit a1c709f452d3356734e5dbacb8f9c470478cb924
Author: Maxim Cournoyer <[email protected]>
AuthorDate: Tue Mar 31 15:16:57 2026 +0900

    gnu: meson: Apply patch to fix computed GIR library paths.
    
    * gnu/packages/build-tools.scm (meson): Apply patch.
    * gnu/packages/patches/meson-gir-fallback-path.patch: New file.
    * gnu/local.mk (dist_patch_DATA): Register it.
    
    Change-Id: I7a54149aa4f7560c689202b5f4db3e3c3f7d9f39
    Signed-off-by: NoĆ© Lopez <[email protected]>
---
 gnu/local.mk                                       |  1 +
 gnu/packages/build-tools.scm                       |  4 ++-
 gnu/packages/patches/meson-gir-fallback-path.patch | 29 ++++++++++++++++++++++
 3 files changed, 33 insertions(+), 1 deletion(-)

diff --git a/gnu/local.mk b/gnu/local.mk
index 17255ab71b..4e4172174f 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1946,6 +1946,7 @@ dist_patch_DATA =                                         
\
   %D%/packages/patches/mediasdk-gcc-14.patch                   \
   %D%/packages/patches/memtest86+-build-reproducibly.patch     \
   %D%/packages/patches/mercurial-hg-extension-path.patch       \
+  %D%/packages/patches/meson-gir-fallback-path.patch           \
   %D%/packages/patches/mhash-keygen-test-segfault.patch                \
   %D%/packages/patches/mia-fix-boost-headers.patch             \
   %D%/packages/patches/mia-gcc11.patch                         \
diff --git a/gnu/packages/build-tools.scm b/gnu/packages/build-tools.scm
index 674c050614..224ee67912 100644
--- a/gnu/packages/build-tools.scm
+++ b/gnu/packages/build-tools.scm
@@ -537,7 +537,9 @@ files and generates build instructions for the Ninja build 
system.")
                                   version ".tar.gz"))
               (sha256
                (base32
-                "13a9pj7d2mxgv5gbd78di4pb4w722vjis0vmk38m1vdm95v2f9yd"))))
+                "13a9pj7d2mxgv5gbd78di4pb4w722vjis0vmk38m1vdm95v2f9yd"))
+              (patches
+               (search-patches "meson-gir-fallback-path.patch"))))
     (build-system gnu-build-system)
     (arguments
      (list
diff --git a/gnu/packages/patches/meson-gir-fallback-path.patch 
b/gnu/packages/patches/meson-gir-fallback-path.patch
new file mode 100644
index 0000000000..b4b55da7dc
--- /dev/null
+++ b/gnu/packages/patches/meson-gir-fallback-path.patch
@@ -0,0 +1,29 @@
+This patch provides a correct library path when shared libraries referenced by
+typelibs are installed in a subdirectory of lib/ rather than directly
+underneath it.  It works in combination with the
+gobject-introspection-absolute-shlib-path.patch patch that adds the
+'--fallback-library-path' option to its 'g-ir-scanner' command.
+
+Retrieved-from: 
<https://raw.githubusercontent.com/NixOS/nixpkgs/refs/heads/master/pkgs/by-name/me/meson/004-gir-fallback-path.patch>
+
+diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
+index 1c6952df7..9466a0b7d 100644
+--- a/mesonbuild/modules/gnome.py
++++ b/mesonbuild/modules/gnome.py
+@@ -923,6 +923,16 @@ class GnomeModule(ExtensionModule):
+         if fatal_warnings:
+             scan_command.append('--warn-error')
+
++        if len(set(girtarget.get_custom_install_dir()[0] for girtarget in 
girtargets if girtarget.get_custom_install_dir())) > 1:
++            raise MesonException('generate_gir tries to build multiple 
libraries with different install_dir at once: 
{}'.format(','.join([str(girtarget) for girtarget in girtargets])))
++
++        if girtargets[0].get_custom_install_dir():
++            fallback_libpath = girtargets[0].get_custom_install_dir()[0]
++        else:
++            fallback_libpath = None
++        if fallback_libpath is not None and isinstance(fallback_libpath, str) 
and len(fallback_libpath) > 0 and fallback_libpath[0] == "/":
++            scan_command += ['--fallback-library-path=' + fallback_libpath]
++
+         generated_files = [f for f in libsources if isinstance(f, 
(GeneratedList, CustomTarget, CustomTargetIndex))]
+ 
+         scan_target = self._make_gir_target(state, girfile, scan_command, 
generated_files, depends, kwargs)

Reply via email to