gnu: ruby-shoulda-matchers: Update to 3.1.1.
[jackhill/guix/guix.git] / gnu / packages / fonts.scm
index f07e052..893db56 100644 (file)
@@ -8,6 +8,7 @@
 ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2016 Nils Gillmann <niasterisk@grrlz.net>
 ;;; Copyright © 2016 Jookia <166291@gmail.com>
+;;; Copyright © 2016 Eric Bavier <bavier@member.fsf.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
   #:use-module (guix build-system trivial)
   #:use-module (gnu packages base)
   #:use-module (gnu packages compression)
-  #:use-module (gnu packages zip)
+  #:use-module (gnu packages fontutils)
   #:use-module (gnu packages perl)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages python)
   #:use-module (gnu packages xorg)
-  #:use-module (gnu packages pkg-config))
+  #:use-module (gnu packages zip))
 
 (define-public font-inconsolata
   (package
@@ -260,54 +263,53 @@ sans-serif designed for on-screen reading.  It is used by GNOME@tie{}3.")
 (define-public font-gnu-freefont-ttf
   (package
     (name "font-gnu-freefont-ttf")
-    (version "20100919")
+    (version "20120503")
     (source (origin
              (method url-fetch)
-             (uri (string-append "mirror://gnu/freefont/freefont-ttf-"
+             (uri (string-append "mirror://gnu/freefont/freefont-src-"
                                  version ".tar.gz"))
              (sha256
               (base32
-               "1q3h5jp1mbdkinkwxy0lfd0a1q7azlbagraydlzaa2ng82836wg4"))))
-    (build-system trivial-build-system)
+               "0yk58blhcd4hm7nyincmqq4jrzjjk82wif2zmk1l3y2m4vif4qhd"))))
+    (build-system gnu-build-system)
     (arguments
-     `(#:modules ((guix build utils))
-       #:builder (begin
-                   (use-modules (guix build utils)
-                                (srfi srfi-26))
-
-                   (let ((tar      (string-append (assoc-ref %build-inputs
-                                                             "tar")
-                                                  "/bin/tar"))
-                         (PATH     (string-append (assoc-ref %build-inputs
-                                                             "gzip")
-                                                  "/bin"))
-                         (font-dir (string-append %output
-                                                  "/share/fonts/truetype"))
-                         (doc-dir  (string-append %output "/share/doc/"
-                                                  ,name "-" ,version)))
-                     (setenv "PATH" PATH)
-                     (system* tar "xvf" (assoc-ref %build-inputs "source"))
-
-                     (mkdir-p font-dir)
-                     (mkdir-p doc-dir)
-                     (chdir (string-append "freefont-" ,version))
-                     (for-each (lambda (file)
-                                 (let ((dir (if (string-suffix? "ttf" file)
-                                                font-dir
-                                                doc-dir)))
+     `(#:phases (modify-phases %standard-phases
+                  (delete 'configure)
+                  (replace 'install
+                   (lambda _
+                     (let ((doc-dir  (string-append %output "/share/doc/"
+                                                    ,name "-" ,version))
+                           (font-dir (string-append %output
+                                                    "/share/fonts/truetype")))
+                       (mkdir-p doc-dir)
+                       (substitute* "Makefile"
+                         (("\\$\\(TMPDIR\\)") doc-dir)
+                         (("sfd/\\*.ttf") ""))
+                       (system* "make" "ttftar")
+                       (mkdir-p font-dir)
+                       (for-each (lambda (file)
                                    (copy-file file
-                                              (string-append dir "/" file))))
-                               (find-files "." ""))))))
-    (native-inputs `(("source" ,source)
-                     ("tar" ,tar)
-                     ("gzip" ,gzip)))
+                                              (string-append font-dir "/"
+                                                             (basename file))))
+                                 (filter
+                                   (lambda (file) (string-suffix? "ttf" file))
+                                   (find-files "." "")))))))
+       #:test-target "tests"))
+    ;; replace python 3 with python 2
+    ;; python 3 support commits aren't yet released in 20120503
+    ;; so freefont needs python 2 support in fontforge
+    (native-inputs `(("fontforge" ,(package (inherit fontforge)
+                                     (inputs `(("python-2" ,python-2)
+                                     ,@(package-inputs fontforge)))))))
     (home-page "http://www.gnu.org/software/freefont/")
     (synopsis "Unicode-encoded outline fonts")
     (description
      "The GNU Freefont project aims to provide a set of free outline
  (PostScript Type0, TrueType, OpenType...) fonts covering the ISO
 10646/Unicode UCS (Universal Character Set).")
-   (license license:gpl3+)))
+    (license license:gpl3+)
+    (properties '((upstream-name . "freefont")
+                  (ftp-directory . "/gnu/freefont")))))
 
 (define-public font-liberation
   (package
@@ -760,3 +762,49 @@ It contains the following fonts and styles:
 @item UnGungseo: cursive, brush-stroke.
 @end enumerate\n")
     (license license:gpl2+)))
+
+(define-public font-fantasque-sans
+  (package
+    (name "font-fantasque-sans")
+    (version "1.7.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://github.com/belluzj/fantasque-sans/"
+                           "archive/v" version ".tar.gz"))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32
+         "07fpy53k2x2nz5q61swkab6cfk9gw2kc4x4brsj6zjgbm16fap85"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("ttfautohint" ,ttfautohint)
+       ("woff-tools" ,woff-tools)
+       ("fontforge" ,fontforge)
+       ("woff2" ,woff2)
+       ("ttf2eot" ,ttf2eot)))
+    (arguments
+     `(#:tests? #f                 ;test target intended for visual inspection
+       #:phases (modify-phases %standard-phases
+                  (delete 'configure)   ;no configuration
+                  (replace 'install
+                    ;; 'make install' wants to install to ~/.fonts, install to
+                    ;; output instead.
+                    (lambda* (#:key outputs #:allow-other-keys)
+                      (let* ((out (assoc-ref outputs "out"))
+                             (font-dir (string-append out "/share/fonts"))
+                             (truetype-dir (string-append font-dir "/truetype"))
+                             (opentype-dir (string-append font-dir "/opentype"))
+                             (webfonts-dir (string-append font-dir "/webfonts")))
+                        (copy-recursively "OTF" opentype-dir)
+                        (for-each (lambda (f) (install-file f truetype-dir))
+                                  (find-files "." "\\.ttf$"))
+                        (copy-recursively "Webfonts" webfonts-dir)
+                        #t))))))
+    (synopsis "Font family with a monospaced variant for programmers")
+    (description
+     "Fantasque Sans Mono is a programming font designed with functionality in
+mind.  The font includes a bold version and a good italic version with new
+glyph designs, not just an added slant.")
+    (home-page "https://fontlibrary.org/en/font/fantasque-sans-mono")
+    (license license:silofl1.1)))