gnu: Add enet.
[jackhill/guix/guix.git] / gnu / packages / fontutils.scm
CommitLineData
b387a1c5 1;;; GNU Guix --- Functional package management for GNU
f1597358 2;;; Copyright © 2013, 2014, 2015 Andreas Enge <andreas@enge.fr>
1e69db8f 3;;; Copyright © 2014, 2016 Eric Bavier <bavier@member.fsf.org>
e86409c5 4;;; Copyright © 2016 Mark H Weaver <mhw@netris.org>
5c85c726 5;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
b387a1c5
AE
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
a86177d6 22(define-module (gnu packages fontutils)
b387a1c5 23 #:use-module (gnu packages)
e5c0701f 24 #:use-module (gnu packages compression)
b972db72 25 #:use-module (gnu packages ghostscript)
319e2d17 26 #:use-module (gnu packages perl)
6e4da6ea 27 #:use-module (gnu packages pkg-config)
f945bf06 28 #:use-module (gnu packages autotools)
0c115d8c 29 #:use-module (gnu packages gettext)
319e2d17 30 #:use-module (gnu packages python)
0c115d8c 31 #:use-module (gnu packages image)
1e69db8f
EB
32 #:use-module (gnu packages bison)
33 #:use-module (gnu packages flex)
0c115d8c
EB
34 #:use-module (gnu packages glib)
35 #:use-module (gnu packages xorg)
36 #:use-module (gnu packages gtk)
6e4da6ea 37 #:use-module (gnu packages xml)
b5b73a82 38 #:use-module ((guix licenses) #:prefix license:)
b387a1c5
AE
39 #:use-module (guix packages)
40 #:use-module (guix download)
1436c5c7 41 #:use-module (guix svn-download)
579760d0 42 #:use-module (guix git-download)
319e2d17 43 #:use-module (guix build-system cmake)
b387a1c5
AE
44 #:use-module (guix build-system gnu))
45
46(define-public freetype
47 (package
48 (name "freetype")
6983ba56 49 (version "2.6.3")
b387a1c5
AE
50 (source (origin
51 (method url-fetch)
36ee486f 52 (uri (string-append "mirror://savannah/freetype/freetype-"
9e91418b 53 version ".tar.bz2"))
b387a1c5 54 (sha256 (base32
6983ba56 55 "18k3b026762lmyrxfil5xv8qwnvj7hc12gz9bjqzbb12lmx707ip"))))
b387a1c5 56 (build-system gnu-build-system)
6983ba56
SB
57 (native-inputs
58 `(("pkg-config" ,pkg-config)))
59 (propagated-inputs
60 ;; These are all in the Requires.private field of freetype2.pc.
61 ;; XXX: add harfbuzz.
62 `(("libpng" ,libpng)
63 ("zlib" ,zlib)))
35b9e423 64 (synopsis "Font rendering library")
b387a1c5
AE
65 (description
66 "Freetype is a library that can be used by applications to access the
35b9e423 67contents of font files. It provides a uniform interface to access font files.
b387a1c5 68It supports both bitmap and scalable formats, including TrueType, OpenType,
35b9e423 69Type1, CID, CFF, Windows FON/FNT, X11 PCF, and others. It supports high-speed
b387a1c5 70anti-aliased glyph bitmap generation with 256 gray levels.")
79c398a2 71 (license license:freetype) ; some files have other licenses
b387a1c5 72 (home-page "http://www.freetype.org/")))
6e4da6ea 73
1e69db8f
EB
74(define-public ttfautohint
75 (package
76 (name "ttfautohint")
77 (version "1.5")
78 (source
79 (origin
80 (method url-fetch)
81 (uri (string-append "mirror://savannah/freetype/ttfautohint-"
82 version ".tar.gz"))
83 (sha256
84 (base32
85 "1lgghck46p33z3hg8dnl76jryig4fh6d8rhzms837zp7x4hyfkv4"))
86 (patches (list (search-patch "ttfautohint-source-date-epoch.patch")))))
87 (build-system gnu-build-system)
88 (native-inputs
89 `(("flex" ,flex)
90 ("bison" ,bison)
91 ("pkg-config" ,pkg-config)))
92 (inputs
93 `(("freetype" ,freetype)
94 ("harfbuzz" ,harfbuzz)))
95 (arguments
96 `(#:configure-flags '("--with-qt=no"))) ;no gui
97 (synopsis "Automated font hinting")
98 (description
99 "ttfautohint provides a 99% automated hinting process and a platform for
100finely hand-hinting the last 1%. It is ideal for web fonts and supports many
101scripts.")
102 (license (list license:gpl2+ license:freetype)) ;choose one or the other
103 (home-page "http://www.freetype.org/ttfautohint/")))
104
508a85df
EB
105(define-public woff-tools
106 (package
107 (name "woff-tools")
108 (version "2009.10.04")
109 (source
110 (origin
111 (method url-fetch)
112 ;; Upstream source is unversioned, so use Debian's versioned tarball
113 (uri (string-append "mirror://debian/pool/main/w/woff-tools/"
114 "woff-tools_" version ".orig.tar.gz"))
115 (file-name (string-append name "-" version ".tar.gz"))
116 (sha256
117 (base32
118 "1i97gkqa6jfzlslsngqf556kx60knlgf7yc9pzsq2pizc6f0d4zl"))))
119 (build-system gnu-build-system)
120 (inputs
121 `(("zlib" ,zlib)))
122 (arguments
123 `(#:make-flags '("CC=gcc")
124 #:tests? #f ;no tests
125 #:phases
126 (modify-phases %standard-phases
127 (delete 'configure) ;no configuration
128 (replace 'install
129 (lambda* (#:key outputs #:allow-other-keys)
130 (let* ((out (assoc-ref outputs "out"))
131 (bin (string-append out "/bin")))
132 (install-file "sfnt2woff" bin)
133 (install-file "woff2sfnt" bin)))))))
134 (synopsis "Convert between OpenType and WOFF fonts")
135 (description
136 "This package provides two tools:
137@table @code
138@item sfnt2woff
139Converts OpenType fonts to WOFF fonts
140@item woff2sfnt
141Converts WOFF fonts to OpenType fonts
142@end table")
143 (license (list license:mpl1.1 license:gpl2+ license:lgpl2.1+))
144 (home-page "https://people.mozilla.com/~jkew/woff/")))
145
1555aee7
EB
146(define-public ttf2eot
147 (package
148 (name "ttf2eot")
149 (version "0.0.2-2")
150 (source
151 (origin
152 (method url-fetch)
153 (uri (string-append "https://storage.googleapis.com/"
154 "google-code-archive-downloads/v2/"
155 "code.google.com/ttf2eot/"
156 "ttf2eot-" version ".tar.gz"))
157 (sha256
158 (base32
159 "1f4dzzmhn0208dvbm3ia5ar6ls9apwc6ampy5blmfxkigi6z0g02"))
160 (patches (list (search-patch "ttf2eot-cstddef.patch")))))
161 (build-system gnu-build-system)
162 (arguments
163 `(#:tests? #f ;no tests
164 #:phases
165 (modify-phases %standard-phases
166 (delete 'configure) ;no configuration
167 (replace 'install
168 (lambda* (#:key outputs #:allow-other-keys)
169 (let* ((out (assoc-ref outputs "out"))
170 (bin (string-append out "/bin")))
171 (install-file "ttf2eot" bin)))))))
172 (synopsis "Convert from TrueType to Embeddable Open Type")
173 (description
174 "This package contains a commandline wrapper around OpenTypeUtilities.cpp
175from Chromium, used to make EOT (Embeddable Open Type) files from
176TTF (TrueType/OpenType Font) files.")
177 ;; While the README states "License: Derived from WebKit, so BSD/LGPL
178 ;; 2/LGPL 2.1", the single derived source file includes only BSD in its
179 ;; license header, and the wrapper source contains no license header.
180 (license license:bsd-2)
181 (home-page "https://code.google.com/archive/p/ttf2eot/")))
182
579760d0
EB
183(define-public woff2
184 (let ((commit "4e698b8c6c5e070d53c340db9ddf160e21070ede")
185 (revision "1"))
186 (package
187 (name "woff2")
188 (version (string-append "20160306-" revision "."
189 (string-take commit 7)))
190 (source (origin
191 (method git-fetch)
192 (uri (git-reference
193 (url "https://github.com/google/woff2.git")
194 (commit commit)))
195 (file-name (string-append name "-" version ".tar.xz"))
196 (sha256
197 (base32
198 "0wka0yhf0cjmd4rv2jckxpyv6lb5ckj4nj0k1ajq5hrjy7f30lcp"))
199 (patches (list (search-patch "woff2-libbrotli.patch")))))
200 (build-system gnu-build-system)
201 (native-inputs
202 `(("pkg-config" ,pkg-config)))
203 (inputs
204 `(("brotli" ,brotli)))
205 (arguments
206 `(#:tests? #f ;no tests
207 #:phases (modify-phases %standard-phases
208 (delete 'configure)
209 (replace 'install
210 (lambda* (#:key outputs #:allow-other-keys)
211 (let* ((out (assoc-ref outputs "out"))
212 (bin (string-append out "/bin")))
213 (install-file "woff2_compress" bin)
214 (install-file "woff2_decompress" bin)
215 #t))))))
216 (synopsis "Compress TrueType fonts to WOFF2")
217 (description
218 "This package provides utilities for compressing/decompressing TrueType
219fonts to/from the WOFF2 format.")
220 (license license:asl2.0)
221 (home-page "https://github.com/google/woff2"))))
222
6e4da6ea
AE
223(define-public fontconfig
224 (package
225 (name "fontconfig")
6b5e654d 226 (replacement fontconfig/fixed)
030fa12e 227 (version "2.11.94")
6e4da6ea
AE
228 (source (origin
229 (method url-fetch)
230 (uri (string-append
5cc3096c 231 "https://www.freedesktop.org/software/fontconfig/release/fontconfig-"
6e4da6ea
AE
232 version ".tar.bz2"))
233 (sha256 (base32
030fa12e 234 "1psrl4b4gi4wmbvwwh43lk491wsl8lgvqj146prlcha3vwjc0qyp"))))
6e4da6ea 235 (build-system gnu-build-system)
80650d77
MW
236 (propagated-inputs `(("expat" ,expat)
237 ("freetype" ,freetype)))
238 (inputs `(("gs-fonts" ,gs-fonts)))
c4c4cc05
JD
239 (native-inputs
240 `(("pkg-config" ,pkg-config)))
0ceea4f3 241 (arguments
030fa12e
SB
242 `(#:configure-flags
243 (list "--with-cache-dir=/var/cache/fontconfig"
244 ;; register gs-fonts as default fonts
245 (string-append "--with-default-fonts="
246 (assoc-ref %build-inputs "gs-fonts")
247 "/share/fonts")
e71ef7ad 248
f8835ff4
AK
249 ;; Register fonts from user and system profiles.
250 (string-append "--with-add-fonts="
251 "~/.guix-profile/share/fonts,"
252 "/run/current-system/profile/share/fonts")
e71ef7ad 253
030fa12e
SB
254 ;; python is not actually needed
255 "PYTHON=false")
256 #:phases
257 (modify-phases %standard-phases
258 (replace 'install
259 (lambda _
260 ;; Don't try to create /var/cache/fontconfig.
261 (zero? (system* "make" "install"
262 "fc_cachedir=$(TMPDIR)"
263 "RUN_FC_CACHE_TEST=false")))))))
9e771e3b 264 (synopsis "Library for configuring and customizing font access")
6e4da6ea
AE
265 (description
266 "Fontconfig can discover new fonts when installed automatically;
267perform font name substitution, so that appropriate alternative fonts can
268be selected if fonts are missing;
269identify the set of fonts required to completely cover a set of languages;
270have GUI configuration tools built as it uses an XML-based configuration file;
271efficiently and quickly find needed fonts among the set of installed fonts;
272be used in concert with the X Render Extension and FreeType to implement
273high quality, anti-aliased and subpixel rendered text on a display.")
274 ; The exact license is more X11-style than BSD-style.
166191b3 275 (license (license:non-copyleft "file://COPYING"
6e4da6ea
AE
276 "See COPYING in the distribution."))
277 (home-page "http://www.freedesktop.org/wiki/Software/fontconfig")))
313b9012 278
6b5e654d
LF
279(define fontconfig/fixed
280 (package
281 (inherit fontconfig)
282 (source (origin
283 (inherit (package-source fontconfig))
284 (patches (search-patches "fontconfig-CVE-2016-5384.patch"))))))
285
313b9012
AE
286(define-public t1lib
287 (package
288 (name "t1lib")
289 (version "5.1.2")
290 (source (origin
291 (method url-fetch)
a60c705b
EF
292 (uri (list (string-append "ftp://sunsite.unc.edu/pub/Linux/libs/"
293 "graphics/" name "-" version ".tar.gz")
294 (string-append "https://fossies.org/linux/misc/old/"
295 name "-" version ".tar.gz")))
313b9012 296 (sha256 (base32
4f3e02f1
EF
297 "0nbvjpnmcznib1nlgg8xckrmsw3haa154byds2h90y2g0nsjh4w2"))
298 (patches (search-patches
299 "t1lib-CVE-2010-2642.patch"
300 "t1lib-CVE-2011-0764.patch"
301 "t1lib-CVE-2011-1552+CVE-2011-1553+CVE-2011-1554.patch"))))
313b9012
AE
302 (build-system gnu-build-system)
303 (arguments
304 ;; Making the documentation requires latex, but t1lib is also an input
305 ;; for building texlive.
306 `(#:tests? #f ; no test target
307 #:make-flags
308 '("without_doc")))
9e771e3b 309 (synopsis "Library for generating bitmaps from Type 1 fonts")
313b9012
AE
310 (description
311 "T1lib is a library for generating/rasterising bitmaps from Type 1 fonts.
312It is based on the code of the X11 rasteriser of the X11 project.
313
314The bitmaps created by t1lib are returned in a data structure with type
35b9e423
EB
315GLYPH. This special GLYPH-type is also used in the X11 window system to
316describe character bitmaps. It contains the bitmap data as well as some
317metric information. But t1lib is in itself entirely independent of the
318X11-system or any other graphical user interface.")
313b9012
AE
319 (license license:gpl2)
320 (home-page "http://www.t1lib.org/")))
e5c0701f
AE
321
322(define-public teckit
323 (package
324 (name "teckit")
1436c5c7 325 (version "2.5.4")
e5c0701f 326 (source (origin
1436c5c7
AE
327 ;; Downloaded tarballs vary with each download, so we use an
328 ;; svn snapshot. The 2.5.4 release seems to be made in r128,
329 ;; but r132 updates additional files to contain the correct
330 ;; version number (r129 to r131 do not concern TRUNK).
331 (method svn-fetch)
332 (uri (svn-reference
333 (url "https://scripts.sil.org/svn-public/teckit/TRUNK")
334 (revision 132)))
335 (file-name (string-append name "-" version))
336 (sha256
337 (base32
338 "1xqkqgw30pb24snh46srmjs2j4zhz2dfi5pf7znia0k34mrpwivz"))))
e5c0701f 339 (build-system gnu-build-system)
01eafd38 340 (inputs `(("zlib" ,zlib)))
1436c5c7
AE
341 (native-inputs
342 `(("autoconf" ,autoconf)
343 ("automake" ,automake)
344 ("libtool" ,libtool)
345 ("perl" ,perl))) ; for the tests
346 (arguments
347 `(#:phases
348 (modify-phases %standard-phases
349 (add-after 'unpack 'autogen
350 (lambda _
351 (zero? (system* "sh" "autogen.sh")))))))
35b9e423 352 (synopsis "Toolkit for encoding conversions")
e5c0701f
AE
353 (description
354 "TECkit is a low-level toolkit intended to be used by other applications
355that need to perform encoding conversions (e.g., when importing legacy data
35b9e423 356into a Unicode-based application). The primary component of the TECkit
e5c0701f 357package is therefore a library that performs conversions; this is the
35b9e423 358\"TECkit engine\". The engine relies on mapping tables in a specific binary
e5c0701f
AE
359format (for which documentation is available); there is a compiler that
360creates such tables from a human-readable mapping description (a simple
361text file).
362
363To facilitate the development and testing of mapping tables for TECkit,
364several applications are also included in the current package; these
365include simple tools for applying conversions to plain-text and Standard
366Format files, as well as both command-line and simple GUI versions of the
35b9e423 367TECkit compiler. However, it is not intended that these tools will be the
e5c0701f
AE
368primary means by which end users perform conversions, and they have not
369been designed, tested, and debugged to the extent that general-purpose
370applications should be.")
371 (license license:lgpl2.1+)
372 (home-page "http://scripts.sil.org/cms/scripts/page.php?cat_id=teckit")))
319e2d17
AE
373
374(define-public graphite2
375 (package
376 (name "graphite2")
6983ba56 377 (version "1.3.8")
319e2d17
AE
378 (source
379 (origin
380 (method url-fetch)
6983ba56
SB
381 (uri (string-append "https://github.com/silnrsi/graphite/releases/"
382 "download/" version "/" name "-" version ".tgz"))
319e2d17 383 (sha256
297a36ab 384 (base32
6983ba56 385 "1hlc9j7w7gihy6gvzfa7902pr6yxq1sr1xkp5rwf0p29m2rjagwz"))))
319e2d17 386 (build-system cmake-build-system)
e6f22a82
SB
387 (native-inputs
388 `(("python" ,python-2) ; because of "import imap" in tests
389 ("python-fonttools" ,python2-fonttools)))
319e2d17 390 (inputs
e6f22a82 391 `(("freetype" ,freetype)))
35b9e423 392 (synopsis "Reimplementation of the SIL Graphite text processing engine")
319e2d17
AE
393 (description
394 "Graphite2 is a reimplementation of the SIL Graphite text processing
395engine. Graphite is a smart font technology designed to facilitate the
396process known as shaping. This process takes an input Unicode text string
397and returns a sequence of positioned glyphids from the font.")
398 (license license:lgpl2.1+)
e86409c5 399 (home-page "https://github.com/silnrsi/graphite")))
ee69f85c
EB
400
401(define-public potrace
402 (package
403 (name "potrace")
922fe075 404 (version "1.13")
ee69f85c
EB
405 (source
406 (origin
407 (method url-fetch)
de67e922
LF
408 (uri (string-append "mirror://sourceforge/potrace/" version
409 "/potrace-" version ".tar.gz"))
ee69f85c
EB
410 (sha256
411 (base32
922fe075 412 "115p2vgyq7p2mf4nidk2x3aa341nvv2v8ml056vbji36df5l6lk2"))))
ee69f85c
EB
413 (build-system gnu-build-system)
414 (native-inputs `(("ghostscript" ,ghostscript))) ;for tests
415 (inputs `(("zlib" ,zlib)))
4797d84d
AE
416 (arguments
417 `(#:configure-flags
418 `("--with-libpotrace"))) ; install library and headers
ee69f85c
EB
419 (synopsis "Transform bitmaps into vector graphics")
420 (description
421 "Potrace is a tool for tracing a bitmap, which means, transforming a
422bitmap into a smooth, scalable image. The input is a bitmap (PBM, PGM, PPM,
423or BMP format), and the default output is an encapsulated PostScript
424file (EPS). A typical use is to create EPS files from scanned data, such as
425company or university logos, handwritten notes, etc. The resulting image is
426not \"jaggy\" like a bitmap, but smooth. It can then be rendered at any
427resolution.")
428 (license license:gpl2+)
429 (home-page "http://potrace.sourceforge.net/")))
5277dbb0 430
6ef0ec76
RJ
431(define-public libotf
432 (package
433 (name "libotf")
434 (version "0.9.13")
435 (source (origin
436 (method url-fetch)
437 (uri (string-append
8b15f42c 438 "mirror://savannah/releases/m17n/libotf-"
6ef0ec76
RJ
439 version ".tar.gz"))
440 (sha256
441 (base32 "0239zvfan56w7vrppriwy77fzb10ag9llaz15nsraps2a2x6di3v"))))
442 (build-system gnu-build-system)
443 (propagated-inputs
444 `(("freetype" ,freetype)))
445 (home-page "http://www.nongnu.org/m17n/")
446 (synopsis "Library for handling OpenType Font")
447 (description "This library can read Open Type Layout Tables from an OTF
448file. Currently these tables are supported; head, name, cmap, GDEF, GSUB, and
449GPOS. It can convert a Unicode character sequence to a glyph code sequence by
450using the above tables.")
451 (license license:lgpl2.0+)))
452
5277dbb0
EB
453(define-public libspiro
454 (package
455 (name "libspiro")
456 (version "20071029")
457 (source
458 (origin
459 (method url-fetch)
460 (uri (string-append "mirror://sourceforge/libspiro/libspiro/"
461 version "/libspiro_src-" version ".tar.bz2"))
462 (sha256
463 (base32
464 "1kylz8pvwnb85yya150r9i6mhbpzx38f32qy523qg3ylgd9b3zhy"))))
465 (build-system gnu-build-system)
466 (arguments `(#:tests? #f)) ;no tests
467 (synopsis "Clothoid to bezier conversion library")
468 (description
469 "Raph Levien's Spiro package as a library. A mechanism for drawing
470smooth contours with constant curvature at the spline joins.")
471 (license license:gpl2+)
472 (home-page "http://libspiro.sourceforge.net/")))
f945bf06
EB
473
474(define-public libuninameslist
475 (package
476 (name "libuninameslist")
5c85c726 477 (version "0.5.20150701")
f945bf06
EB
478 (source
479 (origin
480 (method url-fetch)
481 (uri (string-append "https://github.com/fontforge/libuninameslist/"
482 "archive/" version ".tar.gz"))
efe0be6d 483 (file-name (string-append name "-" version ".tar.gz"))
f945bf06
EB
484 (sha256
485 (base32
5c85c726 486 "1j6147l100rppw7axlrkdx0p35fax6bz2zh1xgpg7a3b4pmqaj3v"))))
f945bf06
EB
487 (build-system gnu-build-system)
488 (native-inputs `(("autoconf" ,autoconf)
489 ("automake" ,automake)
3246cc91 490 ("libtool" ,libtool)))
f945bf06 491 (arguments
722ec722
MW
492 `(#:phases (alist-cons-after
493 'unpack 'bootstrap
f945bf06
EB
494 (lambda _
495 (zero? (system* "autoreconf" "-vi")))
496 %standard-phases)))
497 (synopsis "Unicode names and annotation list")
498 (description
499 "LibUniNamesList holds www.unicode.org Nameslist.txt data which can be
500useful for programs that need Unicode \"Names\", \"Annotations\", and block
501definitions.")
502 (license license:gpl2)
503 (home-page "https://github.com/fontforge/libuninameslist")))
0c115d8c
EB
504
505(define-public fontforge
506 (package
507 (name "fontforge")
927e176d 508 (version "20160404")
0c115d8c
EB
509 (source (origin
510 (method url-fetch)
56586557
AE
511 (uri (string-append
512 "https://github.com/fontforge/fontforge/releases/download/"
927e176d 513 version "/fontforge-dist-" version ".tar.gz"))
0c115d8c 514 (sha256 (base32
927e176d 515 "1kavnhbkzc1hk6f39fynq9s0haama81ddrbld4b5x60d0dbaawvc"))
329a7026
LC
516 (modules '((guix build utils)))
517 (snippet
52af45ad
AE
518 '(begin
519 ;; Make builds bit-reproducible by using fixed date strings.
520 (substitute* "configure"
521 (("^FONTFORGE_MODTIME=.*$")
927e176d 522 "FONTFORGE_MODTIME=\"1459819518L\"\n")
52af45ad 523 (("^FONTFORGE_MODTIME_STR=.*$")
927e176d 524 "FONTFORGE_MODTIME_STR=\"20:25 CDT 4-Apr-2016\"\n")
52af45ad 525 (("^FONTFORGE_VERSIONDATE=.*$")
5391be11
EB
526 "FONTFORGE_VERSIONDATE=\"20160404\"\n"))))
527 (patches (list (search-patch "fontforge-svg-modtime.patch")))))
0c115d8c 528 (build-system gnu-build-system)
56586557
AE
529 (native-inputs
530 `(("pkg-config" ,pkg-config)))
531 (inputs `(("cairo" ,cairo)
532 ("fontconfig" ,fontconfig) ;dlopen'd
533 ("freetype" ,freetype)
534 ("gettext" ,gnu-gettext)
56586557 535 ("glib" ,glib) ;needed for pango detection
0c115d8c
EB
536 ("libICE" ,libice)
537 ("libSM" ,libsm)
56586557
AE
538 ("libX11" ,libx11)
539 ("libXi" ,libxi)
540 ("libjpeg" ,libjpeg)
541 ("libltdl" ,libltdl)
542 ("libpng" ,libpng)
0c115d8c 543 ("libspiro" ,libspiro)
56586557 544 ("libtiff" ,libtiff)
de946028 545 ("libungif" ,libungif)
0c115d8c 546 ("libuninameslist" ,libuninameslist)
56586557
AE
547 ("libxft" ,libxft)
548 ("libxml2" ,libxml2)
0c115d8c 549 ("pango" ,pango)
56586557
AE
550 ("potrace" ,potrace)
551 ("python" ,python)
552 ("zlib" ,zlib)))
0c115d8c 553 (arguments
56586557 554 '(#:tests? #f
0c115d8c 555 #:phases
5ab869f9 556 (modify-phases %standard-phases
5f031ed2
EB
557 (add-after 'build 'build-contrib
558 (lambda* (#:key outputs #:allow-other-keys)
559 (let* ((out (assoc-ref outputs "out"))
560 (bin (string-append out "/bin")))
561 (and (zero? (system* "make" "-Ccontrib/fonttools"
562 "CC=gcc" "showttf"))
563 (begin (install-file "contrib/fonttools/showttf" bin)
564 #t)))))
5ab869f9
EB
565 (add-after 'install 'set-library-path
566 (lambda* (#:key inputs outputs #:allow-other-keys)
567 (let ((out (assoc-ref outputs "out"))
568 (potrace (string-append (assoc-ref inputs "potrace") "/bin")))
569 (wrap-program (string-append out "/bin/fontforge")
570 ;; Fontforge dynamically opens libraries.
571 `("LD_LIBRARY_PATH" ":" prefix
572 ,(map (lambda (input)
573 (string-append (assoc-ref inputs input)
574 "/lib"))
de946028 575 '("libtiff" "libjpeg" "libpng" "libungif"
5ab869f9
EB
576 "libxml2" "zlib" "libspiro" "freetype"
577 "pango" "cairo" "fontconfig")))
578 ;; Checks for potrace program at runtime
579 `("PATH" ":" prefix (,potrace)))))))))
0c115d8c
EB
580 (synopsis "Outline font editor")
581 (description
582 "FontForge allows you to create and modify postscript, truetype and
583opentype fonts. You can save fonts in many different outline formats, and
584generate bitmaps.")
56586557 585 (license license:gpl3+)
0c115d8c 586 (home-page "http://fontforge.org/")))