gnu: masscan: Cross compile.
[jackhill/guix/guix.git] / gnu / packages / fontutils.scm
index ab9bd43..89d5013 100644 (file)
@@ -2,11 +2,11 @@
 ;;; Copyright © 2013, 2014, 2015 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2014, 2016 Eric Bavier <bavier@member.fsf.org>
 ;;; Copyright © 2016 Mark H Weaver <mhw@netris.org>
-;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2016, 2017, 2020 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2017 Rene Saavedra <rennes@openmailbox.org>
 ;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
 ;;; Copyright © 2017 Nikita <nikita@n0.is>
-;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2017, 2018, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2018, 2019 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2019, 2020 Marius Bakke <mbakke@fastmail.com>
@@ -69,6 +69,7 @@
   (package
    (name "freetype")
    (version "2.10.1")
+   (replacement freetype/fixed)
    (source (origin
             (method url-fetch)
             (uri (string-append "mirror://savannah/freetype/freetype-"
@@ -97,10 +98,23 @@ anti-aliased glyph bitmap generation with 256 gray levels.")
    (license license:freetype)           ; some files have other licenses
    (home-page "https://www.freetype.org/")))
 
+(define freetype/fixed
+  ;; Security fix for CVE-2020-15999.
+  (package
+    (inherit freetype)
+    (version "2.10.4")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "mirror://savannah/freetype/freetype-"
+                           version ".tar.xz"))
+       (sha256
+        (base32 "112pyy215chg7f7fmp2l9374chhhpihbh8wgpj5nj6avj3c59a46"))))))
+
 (define-public ttfautohint
   (package
     (name "ttfautohint")
-    (version "1.5")
+    (version "1.8.3")
     (source
      (origin
        (method url-fetch)
@@ -108,8 +122,7 @@ anti-aliased glyph bitmap generation with 256 gray levels.")
                            version ".tar.gz"))
        (sha256
         (base32
-         "1lgghck46p33z3hg8dnl76jryig4fh6d8rhzms837zp7x4hyfkv4"))
-       (patches (list (search-patch "ttfautohint-source-date-epoch.patch")))))
+         "0zpqgihn3yh3v51ynxwr8asqrijvs4gv686clwv7bm8sawr4kfw7"))))
     (build-system gnu-build-system)
     (native-inputs
      `(("flex" ,flex)
@@ -119,7 +132,8 @@ anti-aliased glyph bitmap generation with 256 gray levels.")
      `(("freetype" ,freetype)
        ("harfbuzz" ,harfbuzz)))
     (arguments
-     `(#:configure-flags '("--with-qt=no"))) ;no gui
+     `(#:configure-flags '("--disable-static"
+                           "--with-qt=no"))) ;no gui
     (synopsis "Automated font hinting")
     (description
      "ttfautohint provides a 99% automated hinting process and a platform for
@@ -146,7 +160,7 @@ scripts.")
     (inputs
      `(("zlib" ,zlib)))
     (arguments
-     `(#:make-flags '("CC=gcc")
+     `(#:make-flags '(,(string-append "CC=" (cc-for-target)))
        #:tests? #f                      ;no tests
        #:phases
        (modify-phases %standard-phases
@@ -156,7 +170,8 @@ scripts.")
              (let* ((out (assoc-ref outputs "out"))
                     (bin (string-append out "/bin")))
                (install-file "sfnt2woff" bin)
-               (install-file "woff2sfnt" bin)))))))
+               (install-file "woff2sfnt" bin))
+             #t)))))
     (synopsis "Convert between OpenType and WOFF fonts")
     (description
      "This package provides two tools:
@@ -177,7 +192,7 @@ Converts WOFF fonts to OpenType fonts
      (origin
        (method git-fetch)
        (uri (git-reference
-             (url "https://github.com/wget/ttf2eot.git")
+             (url "https://github.com/wget/ttf2eot")
              (commit (string-append "v" version))))
        (file-name (git-file-name name version))
        (sha256
@@ -263,32 +278,50 @@ work with most software requiring Type 1 fonts.")
   (package
     (name "woff2")
     (version "1.0.2")
-    (source (origin
-              (method git-fetch)
-              (uri (git-reference
-                    (url "https://github.com/google/woff2.git")
-                    (commit (string-append "v" version))))
-              (file-name (string-append name "-" version ".git"))
-              (sha256
-               (base32
-                "13l4g536h0pr84ww4wxs2za439s0xp1va55g6l478rfbb1spp44y"))))
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/google/woff2.git")
+         (commit (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "13l4g536h0pr84ww4wxs2za439s0xp1va55g6l478rfbb1spp44y"))))
     (build-system cmake-build-system)
+    (outputs '("out" "bin"))
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:configure-flags
+       (list
+        (string-append "-DCMAKE_INSTALL_BINDIR="
+                       (assoc-ref %outputs "bin")
+                       "/bin")
+        (string-append "-DCMAKE_INSTALL_INCLUDEDIR="
+                       (assoc-ref %outputs "out")
+                       "/include")
+        (string-append "-DCMAKE_INSTALL_LIBDIR="
+                       (assoc-ref %outputs "out")
+                       "/lib"))
+       #:phases
+       (modify-phases %standard-phases
+         ;; To install both binaries and libraries.
+         (add-after 'unpack 'patch-installation
+           (lambda _
+             (substitute* "CMakeLists.txt"
+               (("NOT BUILD_SHARED_LIBS")
+                "BUILD_SHARED_LIBS"))
+             #t)))))
     (native-inputs
      `(("pkg-config" ,pkg-config)))
     (inputs
-     `(("google-brotli" ,google-brotli)))
-    (arguments
-     ;; package has no tests
-     `(#:tests? #f
-       ;; we can’t have both, shared libraries and binaries, so turn off the
-       ;; former
-       #:configure-flags (list "-DBUILD_SHARED_LIBS=OFF")))
-    (synopsis "Compress TrueType fonts to WOFF2")
-    (description
-     "This package provides utilities for compressing/decompressing TrueType
-fonts to/from the WOFF2 format.")
-    (license license:asl2.0)
-    (home-page "https://github.com/google/woff2")))
+     `(("brotli" ,google-brotli)))
+    (synopsis "Libraries and tools for WOFF2 font format")
+    (description "WOFF2 provides libraries and tools to handle the Web Open
+Font Format (WOFF).")
+    (home-page "https://w3c.github.io/woff/woff2/")
+    (license license:expat)))
 
 (define-public fontconfig
   (package
@@ -538,6 +571,7 @@ using the above tables.")
   (package
     (name "libspiro")
     (version "20190731")
+    (replacement libspiro-20200505)
     (source
      (origin
       (method url-fetch)
@@ -556,6 +590,19 @@ smooth contours with constant curvature at the spline joins.")
     (license license:gpl2+)
     (home-page "http://libspiro.sourceforge.net/")))
 
+(define libspiro-20200505
+  (package
+    (inherit libspiro)
+    (version "20200505")
+    (source
+     (origin
+      (method url-fetch)
+      (uri (string-append "https://github.com/fontforge/libspiro/releases"
+                          "/download/" version "/libspiro-dist-" version ".tar.gz"))
+      (sha256
+       (base32
+        "0j8fmyj4wz6mqk17dqs6f8jx0i52n68gv5px17qbrjnbilg9mih6"))))))
+
 (define-public libuninameslist
   (package
     (name "libuninameslist")
@@ -746,14 +793,14 @@ implements UFO3 as described by the UFO font format.")
     (version "20170925")
     (source
      (origin
-       (method url-fetch)
-       (uri (string-append "https://github.com/googlei18n/nototools/"
-                           "archive/v2017-09-25-tooling-for-phase3-"
-                           "update.tar.gz"))
-       (file-name (string-append name "-" version ".tar.gz"))
+       (method git-fetch)
+       (uri (git-reference
+              (url "https://github.com/googlei18n/nototools")
+              (commit "v2017-09-25-tooling-for-phase3-update")))
+       (file-name (git-file-name name version))
        (sha256
         (base32
-         "1pvacw18cm9l4sb66pqyjc7hc74xhhfxc7kd5ald8lixf4wzg0s8"))))
+         "03nzvcvwmrhfrcjhg218q2f3hfrm3vlivp4rk19sc397kh3hisiz"))))
     (build-system python-build-system)
     (arguments
      `(#:python ,python-2))
@@ -831,14 +878,14 @@ work well with other GTK+ desktop environments.")
     (name "fntsample")
     (version "5.3")
     (source (origin
-              (method url-fetch)
-              (uri (string-append
-                    "https://github.com/eugmes/fntsample/archive/release/"
-                    version ".tar.gz"))
-              (file-name (string-append name "-" version ".tar.gz"))
+              (method git-fetch)
+              (uri (git-reference
+                     (url "https://github.com/eugmes/fntsample")
+                     (commit (string-append "release/" version))))
+              (file-name (git-file-name name version))
               (sha256
                (base32
-                "0awp4dh1g40ivzvm5xqlvcpcdw1vplrx3drjmbylr62y185vbs74"))))
+                "02rx3gp7k472304vhjwb129nw10a29s4nvgs7i2m6bpjhlk2xgs5"))))
     (build-system cmake-build-system)
     (arguments
      `(#:tests? #f ; There are no tests.
@@ -920,3 +967,33 @@ It currently provides bidirectional text support (using FriBiDi),
 shaping (using HarfBuzz), and proper script itemization.  As a result, Raqm
 can support most writing systems covered by Unicode.")
     (license license:expat)))
+
+(define-public lcdf-typetools
+  (package
+    (name "lcdf-typetools")
+    (version "2.108")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                     (url "https://github.com/kohler/lcdf-typetools")
+                     (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0a6jqaqwq43ldjjjlnsh6mczs2la9363qav7v9fyrfzkfj8kw9ad"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:configure-flags
+       ;; This is only provided by the monolithic texlive distribution.
+       ;; FIXME: texlive-kpathsea doesn't come with the library and headers
+       (list "--without-kpathsea")))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)))
+    (home-page "https://lcdf.org/type/")
+    (synopsis "Multiple font manipulation tools")
+    (description "LCDF Typetools comprises several programs for manipulating
+PostScript Type 1, Type 1 Multiple Master, OpenType, and TrueType fonts.
+These tools are cfftot1, mmafm, mmpfb, otfinfo, otftotfm, t1dotlessj, t1lint,
+t1rawfm, t1reencode, t1testpage and ttftotype42.")
+    (license license:gpl2+)))