Subject: [bug#70546] [PATCH v2] gnu: cairo: Fix cross-compilation.

From: Zheng Junjie <[email-masked]>
Date: Wed, 24 Apr 2024 12:34:25 +0800

* gnu/packages/gtk.scm (cairo)[arguments]: Add ‘fix-cross-compilation’ phase
when cross-compiling.

Change-Id: I3579bb1249c749ee5f164bb4dd47f585b181c2bc
---
 gnu/packages/gtk.scm | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/gtk.scm b/gnu/packages/gtk.scm
index b0098e780e..678bc89378 100644
--- a/gnu/packages/gtk.scm
+++ b/gnu/packages/gtk.scm
@@ -34,7 +34,7 @@
 ;;; Copyright © 2022 Denis 'GNUtoo' Carikli <[email-masked]>
 ;;; Copyright © 2022 Petr Hodina <[email-masked]>
 ;;; Copyright © 2023 Sergiu Ivanov <[email-masked]>
-;;; Copyright © 2023 Zheng Junjie <[email-masked]>
+;;; Copyright © 2023, 2024 Zheng Junjie <[email-masked]>
 ;;; Copyright © 2023 Janneke Nieuwenhuizen <[email-masked]>
 ;;; Copyright © 2024 John Kehayias <[email-masked]>
 ;;;
@@ -182,7 +182,19 @@ (define cairo
      `(#:tests? #f ; see http://lists.gnu.org/archive/html/bug-guix/2013-06/msg00085.html
        #:glib-or-gtk? #t
        #:configure-flags
-       (list "-Dtests=disabled")))
+       (list "-Dtests=disabled")
+       ,@(if (%current-target-system)
+             `(#:phases
+               (modify-phases %standard-phases
+                 (add-after 'unpack 'fix-cross-compilation
+                   (lambda _
+                     ;; XXX: Let meson-build-system can customize the property
+                     (substitute* "meson.build"
+                       (("'ipc_rmid_deferred_release', 'auto'")
+                        ;; see https://github.com/NixOS/nixpkgs/blob/df51f2293e935e85f6a2e69bcf89a40cb31bbc3d/pkgs/development/libraries/cairo/default.nix#L65
+                        ;; XXX: check it on hurd.
+                        "'ipc_rmid_deferred_release', 'true'"))))))
+             '())))
     (native-inputs
      `(,@(if (target-hurd?)
              '()

base-commit: d115af1bcc48f07a40dafd94d1d00926d446d068
-- 
2.41.0