summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2018-05-28 21:47:01 +0200
committerLudovic Courtès <ludo@gnu.org>2018-06-01 15:21:28 +0200
commit33d8a871042e73d6b236793d02e5a8287a47ebe4 (patch)
tree1b9286fea56e63450b875b509af9cec46a3725f6 /gnu
parent31a5d694a3b9200bfde253eafbaca118b773fb96 (diff)
bootloader: grub: Use 'with-extensions'.
* gnu/bootloader/grub.scm (svg->png): Use 'with-extensions'. Remove 'add-to-load-path' calls. * gnu/build/svg.scm: Use (rsvg) and (cairo) the normal way. Remove 'module-autoload!' calls.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/bootloader/grub.scm19
-rw-r--r--gnu/build/svg.scm11
2 files changed, 9 insertions, 21 deletions
diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm
index e90a6a11eb2..a131f3b5062 100644
--- a/gnu/bootloader/grub.scm
+++ b/gnu/bootloader/grub.scm
@@ -123,19 +123,12 @@ otherwise."
123 "Build a PNG of HEIGHT x WIDTH from SVG." 123 "Build a PNG of HEIGHT x WIDTH from SVG."
124 (gexp->derivation "grub-image.png" 124 (gexp->derivation "grub-image.png"
125 (with-imported-modules '((gnu build svg)) 125 (with-imported-modules '((gnu build svg))
126 #~(begin 126 (with-extensions (list guile-rsvg guile-cairo)
127 ;; We need these two libraries. 127 #~(begin
128 (add-to-load-path (string-append #+guile-rsvg 128 (use-modules (gnu build svg))
129 "/share/guile/site/" 129 (svg->png #+svg #$output
130 (effective-version))) 130 #:width #$width
131 (add-to-load-path (string-append #+guile-cairo 131 #:height #$height))))))
132 "/share/guile/site/"
133 (effective-version)))
134
135 (use-modules (gnu build svg))
136 (svg->png #+svg #$output
137 #:width #$width
138 #:height #$height)))))
139 132
140(define* (grub-background-image config #:key (width 1024) (height 768)) 133(define* (grub-background-image config #:key (width 1024) (height 768))
141 "Return the GRUB background image defined in CONFIG with a ratio of 134 "Return the GRUB background image defined in CONFIG with a ratio of
diff --git a/gnu/build/svg.scm b/gnu/build/svg.scm
index b5474ec4a09..6f1f4b36846 100644
--- a/gnu/build/svg.scm
+++ b/gnu/build/svg.scm
@@ -1,5 +1,5 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2016, 2017 Ludovic Courtès <ludo@gnu.org> 2;;; Copyright © 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
3;;; Copyright © 2015 Andy Wingo <wingo@igalia.com> 3;;; Copyright © 2015 Andy Wingo <wingo@igalia.com>
4;;; 4;;;
5;;; This file is part of GNU Guix. 5;;; This file is part of GNU Guix.
@@ -18,16 +18,11 @@
18;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. 18;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19 19
20(define-module (gnu build svg) 20(define-module (gnu build svg)
21 #:use-module (rsvg)
22 #:use-module (cairo)
21 #:use-module (srfi srfi-11) 23 #:use-module (srfi srfi-11)
22 #:export (svg->png)) 24 #:export (svg->png))
23 25
24;; We need Guile-RSVG and Guile-Cairo. Load them lazily, at run time, to
25;; allow compilation to proceed. See also <http://bugs.gnu.org/12202>.
26(module-autoload! (current-module)
27 '(rsvg) '(rsvg-handle-new-from-file))
28(module-autoload! (current-module)
29 '(cairo) '(cairo-image-surface-create))
30
31(define* (downscaled-surface surface 26(define* (downscaled-surface surface
32 #:key 27 #:key
33 source-width source-height 28 source-width source-height