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>
This commit is contained in:
Brendan Tildesley 2019-05-05 13:35:14 +02:00 committed by Danny Milosavljevic
parent 4f29902080
commit 13068a8ccf
No known key found for this signature in database
GPG Key ID: E71A35542C30BAA5
1 changed files with 11 additions and 11 deletions

View File

@ -95,13 +95,11 @@
(snippet (snippet
'(begin '(begin
(delete-file "src/odf/thumbnail.py") (delete-file "src/odf/thumbnail.py")
(delete-file-recursively "resources/fonts/liberation")
#t)) #t))
(patches (search-patches "calibre-no-updates-dialog.patch")))) (patches (search-patches "calibre-no-updates-dialog.patch"))))
(build-system python-build-system) (build-system python-build-system)
(native-inputs (native-inputs
`(("pkg-config" ,pkg-config) `(("pkg-config" ,pkg-config)
("font-liberation" ,font-liberation)
("qtbase" ,qtbase) ; for qmake ("qtbase" ,qtbase) ; for qmake
;; xdg-utils is supposed to be used for desktop integration, but it ;; xdg-utils is supposed to be used for desktop integration, but it
;; also creates lots of messages ;; also creates lots of messages
@ -112,6 +110,7 @@
(inputs (inputs
`(("chmlib" ,chmlib) `(("chmlib" ,chmlib)
("fontconfig" ,fontconfig) ("fontconfig" ,fontconfig)
("font-liberation" ,font-liberation)
("glib" ,glib) ("glib" ,glib)
("icu4c" ,icu4c) ("icu4c" ,icu4c)
("js-mathjax" ,js-mathjax) ("js-mathjax" ,js-mathjax)
@ -190,17 +189,18 @@
(invoke "python2" "setup.py" "mathjax""--system-mathjax" "--path-to-mathjax" (invoke "python2" "setup.py" "mathjax""--system-mathjax" "--path-to-mathjax"
(string-append (assoc-ref inputs "js-mathjax") "/share/javascript/mathjax")) (string-append (assoc-ref inputs "js-mathjax") "/share/javascript/mathjax"))
(invoke "python2" "setup.py" "rapydscript"))) (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) (lambda* (#:key inputs outputs #:allow-other-keys)
(for-each (lambda (file) (let ((font-dest (string-append (assoc-ref outputs "out")
(install-file file (string-append "/share/calibre/fonts/liberation"))
(assoc-ref outputs "out") (font-src (string-append (assoc-ref inputs "font-liberation")
"/share/calibre/fonts/liberation"))) "/share/fonts/truetype")))
(find-files (string-append (delete-file-recursively font-dest)
(assoc-ref inputs "font-liberation") (symlink font-src font-dest))
"/share/fonts/truetype")))
#t)) #t))
(add-after 'install-font-liberation 'install-mimetypes (add-after 'unbundle-font-liberation 'install-mimetypes
(lambda* (#:key outputs #:allow-other-keys) (lambda* (#:key outputs #:allow-other-keys)
(install-file "resources/calibre-mimetypes.xml" (install-file "resources/calibre-mimetypes.xml"
(string-append (assoc-ref outputs "out") (string-append (assoc-ref outputs "out")