As mentioned in a previous email, the cache generated by default does
not include support for SVG provided by librsvg itself.  With this
patch we generate a full cache file.

Regards,
Fede
From 36c6d59180bdb2d80e169938097efca39431c122 Mon Sep 17 00:00:00 2001
From: Federico Beffa <be...@fbengineering.ch>
Date: Sun, 2 Nov 2014 18:01:08 +0100
Subject: [PATCH 1/2] gnu: librsvg: Generate complete loaders.cache including
 support for SVG.

* gnu/packages/gnome.scm (librsvg): Add 'generate-full-chage phase.
---
 gnu/packages/gnome.scm | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index f1f1918..22b73f9 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -594,7 +594,10 @@ dealing with different structured file formats.")
                 "071959yjb2i1bja7ciy4bmpnd6fn2is9jjqsvvvnsqwl69j9n128"))))
     (build-system gnu-build-system)
     (arguments
-     `(#:phases
+     `(#:modules ((srfi srfi-1)
+                  (guix build gnu-build-system)
+                  (guix build utils))
+       #:phases
        (alist-cons-before
         'configure 'augment-gir-search-path
         (lambda* (#:key inputs #:allow-other-keys)
@@ -608,7 +611,22 @@ dealing with different structured file formats.")
             ;; Likewise, create a separate 'loaders.cache' file.
             (("gdk_pixbuf_cache_file = .*$")
              "gdk_pixbuf_cache_file = $(gdk_pixbuf_moduledir).cache\n")))
-        %standard-phases)))
+       (alist-cons-after
+        'install 'generate-full-cache
+        (lambda* (#:key inputs outputs #:allow-other-keys)
+          (let ((loaders-directory 
+                 (string-append (assoc-ref outputs "out")
+                                "/lib/gdk-pixbuf-2.0/2.0.10/loaders")))
+            (zero?
+             (system 
+              (string-append 
+               "gdk-pixbuf-query-loaders " 
+               loaders-directory "/libpixbufloader-svg.so "
+               (fold (lambda (s p) (string-append s " " p))  "" 
+                     (find-files (assoc-ref inputs "gdk-pixbuf") 
+                                 "libpixbufloader-.*\\.so"))
+               "> " loaders-directory ".cache")))))
+        %standard-phases))))
     (native-inputs
      `(("pkg-config" ,pkg-config)
        ("glib" ,glib "bin")                               ; glib-mkenums, etc.
-- 
1.8.4

Reply via email to