gnu: Update harfbuzz to 0.9.20.
[jackhill/guix/guix.git] / gnu / packages / fonts.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org>
3 ;;;
4 ;;; This file is part of GNU Guix.
5 ;;;
6 ;;; GNU Guix is free software; you can redistribute it and/or modify it
7 ;;; under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation; either version 3 of the License, or (at
9 ;;; your option) any later version.
10 ;;;
11 ;;; GNU Guix is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;; GNU General Public License for more details.
15 ;;;
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
18
19 (define-module (gnu packages fonts)
20 #:use-module ((guix licenses)
21 #:renamer (symbol-prefix-proc 'license:))
22 #:use-module (guix packages)
23 #:use-module (guix download)
24 #:use-module (guix build-system trivial)
25 #:use-module ((gnu packages base)
26 #:select (tar))
27 #:use-module (gnu packages compression))
28
29 (define-public ttf-bitstream-vera
30 (package
31 (name "ttf-bitstream-vera")
32 (version "1.10")
33 (source (origin
34 (method url-fetch)
35 (uri (string-append "mirror://gnome/sources/ttf-bitstream-vera/"
36 version "/ttf-bitstream-vera-"
37 version ".tar.bz2"))
38 (sha256
39 (base32
40 "1p3qs51x5327gnk71yq8cvmxc6wgx79sqxfvxcv80cdvgggjfnyv"))))
41 (build-system trivial-build-system)
42 (arguments
43 `(#:modules ((guix build utils))
44 #:builder (begin
45 (use-modules (guix build utils)
46 (srfi srfi-26))
47
48 (let ((tar (string-append (assoc-ref %build-inputs
49 "tar")
50 "/bin/tar"))
51 (PATH (string-append (assoc-ref %build-inputs
52 "bzip2")
53 "/bin"))
54 (font-dir (string-append %output
55 "/share/fonts/truetype"))
56 (doc-dir (string-append %output "/share/doc/"
57 ,name "-" ,version)))
58 (setenv "PATH" PATH)
59 (system* tar "xvf" (assoc-ref %build-inputs "source"))
60
61 (mkdir-p font-dir)
62 (mkdir-p doc-dir)
63 (chdir (string-append "ttf-bitstream-vera-" ,version))
64 (for-each (lambda (ttf)
65 (copy-file ttf
66 (string-append font-dir "/" ttf)))
67 (find-files "." "\\.ttf$"))
68 (for-each (lambda (doc)
69 (copy-file doc
70 (string-append doc-dir "/" doc)))
71 (find-files "." "\\.TXT$"))))))
72 (native-inputs `(("source" ,source)
73 ("tar" ,tar)
74 ("bzip2" ,bzip2)))
75 (home-page "https://www-old.gnome.org/fonts/")
76 (synopsis "Bitstream Vera sans-serif typeface")
77 (description "Vera is a sans-serif typeface from Bitstream, Inc. This
78 package provides the TrueType (TTF) files.")
79 (license
80 (license:x11-style
81 "https://www-old.gnome.org/fonts/#Final_Bitstream_Vera_Fonts"))))
82
83 (define-public freefont-ttf
84 (package
85 (name "freefont-ttf")
86 (version "20100919")
87 (source (origin
88 (method url-fetch)
89 (uri (string-append "mirror://gnu/freefont/freefont-ttf-"
90 version ".tar.gz"))
91 (sha256
92 (base32
93 "1q3h5jp1mbdkinkwxy0lfd0a1q7azlbagraydlzaa2ng82836wg4"))))
94 (build-system trivial-build-system)
95 (arguments
96 `(#:modules ((guix build utils))
97 #:builder (begin
98 (use-modules (guix build utils)
99 (srfi srfi-26))
100
101 (let ((tar (string-append (assoc-ref %build-inputs
102 "tar")
103 "/bin/tar"))
104 (PATH (string-append (assoc-ref %build-inputs
105 "gzip")
106 "/bin"))
107 (font-dir (string-append %output
108 "/share/fonts/truetype"))
109 (doc-dir (string-append %output "/share/doc/"
110 ,name "-" ,version)))
111 (setenv "PATH" PATH)
112 (system* tar "xvf" (assoc-ref %build-inputs "source"))
113
114 (mkdir-p font-dir)
115 (mkdir-p doc-dir)
116 (chdir (string-append "freefont-" ,version))
117 (for-each (lambda (file)
118 (let ((dir (if (string-suffix? "ttf" file)
119 font-dir
120 doc-dir)))
121 (copy-file file
122 (string-append dir "/" file))))
123 (find-files "." ""))))))
124 (native-inputs `(("source" ,source)
125 ("tar" ,tar)
126 ("gzip" ,gzip)))
127 (home-page "http://www.gnu.org/software/freefont/")
128 (synopsis "Unicode-encoded outline fonts")
129 (description
130 "The GNU Freefont project aims to provide a set of free outline
131 (PostScript Type0, TrueType, OpenType...) fonts covering the ISO
132 10646/Unicode UCS (Universal Character Set).")
133 (license license:gpl3+)))