[bug#35446,13/26] gnu: calibre: Move font unbundling to after check phase.
diff mbox series

Message ID 20190427093659.21851-13-mail@brendan.scot
State Accepted
Headers show
  • [bug#35446,01/26] gnu: Use 'license:' prefix in (gnu packages web).
Related show


Context Check Description
cbaines/applying patch success Successfully applied

Commit Message

Brendan Tildesley April 27, 2019, 9:36 a.m. UTC
* gnu/packagse/ebook.scm (calibre): Move font unbundling to after check
  phase. Some of the tests use the font files for various things. It's more
  convenient to just allow the font files to be there than to patche the
  We also take the chance to switch from copying the font files in, to having
  font-liberation as an input and symlinking them.
 gnu/packages/ebook.scm | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff mbox series

diff --git a/gnu/packages/ebook.scm b/gnu/packages/ebook.scm
index 1726f83093..e24d2ac2b9 100644
--- a/gnu/packages/ebook.scm
+++ b/gnu/packages/ebook.scm
@@ -95,14 +95,12 @@ 
             (delete-file "src/odf/thumbnail.py")
-            (delete-file-recursively "resources/fonts/liberation")
         (patches (search-patches "calibre-no-updates-dialog.patch"
     (build-system python-build-system)
      `(("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
@@ -113,6 +111,7 @@ 
      `(("chmlib" ,chmlib)
        ("fontconfig" ,fontconfig)
+       ("font-liberation" ,font-liberation)
        ("glib" ,glib)
        ("icu4c" ,icu4c)
        ("js-mathjax" ,js-mathjax)
@@ -189,17 +188,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))
-         (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")