Merge branch 'master' into 'core-updates'.
[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 ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2014 Joshua Grant <tadni@riseup.net>
5 ;;; Copyright © 2014 Alex Kost <alezost@gmail.com>
6 ;;;
7 ;;; This file is part of GNU Guix.
8 ;;;
9 ;;; GNU Guix is free software; you can redistribute it and/or modify it
10 ;;; under the terms of the GNU General Public License as published by
11 ;;; the Free Software Foundation; either version 3 of the License, or (at
12 ;;; your option) any later version.
13 ;;;
14 ;;; GNU Guix is distributed in the hope that it will be useful, but
15 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;;; GNU General Public License for more details.
18 ;;;
19 ;;; You should have received a copy of the GNU General Public License
20 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21
22 (define-module (gnu packages fonts)
23 #:use-module ((guix licenses) #:prefix license:)
24 #:use-module (guix packages)
25 #:use-module (guix download)
26 #:use-module (guix build-system gnu)
27 #:use-module (guix build-system trivial)
28 #:use-module ((gnu packages base)
29 #:select (tar))
30 #:use-module (gnu packages compression)
31 #:use-module (gnu packages perl)
32 #:use-module (gnu packages xorg)
33 #:use-module (gnu packages pkg-config))
34
35 (define-public font-dejavu
36 (package
37 (name "font-dejavu")
38 (version "2.34")
39 (source (origin
40 (method url-fetch)
41 (uri (string-append "mirror://sourceforge/dejavu/"
42 version "/dejavu-fonts-ttf-"
43 version ".tar.bz2"))
44 (sha256
45 (base32
46 "0pgb0a3ngamidacmrvasg51ck3gp8gn93w6sf1s8snwzx4x2r9yh"))))
47 (build-system trivial-build-system)
48 (arguments
49 `(#:modules ((guix build utils))
50 #:builder (begin
51 (use-modules (guix build utils))
52
53 (let ((tar (string-append (assoc-ref %build-inputs
54 "tar")
55 "/bin/tar"))
56 (PATH (string-append (assoc-ref %build-inputs
57 "bzip2")
58 "/bin"))
59 (font-dir (string-append
60 %output "/share/fonts/truetype"))
61 (conf-dir (string-append
62 %output "/share/fontconfig/conf.avail"))
63 (doc-dir (string-append
64 %output "/share/doc/" ,name "-" ,version)))
65 (setenv "PATH" PATH)
66 (system* tar "xvf" (assoc-ref %build-inputs "source"))
67
68 (mkdir-p font-dir)
69 (mkdir-p conf-dir)
70 (mkdir-p doc-dir)
71 (chdir (string-append "dejavu-fonts-ttf-" ,version))
72 (for-each (lambda (ttf)
73 (copy-file ttf
74 (string-append font-dir "/"
75 (basename ttf))))
76 (find-files "ttf" "\\.ttf$"))
77 (for-each (lambda (conf)
78 (copy-file conf
79 (string-append conf-dir "/"
80 (basename conf))))
81 (find-files "fontconfig" "\\.conf$"))
82 (for-each (lambda (doc)
83 (copy-file doc
84 (string-append doc-dir "/"
85 (basename doc))))
86 (find-files "." "\\.txt$|^[A-Z][A-Z]*$"))))))
87 (native-inputs `(("source" ,source)
88 ("tar" ,tar)
89 ("bzip2" ,bzip2)))
90 (home-page "http://dejavu-fonts.org/")
91 (synopsis "Vera font family derivate with additional characters")
92 (description "DejaVu provides an expanded version of the Vera font family
93 aiming for quality and broader Unicode coverage while retaining the original
94 Vera style. DejaVu currently works towards conformance with the Multilingual
95 European Standards (MES-1 and MES-2) for Unicode coverage. The DejaVu fonts
96 provide serif, sans and monospaced variants.")
97 (license
98 (license:x11-style
99 "http://dejavu-fonts.org/"))))
100
101 (define-public font-bitstream-vera
102 (package
103 (name "font-bitstream-vera")
104 (version "1.10")
105 (source (origin
106 (method url-fetch)
107 (uri (string-append "mirror://gnome/sources/ttf-bitstream-vera/"
108 version "/ttf-bitstream-vera-"
109 version ".tar.bz2"))
110 (sha256
111 (base32
112 "1p3qs51x5327gnk71yq8cvmxc6wgx79sqxfvxcv80cdvgggjfnyv"))))
113 (build-system trivial-build-system)
114 (arguments
115 `(#:modules ((guix build utils))
116 #:builder (begin
117 (use-modules (guix build utils)
118 (srfi srfi-26))
119
120 (let ((tar (string-append (assoc-ref %build-inputs
121 "tar")
122 "/bin/tar"))
123 (PATH (string-append (assoc-ref %build-inputs
124 "bzip2")
125 "/bin"))
126 (font-dir (string-append %output
127 "/share/fonts/truetype"))
128 (doc-dir (string-append %output "/share/doc/"
129 ,name "-" ,version)))
130 (setenv "PATH" PATH)
131 (system* tar "xvf" (assoc-ref %build-inputs "source"))
132
133 (mkdir-p font-dir)
134 (mkdir-p doc-dir)
135 (chdir (string-append "ttf-bitstream-vera-" ,version))
136 (for-each (lambda (ttf)
137 (copy-file ttf
138 (string-append font-dir "/" ttf)))
139 (find-files "." "\\.ttf$"))
140 (for-each (lambda (doc)
141 (copy-file doc
142 (string-append doc-dir "/" doc)))
143 (find-files "." "\\.TXT$"))))))
144 (native-inputs `(("source" ,source)
145 ("tar" ,tar)
146 ("bzip2" ,bzip2)))
147 (home-page "https://www-old.gnome.org/fonts/")
148 (synopsis "Bitstream Vera sans-serif typeface")
149 (description "Vera is a sans-serif typeface from Bitstream, Inc. This
150 package provides the TrueType (TTF) files.")
151 (license
152 (license:x11-style
153 "https://www-old.gnome.org/fonts/#Final_Bitstream_Vera_Fonts"))))
154
155 (define-public font-gnu-freefont-ttf
156 (package
157 (name "font-gnu-freefont-ttf")
158 (version "20100919")
159 (source (origin
160 (method url-fetch)
161 (uri (string-append "mirror://gnu/freefont/freefont-ttf-"
162 version ".tar.gz"))
163 (sha256
164 (base32
165 "1q3h5jp1mbdkinkwxy0lfd0a1q7azlbagraydlzaa2ng82836wg4"))))
166 (build-system trivial-build-system)
167 (arguments
168 `(#:modules ((guix build utils))
169 #:builder (begin
170 (use-modules (guix build utils)
171 (srfi srfi-26))
172
173 (let ((tar (string-append (assoc-ref %build-inputs
174 "tar")
175 "/bin/tar"))
176 (PATH (string-append (assoc-ref %build-inputs
177 "gzip")
178 "/bin"))
179 (font-dir (string-append %output
180 "/share/fonts/truetype"))
181 (doc-dir (string-append %output "/share/doc/"
182 ,name "-" ,version)))
183 (setenv "PATH" PATH)
184 (system* tar "xvf" (assoc-ref %build-inputs "source"))
185
186 (mkdir-p font-dir)
187 (mkdir-p doc-dir)
188 (chdir (string-append "freefont-" ,version))
189 (for-each (lambda (file)
190 (let ((dir (if (string-suffix? "ttf" file)
191 font-dir
192 doc-dir)))
193 (copy-file file
194 (string-append dir "/" file))))
195 (find-files "." ""))))))
196 (native-inputs `(("source" ,source)
197 ("tar" ,tar)
198 ("gzip" ,gzip)))
199 (home-page "http://www.gnu.org/software/freefont/")
200 (synopsis "Unicode-encoded outline fonts")
201 (description
202 "The GNU Freefont project aims to provide a set of free outline
203 (PostScript Type0, TrueType, OpenType...) fonts covering the ISO
204 10646/Unicode UCS (Universal Character Set).")
205 (license license:gpl3+)))
206
207 (define-public font-liberation
208 (package
209 (name "font-liberation")
210 (version "2.00.1")
211 (source (origin
212 (method url-fetch)
213 (uri (string-append "https://fedorahosted.org/releases/l/i/"
214 "liberation-fonts/liberation-fonts-ttf-"
215 version ".tar.gz"))
216 (sha256
217 (base32
218 "010m4zfqan4w04b6bs9pm3gapn9hsb18bmwwgp2p6y6idj52g43q"))))
219 (build-system trivial-build-system)
220 (arguments
221 `(#:modules ((guix build utils))
222 #:builder
223 (begin
224 (use-modules (guix build utils))
225
226 (let ((tar (string-append (assoc-ref %build-inputs "tar")
227 "/bin/tar"))
228 (PATH (string-append (assoc-ref %build-inputs "gzip")
229 "/bin"))
230 (font-dir (string-append %output "/share/fonts/truetype"))
231 (doc-dir (string-append %output "/share/doc/" ,name)))
232 (setenv "PATH" PATH)
233 (system* tar "xvf" (assoc-ref %build-inputs "source"))
234 (mkdir-p font-dir)
235 (mkdir-p doc-dir)
236 (chdir (string-append "liberation-fonts-ttf-" ,version))
237 (for-each (lambda (ttf)
238 (copy-file ttf
239 (string-append font-dir "/"
240 (basename ttf))))
241 (find-files "." "\\.ttf$"))
242 (for-each (lambda (doc)
243 (copy-file doc
244 (string-append doc-dir "/"
245 (basename doc))))
246 '("AUTHORS" "ChangeLog" "LICENSE" "README" "TODO"))))))
247 (native-inputs
248 `(("source" ,source)
249 ("tar" ,tar)
250 ("gzip" ,gzip)))
251 (home-page "https://fedorahosted.org/liberation-fonts/")
252 (synopsis
253 "Fonts compatible with Arial, Times New Roman, and Courier New")
254 (description
255 "The Liberation font family aims at metric compatibility with
256 Arial, Times New Roman, and Courier New.
257
258 There are three sets:
259
260 - Sans (a substitute for Arial, Albany, Helvetica, Nimbus Sans L, and
261 Bitstream Vera Sans);
262
263 - Serif (a substitute for Times New Roman, Thorndale, Nimbus Roman, and
264 Bitstream Vera Serif);
265
266 - Mono (a substitute for Courier New, Cumberland, Courier, Nimbus Mono L,
267 and Bitstream Vera Sans Mono).
268
269 The Liberation Fonts are sponsored by Red Hat.")
270 (license license:silofl1.1)))
271
272 (define-public font-terminus
273 (package
274 (name "font-terminus")
275 (version "4.39")
276 (source
277 (origin
278 (method url-fetch)
279 (uri (string-append
280 "mirror://sourceforge/project/terminus-font/terminus-font-"
281 version
282 "/terminus-font-"
283 version
284 ".tar.gz"))
285 (sha256
286 (base32
287 "1gzmn7zakvy6yrvmswyjfklnsvqrjm0imhq8rjws8rdkhqwkh21i"))))
288 (build-system gnu-build-system)
289 (native-inputs
290 `(("pkg-config" ,pkg-config)
291 ("perl" ,perl)
292 ("bdftopcf" ,bdftopcf)
293 ("font-util", font-util)
294 ("mkfontdir" ,mkfontdir)))
295 (arguments
296 `(#:configure-flags (list
297 ;; install fonts into subdirectory of package output
298 ;; instead of font-util-?.?.?/share/fonts/X11
299 (string-append "--with-fontrootdir="
300 %output "/share/fonts/X11"))
301 #:tests? #f)) ;; No test target in tarball
302 (home-page "http://terminus-font.sourceforge.net/")
303 (synopsis "Simple bitmap programming font")
304 (description "Terminus Font is a clean, fixed width bitmap font, designed
305 for long (8 and more hours per day) work with computers.")
306 (license license:silofl1.1)))