summary refs log tree commit diff
path: root/gnu/packages
diff options
context:
space:
mode:
author宋文武 <iyzsong@gmail.com>2016-03-14 20:10:43 +0800
committer宋文武 <iyzsong@gmail.com>2016-03-16 09:07:00 +0800
commit34dc3907ac000cad8234dfab8562c5eb580239d0 (patch)
treea1ea485a847a4619e4bbc7afd2ae0f11d582359c /gnu/packages
parent1714e2c39c92fe61e45bcddeacb823ffe2827f17 (diff)
downloadguix-34dc3907ac000cad8234dfab8562c5eb580239d0.tar.gz
gnu: Add gdk-pixbuf+svg.
* gnu/packages/gtk.scm (gdk-pixbuf+svg): New variable.
Diffstat (limited to 'gnu/packages')
-rw-r--r--gnu/packages/gtk.scm29
1 files changed, 29 insertions, 0 deletions
diff --git a/gnu/packages/gtk.scm b/gnu/packages/gtk.scm
index 1a10e9b551..3bc4b8dc07 100644
--- a/gnu/packages/gtk.scm
+++ b/gnu/packages/gtk.scm
@@ -433,6 +433,35 @@ in the GNOME project.")
    (license license:lgpl2.0+)
    (home-page "https://developer.gnome.org/gdk-pixbuf/")))
 
+;; To build gdk-pixbuf with SVG support, we need librsvg, and librsvg depends
+;; on gdk-pixbuf, so this new varibale.  Also, librsvg adds 90MiB to the
+;; closure size.
+(define-public gdk-pixbuf+svg
+  (package (inherit gdk-pixbuf)
+    (name "gdk-pixbuf+svg")
+    (inputs
+     `(("librsvg" ,librsvg)
+       ,@(package-inputs gdk-pixbuf)))
+    (arguments
+     '(#:configure-flags '("--with-x11")
+       #:tests? #f ; tested by the gdk-pixbuf package already
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'install 'register-svg-loader
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((out     (assoc-ref outputs "out"))
+                    (librsvg (assoc-ref inputs "librsvg"))
+                    (loaders
+                     (append
+                      (find-files out "^libpixbufloader-.*\\.so$")
+                      (find-files librsvg "^libpixbufloader-.*\\.so$")))
+                    (gdk-pixbuf-query-loaders
+                     (string-append out "/bin/gdk-pixbuf-query-loaders")))
+               (zero? (apply system* `(,gdk-pixbuf-query-loaders
+                                       "--update-cache" ,@loaders)))))))))
+    (synopsis
+     "GNOME image loading and manipulation library, with SVG support")))
+
 (define-public at-spi2-core
   (package
    (name "at-spi2-core")