From a3c8951e2a8a1dc76aa184272fcb107c90246518 Mon Sep 17 00:00:00 2001 From: Raghav Gururajan Date: Sun, 19 Apr 2020 00:51:54 -0400 Subject: [PATCH] gnu: GNU FreeFont: Add otf and woff font formats. * gnu/packages/fonts.scm (font-gnu-freefont)[arguments]: Add otf and woff font formats. * gnu/packages/genealogy.scm (gramps)[inputs]: Change input name of GNU Freefont. Signed-off-by: Leo Famulari --- gnu/packages/fonts.scm | 68 ++++++++++++++++++++++++++------------ gnu/packages/genealogy.scm | 2 +- 2 files changed, 48 insertions(+), 22 deletions(-) diff --git a/gnu/packages/fonts.scm b/gnu/packages/fonts.scm index 9ab5587b98..f1cabf9202 100644 --- a/gnu/packages/fonts.scm +++ b/gnu/packages/fonts.scm @@ -32,6 +32,7 @@ ;;; Copyright © 2020 Amin Bandali ;;; Copyright © 2020 Michael Rohleder ;;; Copyright © 2020 John Soo +;;; Copyright © 2020 Raghav Gururajan ;;; ;;; This file is part of GNU Guix. ;;; @@ -232,9 +233,9 @@ The Lato 2.010 family supports more than 100 Latin-based languages, over 50 Cyrillic-based languages as well as Greek and IPA phonetics.") (license license:silofl1.1))) -(define-public font-gnu-freefont-ttf +(define-public font-gnu-freefont (package - (name "font-gnu-freefont-ttf") + (name "font-gnu-freefont") (version "20120503") (source (origin (method url-fetch) @@ -245,25 +246,50 @@ The Lato 2.010 family supports more than 100 Latin-based languages, over "0yk58blhcd4hm7nyincmqq4jrzjjk82wif2zmk1l3y2m4vif4qhd")))) (build-system gnu-build-system) (arguments - `(#:phases (modify-phases %standard-phases - (delete 'configure) - (replace 'install - (lambda _ - (let ((doc-dir (string-append %output "/share/doc/" - ,name "-" ,version)) - (font-dir (string-append %output - "/share/fonts/truetype"))) - (mkdir-p doc-dir) - (substitute* "Makefile" - (("\\$\\(TMPDIR\\)") doc-dir) - (("sfd/\\*.ttf") "")) - (system* "make" "ttftar") - (mkdir-p font-dir) - (for-each (lambda (file) - (install-file file font-dir)) - (filter - (lambda (file) (string-suffix? "ttf" file)) - (find-files "." ""))))))) + `(#:modules ((srfi srfi-19) ; make-time, et cetera + (guix build utils) + (guix build gnu-build-system)) + #:phases + (modify-phases %standard-phases + (delete 'configure) + (replace 'install + (lambda _ + (let ((doc-dir (string-append %output "/share/doc/" + ,name "-" ,version)) + (ttf-font-dir (string-append %output + "/share/fonts/ttf")) + (otf-font-dir (string-append %output + "/share/fonts/otf")) + (woff-font-dir (string-append %output + "/share/fonts/woff"))) + (mkdir-p doc-dir) + (substitute* "Makefile" + (("\\$\\(TMPDIR\\)") doc-dir) + (("sfd/\\*.ttf") "") + (("sfd/\\*.otf") "") + (("sfd/\\*.woff") "")) + ;; XXX The FreeFont Makefile tries to use the current time and + ;; date as names for generated files, and fails silently. But the + ;; fonts are still installed, so don't use INVOKE for now. + (system* "make" "ttftar" "otftar" "wofftar") + (mkdir-p ttf-font-dir) + (mkdir-p otf-font-dir) + (mkdir-p woff-font-dir) + (for-each (lambda (file) + (install-file file ttf-font-dir)) + (filter + (lambda (file) (string-suffix? "ttf" file)) + (find-files "." ""))) + (for-each (lambda (file) + (install-file file otf-font-dir)) + (filter + (lambda (file) (string-suffix? "otf" file)) + (find-files "." ""))) + (for-each (lambda (file) + (install-file file woff-font-dir)) + (filter + (lambda (file) (string-suffix? "woff" file)) + (find-files "." ""))))))) #:test-target "tests")) ;; replace python 3 with python 2 ;; python 3 support commits aren't yet released in 20120503 diff --git a/gnu/packages/genealogy.scm b/gnu/packages/genealogy.scm index 869f69add8..79b24ed048 100644 --- a/gnu/packages/genealogy.scm +++ b/gnu/packages/genealogy.scm @@ -55,7 +55,7 @@ ("intltool" ,intltool))) (inputs `(("cairo" ,cairo) - ("font-gnu-freefont-ttf" ,font-gnu-freefont-ttf) + ("font-gnu-freefont" ,font-gnu-freefont) ("geocode-glib" ,geocode-glib) ("gexiv2" ,gexiv2) ("ghostscript" ,ghostscript) -- 2.26.2