[PATCH core-updates] fix gobject-introspection cairo library path

  • Open
  • quality assurance status badge
Details
One participant
  • John Kehayias
Owner
unassigned
Submitted by
John Kehayias
Severity
normal
J
J
John Kehayias wrote on 23 Jun 2021 23:32
(name . guix-patches@gnu.org)(address . guix-patches@gnu.org)
ruSvaOflk1qv2WgsTJJTOaemFjt0USNbYWFV5LiIB_QxUHIv3Fu8FeyBpW6yaKb_ee50dB9WcQzR-AXPIEOyaCmybp5P_VcbItzHIzdoltY=@protonmail.com
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/34080for 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
Toggle diff (29 lines)
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
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 49198@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 49198
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch