From 52b8beb1095bbf9152897656b19de6190235a918 Mon Sep 17 00:00:00 2001 From: 宋文武 Date: Tue, 19 May 2015 16:32:09 +0800 Subject: gnu: gtk+: Add SVG support to 'gtk-encode-symbolic-svg'. * gnu/packages/gtk.scm (gtk+)[inputs]: Add librsvg. [arguments]: Add 'wrap-gtk-encode-symbolic-svg' phase. --- gnu/packages/gtk.scm | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'gnu') diff --git a/gnu/packages/gtk.scm b/gnu/packages/gtk.scm index 9a7e8f9109..f518992498 100644 --- a/gnu/packages/gtk.scm +++ b/gnu/packages/gtk.scm @@ -505,7 +505,8 @@ (define-public gtk+ ("libxdamage" ,libxdamage) ("pango" ,pango))) (inputs - `(("libxml2" ,libxml2) + `(("librsvg" ,librsvg) ;for gtk-encode-symbolic-svg + ("libxml2" ,libxml2) ("cups" ,cups))) ;for printing support (native-inputs `(("perl" ,perl) @@ -537,7 +538,18 @@ (define-public gtk+ "demos/gtk-demo/Makefile.in") (("gtk-update-icon-cache") "$(bindir)/gtk-update-icon-cache")) #t) - %standard-phases))))) + (alist-cons-after + 'install 'wrap-gtk-encode-symbolic-svg + ;; By using GdkPixbuf, gtk-encode-symbolic-svg needs to know + ;; librsvg's loaders.cache to handle SVG files. + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (prog (string-append out "/bin/gtk-encode-symbolic-svg")) + (librsvg (assoc-ref inputs "librsvg")) + (loaders.cache (find-files librsvg "^loaders\\.cache$"))) + (wrap-program prog + `("GDK_PIXBUF_MODULE_FILE" = ,loaders.cache)))) + %standard-phases)))))) ;;; ;;; Guile bindings. -- cgit v1.2.3