summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
authorBrendan Tildesley <mail@brendan.scot>2019-05-05 13:35:14 +0200
committerDanny Milosavljevic <dannym@scratchpost.org>2019-05-05 14:44:20 +0200
commit13068a8ccf68653f082728b8809c46970cb97f60 (patch)
tree93ee8562b09feb4e28fc72d9d690e0c8bbabe3fd /gnu
parent4f299020801f1f41ff66d93b7a7a8c51285c3675 (diff)
downloadguix-13068a8ccf68653f082728b8809c46970cb97f60.tar.gz
gnu: calibre: Move font unbundling to after check phase.
* gnu/packages/ebook.scm (calibre)[snippet]: Modify.
[native-inputs]: Remove font-liberation.
[inputs]: Add font-liberation.
[arguments]<#:phases>[install-font-liberation]: Delete phase.
[unbundle-font-liberation]: New phase.

Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/ebook.scm22
1 files changed, 11 insertions, 11 deletions
diff --git a/gnu/packages/ebook.scm b/gnu/packages/ebook.scm
index 6bc3813725..799eed6095 100644
--- a/gnu/packages/ebook.scm
+++ b/gnu/packages/ebook.scm
@@ -95,13 +95,11 @@
         (snippet
           '(begin
             (delete-file "src/odf/thumbnail.py")
-            (delete-file-recursively "resources/fonts/liberation")
             #t))
         (patches (search-patches "calibre-no-updates-dialog.patch"))))
     (build-system python-build-system)
     (native-inputs
      `(("pkg-config" ,pkg-config)
-       ("font-liberation" ,font-liberation)
        ("qtbase" ,qtbase) ; for qmake
        ;; xdg-utils is supposed to be used for desktop integration, but it
        ;; also creates lots of messages
@@ -112,6 +110,7 @@
     (inputs
      `(("chmlib" ,chmlib)
        ("fontconfig" ,fontconfig)
+       ("font-liberation" ,font-liberation)
        ("glib" ,glib)
        ("icu4c" ,icu4c)
        ("js-mathjax" ,js-mathjax)
@@ -190,17 +189,18 @@
              (invoke "python2" "setup.py" "mathjax""--system-mathjax" "--path-to-mathjax"
                      (string-append (assoc-ref inputs "js-mathjax") "/share/javascript/mathjax"))
              (invoke "python2" "setup.py" "rapydscript")))
-         (add-after 'install 'install-font-liberation
+         ;; The font TTF files are used in some miscellaneous tests, so we
+         ;; unbundle them here to avoid patching the tests.
+         (add-after 'install 'unbundle-font-liberation
            (lambda* (#:key inputs outputs #:allow-other-keys)
-             (for-each (lambda (file)
-                         (install-file file (string-append
-                                             (assoc-ref outputs "out")
-                                             "/share/calibre/fonts/liberation")))
-                       (find-files (string-append
-                                    (assoc-ref inputs "font-liberation")
-                                    "/share/fonts/truetype")))
+             (let ((font-dest (string-append (assoc-ref outputs "out")
+                                             "/share/calibre/fonts/liberation"))
+                   (font-src (string-append (assoc-ref inputs "font-liberation")
+                                            "/share/fonts/truetype")))
+               (delete-file-recursively font-dest)
+               (symlink font-src font-dest))
              #t))
-         (add-after 'install-font-liberation 'install-mimetypes
+         (add-after 'unbundle-font-liberation 'install-mimetypes
            (lambda* (#:key outputs #:allow-other-keys)
              (install-file "resources/calibre-mimetypes.xml"
                            (string-append (assoc-ref outputs "out")