gnu: Add 'make-ld-wrapper' procedure.
[jackhill/guix/guix.git] / gnu / packages / fontutils.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
4 ;;;
5 ;;; This file is part of GNU Guix.
6 ;;;
7 ;;; GNU Guix is free software; you can redistribute it and/or modify it
8 ;;; under the terms of the GNU General Public License as published by
9 ;;; the Free Software Foundation; either version 3 of the License, or (at
10 ;;; your option) any later version.
11 ;;;
12 ;;; GNU Guix is distributed in the hope that it will be useful, but
13 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;;; GNU General Public License for more details.
16 ;;;
17 ;;; You should have received a copy of the GNU General Public License
18 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19
20 (define-module (gnu packages fontutils)
21 #:use-module (gnu packages)
22 #:use-module (gnu packages compression)
23 #:use-module (gnu packages ghostscript)
24 #:use-module (gnu packages perl)
25 #:use-module (gnu packages pkg-config)
26 #:use-module (gnu packages autotools)
27 #:use-module (gnu packages gettext)
28 #:use-module (gnu packages python)
29 #:use-module (gnu packages image)
30 #:use-module (gnu packages glib)
31 #:use-module (gnu packages xorg)
32 #:use-module (gnu packages gtk)
33 #:use-module (gnu packages xml)
34 #:use-module ((guix licenses) #:prefix license:)
35 #:use-module (guix packages)
36 #:use-module (guix download)
37 #:use-module (guix build-system cmake)
38 #:use-module (guix build-system gnu))
39
40 (define-public freetype
41 (package
42 (name "freetype")
43 (version "2.5.5")
44 (source (origin
45 (method url-fetch)
46 (uri (string-append "mirror://savannah/freetype/freetype-"
47 version ".tar.bz2"))
48 (sha256 (base32
49 "1fdgl7js99xv1yy5zx1ravmqd0jxlnqpv7zcl954h4hbg15wqyrq"))))
50 (build-system gnu-build-system)
51 (arguments
52 `(#:phases
53 ;; This should not be necessary; reported upstream as
54 ;; https://savannah.nongnu.org/bugs/index.php?44261
55 (alist-cons-before
56 'configure 'set-paths
57 (lambda _
58 (setenv "CONFIG_SHELL" (which "bash")))
59 %standard-phases)))
60 (synopsis "Font rendering library")
61 (description
62 "Freetype is a library that can be used by applications to access the
63 contents of font files. It provides a uniform interface to access font files.
64 It supports both bitmap and scalable formats, including TrueType, OpenType,
65 Type1, CID, CFF, Windows FON/FNT, X11 PCF, and others. It supports high-speed
66 anti-aliased glyph bitmap generation with 256 gray levels.")
67 (license license:freetype) ; some files have other licenses
68 (home-page "http://www.freetype.org/")))
69
70 (define-public fontconfig
71 (package
72 (name "fontconfig")
73 (version "2.11.92")
74 (source (origin
75 (method url-fetch)
76 (uri (string-append
77 "http://www.freedesktop.org/software/fontconfig/release/fontconfig-"
78 version ".tar.bz2"))
79 (sha256 (base32
80 "18r45dcnaj93izwfr082qiwg8ka7ll6j0c9yf1slblm542d5pmd9"))))
81 (build-system gnu-build-system)
82 (propagated-inputs `(("expat" ,expat)
83 ("freetype" ,freetype)))
84 (inputs `(("gs-fonts" ,gs-fonts)))
85 (native-inputs
86 `(("pkg-config" ,pkg-config)))
87 (arguments
88 `(#:configure-flags
89 ;; point to user profile instead of /usr/share/fonts in /etc/fonts.conf
90 (list "--with-default-fonts=~/.guix-profile/share/fonts"
91 ;; register gs-fonts
92 (string-append "--with-add-fonts="
93 (assoc-ref %build-inputs "gs-fonts")
94 "/share/fonts"))))
95 (synopsis "Library for configuring and customizing font access")
96 (description
97 "Fontconfig can discover new fonts when installed automatically;
98 perform font name substitution, so that appropriate alternative fonts can
99 be selected if fonts are missing;
100 identify the set of fonts required to completely cover a set of languages;
101 have GUI configuration tools built as it uses an XML-based configuration file;
102 efficiently and quickly find needed fonts among the set of installed fonts;
103 be used in concert with the X Render Extension and FreeType to implement
104 high quality, anti-aliased and subpixel rendered text on a display.")
105 ; The exact license is more X11-style than BSD-style.
106 (license (license:non-copyleft "file://COPYING"
107 "See COPYING in the distribution."))
108 (home-page "http://www.freedesktop.org/wiki/Software/fontconfig")))
109
110 (define-public t1lib
111 (package
112 (name "t1lib")
113 (version "5.1.2")
114 (source (origin
115 (method url-fetch)
116 (uri "ftp://sunsite.unc.edu/pub/Linux/libs/graphics/t1lib-5.1.2.tar.gz")
117 (sha256 (base32
118 "0nbvjpnmcznib1nlgg8xckrmsw3haa154byds2h90y2g0nsjh4w2"))))
119 (build-system gnu-build-system)
120 (arguments
121 ;; Making the documentation requires latex, but t1lib is also an input
122 ;; for building texlive.
123 `(#:tests? #f ; no test target
124 #:make-flags
125 '("without_doc")))
126 (synopsis "Library for generating bitmaps from Type 1 fonts")
127 (description
128 "T1lib is a library for generating/rasterising bitmaps from Type 1 fonts.
129 It is based on the code of the X11 rasteriser of the X11 project.
130
131 The bitmaps created by t1lib are returned in a data structure with type
132 GLYPH. This special GLYPH-type is also used in the X11 window system to
133 describe character bitmaps. It contains the bitmap data as well as some
134 metric information. But t1lib is in itself entirely independent of the
135 X11-system or any other graphical user interface.")
136 (license license:gpl2)
137 (home-page "http://www.t1lib.org/")))
138
139 (define-public teckit
140 (package
141 (name "teckit")
142 (version "2.5.1")
143 (source (origin
144 (method url-fetch)
145 (uri (list
146 (string-append
147 "http://scripts.sil.org/svn-view/teckit/TAGS/TECkit_"
148 (string-map (lambda (x) (if (char=? x #\.) #\_ x)) version)
149 ".tar.gz")
150 "http://pkgs.fedoraproject.org/repo/pkgs/teckit/TECkit_2_5_1.tar.gz/4913f71f0f42bfd9cf8f161688b35dea/TECkit_2_5_1.tar.gz"
151 ;; This used to be the canonical URL but it vanished.
152 ;; See <http://bugs.gnu.org/19600>.
153 ;; (string-append
154 ;; "http://scripts.sil.org/svn-view/teckit/TAGS/TECkit_"
155 ;; (string-map (lambda (x) (if (char=? x #\.) #\_ x)) version)
156 ;; ".tar.gz")
157 ))
158 (sha256 (base32
159 "0fjiwvic8mdxpkyccfp7zh26y9xnvkp0skqbyfkrjiacd191k82r"))
160 (patches (list (search-patch "teckit-cstdio.patch")))))
161 (build-system gnu-build-system)
162 (inputs `(("zlib" ,zlib)))
163 (synopsis "Toolkit for encoding conversions")
164 (description
165 "TECkit is a low-level toolkit intended to be used by other applications
166 that need to perform encoding conversions (e.g., when importing legacy data
167 into a Unicode-based application). The primary component of the TECkit
168 package is therefore a library that performs conversions; this is the
169 \"TECkit engine\". The engine relies on mapping tables in a specific binary
170 format (for which documentation is available); there is a compiler that
171 creates such tables from a human-readable mapping description (a simple
172 text file).
173
174 To facilitate the development and testing of mapping tables for TECkit,
175 several applications are also included in the current package; these
176 include simple tools for applying conversions to plain-text and Standard
177 Format files, as well as both command-line and simple GUI versions of the
178 TECkit compiler. However, it is not intended that these tools will be the
179 primary means by which end users perform conversions, and they have not
180 been designed, tested, and debugged to the extent that general-purpose
181 applications should be.")
182 (license license:lgpl2.1+)
183 (home-page "http://scripts.sil.org/cms/scripts/page.php?cat_id=teckit")))
184
185 (define-public graphite2
186 (package
187 (name "graphite2")
188 (version "1.2.4")
189 (source
190 (origin
191 (method url-fetch)
192 (uri (string-append
193 "mirror://sourceforge/silgraphite/graphite2/graphite2-"
194 version ".tgz"))
195 (sha256
196 (base32
197 "00xhv1mp640fr3wmdzwn4yz0g56jd4r9fb7b02mc1g19h0bdbhsb"))))
198 (build-system cmake-build-system)
199 (inputs
200 `(("freetype" ,freetype)
201 ("perl" ,perl)
202 ("python" ,python-2))) ; because of "import imap" in tests
203 (synopsis "Reimplementation of the SIL Graphite text processing engine")
204 (description
205 "Graphite2 is a reimplementation of the SIL Graphite text processing
206 engine. Graphite is a smart font technology designed to facilitate the
207 process known as shaping. This process takes an input Unicode text string
208 and returns a sequence of positioned glyphids from the font.")
209 (license license:lgpl2.1+)
210 (home-page "http://projects.palaso.org/projects/graphitedev")))
211
212 (define-public potrace
213 (package
214 (name "potrace")
215 (version "1.11")
216 (source
217 (origin
218 (method url-fetch)
219 (uri (string-append "mirror://sourceforge/potrace/potrace-"
220 version ".tar.gz"))
221 (sha256
222 (base32
223 "1bbyl7jgigawmwc8r14znv8lb6lrcxh8zpvynrl6s800dr4yp9as"))))
224 (build-system gnu-build-system)
225 (native-inputs `(("ghostscript" ,ghostscript))) ;for tests
226 (inputs `(("zlib" ,zlib)))
227 (arguments
228 `(#:configure-flags
229 `("--with-libpotrace"))) ; install library and headers
230 (synopsis "Transform bitmaps into vector graphics")
231 (description
232 "Potrace is a tool for tracing a bitmap, which means, transforming a
233 bitmap into a smooth, scalable image. The input is a bitmap (PBM, PGM, PPM,
234 or BMP format), and the default output is an encapsulated PostScript
235 file (EPS). A typical use is to create EPS files from scanned data, such as
236 company or university logos, handwritten notes, etc. The resulting image is
237 not \"jaggy\" like a bitmap, but smooth. It can then be rendered at any
238 resolution.")
239 (license license:gpl2+)
240 (home-page "http://potrace.sourceforge.net/")))
241
242 (define-public libspiro
243 (package
244 (name "libspiro")
245 (version "20071029")
246 (source
247 (origin
248 (method url-fetch)
249 (uri (string-append "mirror://sourceforge/libspiro/libspiro/"
250 version "/libspiro_src-" version ".tar.bz2"))
251 (sha256
252 (base32
253 "1kylz8pvwnb85yya150r9i6mhbpzx38f32qy523qg3ylgd9b3zhy"))))
254 (build-system gnu-build-system)
255 (arguments `(#:tests? #f)) ;no tests
256 (synopsis "Clothoid to bezier conversion library")
257 (description
258 "Raph Levien's Spiro package as a library. A mechanism for drawing
259 smooth contours with constant curvature at the spline joins.")
260 (license license:gpl2+)
261 (home-page "http://libspiro.sourceforge.net/")))
262
263 (define-public libuninameslist
264 (package
265 (name "libuninameslist")
266 (version "0.4.20140731")
267 (source
268 (origin
269 (method url-fetch)
270 (uri (string-append "https://github.com/fontforge/libuninameslist/"
271 "archive/" version ".tar.gz"))
272 (file-name (string-append name "-" version ".tar.gz"))
273 (sha256
274 (base32
275 "016zxffpc8iwpxxmnjkdirn6dsbcvdb2wjdrp123sf79f4nsynyj"))))
276 (build-system gnu-build-system)
277 (native-inputs `(("autoconf" ,autoconf)
278 ("automake" ,automake)
279 ("libtool" ,libtool)))
280 (arguments
281 `(#:phases (alist-cons-after
282 'unpack 'bootstrap
283 (lambda _
284 (zero? (system* "autoreconf" "-vi")))
285 %standard-phases)))
286 (synopsis "Unicode names and annotation list")
287 (description
288 "LibUniNamesList holds www.unicode.org Nameslist.txt data which can be
289 useful for programs that need Unicode \"Names\", \"Annotations\", and block
290 definitions.")
291 (license license:gpl2)
292 (home-page "https://github.com/fontforge/libuninameslist")))
293
294 (define-public fontforge
295 (package
296 (name "fontforge")
297 (version "20120731-b") ;aka 1.0
298 (source (origin
299 (method url-fetch)
300 (uri (string-append "mirror://sourceforge/fontforge/fontforge_full-"
301 version ".tar.bz2"))
302 (sha256 (base32
303 "1dhg0i2pf76j40cb9g1wzpag21fgarpjaad0hdbk27i1zz588q8v"))))
304 (build-system gnu-build-system)
305 ;; TODO: Add python for scripting support.
306 (inputs `(("gettext" ,gnu-gettext)
307 ("libtiff" ,libtiff)
308 ("libjpeg" ,libjpeg)
309 ("libpng" ,libpng)
310 ("giflib" ,giflib) ;needs giflib 4.*
311 ("libxml2" ,libxml2)
312 ("libX11" ,libx11)
313 ("libXi" ,libxi)
314 ("libICE" ,libice)
315 ("libSM" ,libsm)
316 ("freetype" ,freetype)
317 ("potrace" ,potrace)
318 ("libspiro" ,libspiro)
319 ("zlib" ,zlib)
320 ("cairo" ,cairo)
321 ("fontconfig" ,fontconfig) ;dlopen'd
322 ("libuninameslist" ,libuninameslist)
323 ("pango" ,pango)
324 ("glib" ,glib))) ;needed for pango detection
325 (arguments
326 '(#:configure-flags `("--enable-double")
327 #:tests? #f
328 #:phases
329 (alist-cons-before
330 'configure 'patch-configure
331 (lambda* (#:key inputs #:allow-other-keys)
332 (let ((libxml2 (assoc-ref inputs "libxml2"))
333 (cairo (assoc-ref inputs "cairo"))
334 (pango (assoc-ref inputs "pango")))
335 (substitute* "configure"
336 ;; configure looks for a directory to be present to determine
337 ;; whether libxml2 is available, rather than checking for the
338 ;; library or headers. Point it to the correct directory.
339 (("/usr/include/libxml2")
340 (string-append libxml2 "/include/libxml2"))
341 ;; Similary, the search directories for cairo and pango are
342 ;; hard-coded.
343 (("gww_prefix in.*") (string-append "gww_prefix in "
344 cairo " " pango "\n")))))
345 (alist-cons-after
346 'install 'set-library-path
347 (lambda* (#:key inputs outputs #:allow-other-keys)
348 (let ((out (assoc-ref outputs "out"))
349 (potrace (string-append (assoc-ref inputs "potrace") "/bin")))
350 (wrap-program (string-append out "/bin/fontforge")
351 ;; Fontforge dynamically opens libraries.
352 `("LD_LIBRARY_PATH" ":" prefix
353 ,(map (lambda (input)
354 (string-append (assoc-ref inputs input)
355 "/lib"))
356 '("libtiff" "libjpeg" "libpng" "giflib"
357 "libxml2" "zlib" "libspiro" "freetype"
358 "pango" "cairo" "fontconfig")))
359 ;; Checks for potrace program at runtime
360 `("PATH" ":" prefix (,potrace)))))
361 %standard-phases))))
362 (synopsis "Outline font editor")
363 (description
364 "FontForge allows you to create and modify postscript, truetype and
365 opentype fonts. You can save fonts in many different outline formats, and
366 generate bitmaps.")
367 (license license:bsd-3)
368 (home-page "http://fontforge.org/")))