unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: John Kehayias via Guix-patches via <guix-patches@gnu.org>
To: 49198@debbugs.gnu.org
Subject: [bug#49198] [PATCH core-updates] fix gobject-introspection cairo library path
Date: Wed, 23 Jun 2021 21:32:03 +0000	[thread overview]
Message-ID: <ruSvaOflk1qv2WgsTJJTOaemFjt0USNbYWFV5LiIB_QxUHIv3Fu8FeyBpW6yaKb_ee50dB9WcQzR-AXPIEOyaCmybp5P_VcbItzHIzdoltY=@protonmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 700 bytes --]

Hello,

This is a patch to fix issue #49122 (gobject-introspection and not finding cairo). The patch changes the cairo typelib file to include the absolute path to the cairo patch (as required by libraries that use introspection via gir) by modifying the input file. I believe this is exactly what is done in nix to solve the same issue, see https://github.com/NixOS/nixpkgs/issues/34080 for their discussion and fix.

I believe this necessitates building with a cairo dependency to have the library path available, but correct me if I'm wrong as I'm new to guix. I've used cairo-sans-poppler to avoid the dependency cycle. I've tested this builds and solves issue #49122 for me.

Thanks!
John

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: gobject-introspection-cairo-library-location.patch --]
[-- Type: text/x-patch; name=gobject-introspection-cairo-library-location.patch, Size: 1159 bytes --]

diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm
index 206222b578..3434e699d2 100644
--- a/gnu/packages/glib.scm
+++ b/gnu/packages/glib.scm
@@ -496,6 +496,14 @@ dynamic loading, and an object system.")
     (arguments
      `(#:phases
        (modify-phases %standard-phases
+         (add-after 'unpack 'patch
+           ;; Patch for cairo library location
+           (lambda* (#:key inputs #:allow-other-keys)
+              (substitute* "gir/cairo-1.0.gir.in"
+                (("shared-library=\"@CAIRO_SHARED_LIBRARY@\"")
+                 (string-append "shared-library=\""
+                                (assoc-ref inputs "cairo")
+                                "/lib/@CAIRO_SHARED_LIBRARY@\"")))))
          (add-after 'unpack 'do-not-use-/usr/bin/env
            (lambda _
              (substitute* "tools/g-ir-tool-template.in"
@@ -507,6 +515,7 @@ dynamic loading, and an object system.")
        ("pkg-config" ,pkg-config)))
     (inputs
      `(("bison" ,bison)
+       ("cairo" ,cairo-sans-poppler) ; break dependency loop via poppler
        ("flex" ,flex)
        ("glib" ,glib)
        ("python" ,python-wrapper)
-- 
2.32.0


                 reply	other threads:[~2021-06-23 22:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='ruSvaOflk1qv2WgsTJJTOaemFjt0USNbYWFV5LiIB_QxUHIv3Fu8FeyBpW6yaKb_ee50dB9WcQzR-AXPIEOyaCmybp5P_VcbItzHIzdoltY=@protonmail.com' \
    --to=guix-patches@gnu.org \
    --cc=49198@debbugs.gnu.org \
    --cc=john.kehayias@protonmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).