unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#40783: GNU FreeFont silent build failure
@ 2020-04-22 21:51 Leo Famulari
  0 siblings, 0 replies; only message in thread
From: Leo Famulari @ 2020-04-22 21:51 UTC (permalink / raw)
  To: 40783

[-- Attachment #1: Type: text/plain, Size: 1228 bytes --]

The GNU FreeFont package is still using system* instead of invoke in its
install phase, and this is failing silently:

------
mkdir /gnu/store/1nfp73g3s15dhpqjrbfsihk7jrcbbl1p-font-gnu-freefont-20120503/share/doc/font-gnu-freefont-20120503
cp -a README AUTHORS CREDITS COPYING ChangeLog INSTALL  /gnu/store/1nfp73g3s15dhpqjrbfsihk7jrcbbl1p-font-gnu-freefont-20120503/share/doc/font-gnu-freefont-20120503
cp -a notes/usage.txt /gnu/store/1nfp73g3s15dhpqjrbfsihk7jrcbbl1p-font-gnu-freefont-20120503/share/doc/font-gnu-freefont-20120503/USAGE
cp -a notes/troubleshooting.txt /gnu/store/1nfp73g3s15dhpqjrbfsihk7jrcbbl1p-font-gnu-freefont-20120503/share/doc/font-gnu-freefont-20120503/TROUBLESHOOTING
tar czvf freefont-ttf-20200422.tar.gz freefont-20200422/
tar: freefont-20200422: Cannot stat: No such file or directory
tar: Exiting with failure status due to previous errors
make: *** [Makefile:64: ttftar] Error 2
phase `install' succeeded after 0.2 seconds
------

Notice that it is using the current date. It doesn't work to use the
Unix epoch or the version of the package: 20120503 (see attached).

We should figure out what this is trying to accomplish, fix it, and
switch to invoke.

The fonts are getting installed AFAICT.

[-- Attachment #2: 0001-gnu-GNU-FreeFont-Add-otf-and-woff-font-formats.patch --]
[-- Type: text/plain, Size: 5562 bytes --]

From a3c8951e2a8a1dc76aa184272fcb107c90246518 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <raghavgururajan@disroot.org>
Date: Sun, 19 Apr 2020 00:51:54 -0400
Subject: [PATCH] gnu: GNU FreeFont: Add otf and woff font formats.

* gnu/packages/fonts.scm (font-gnu-freefont)[arguments]: Add otf and woff font
formats.
* gnu/packages/genealogy.scm (gramps)[inputs]: Change input name of GNU
Freefont.

Signed-off-by: Leo Famulari <leo@famulari.name>
---
 gnu/packages/fonts.scm     | 68 ++++++++++++++++++++++++++------------
 gnu/packages/genealogy.scm |  2 +-
 2 files changed, 48 insertions(+), 22 deletions(-)

diff --git a/gnu/packages/fonts.scm b/gnu/packages/fonts.scm
index 9ab5587b98..f1cabf9202 100644
--- a/gnu/packages/fonts.scm
+++ b/gnu/packages/fonts.scm
@@ -32,6 +32,7 @@
 ;;; Copyright © 2020 Amin Bandali <bandali@gnu.org>
 ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
 ;;; Copyright © 2020 John Soo <jsoo1@asu.edu>
+;;; Copyright © 2020 Raghav Gururajan <raghavgururajan@disroot.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -232,9 +233,9 @@ The Lato 2.010 family supports more than 100 Latin-based languages, over
 50 Cyrillic-based languages as well as Greek and IPA phonetics.")
     (license license:silofl1.1)))
 
-(define-public font-gnu-freefont-ttf
+(define-public font-gnu-freefont
   (package
-    (name "font-gnu-freefont-ttf")
+    (name "font-gnu-freefont")
     (version "20120503")
     (source (origin
              (method url-fetch)
@@ -245,25 +246,50 @@ The Lato 2.010 family supports more than 100 Latin-based languages, over
                "0yk58blhcd4hm7nyincmqq4jrzjjk82wif2zmk1l3y2m4vif4qhd"))))
     (build-system gnu-build-system)
     (arguments
-     `(#: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)
-                                   (install-file file font-dir))
-                                 (filter
-                                   (lambda (file) (string-suffix? "ttf" file))
-                                   (find-files "." "")))))))
+     `(#:modules ((srfi srfi-19) ; make-time, et cetera
+                  (guix build utils)
+                  (guix build gnu-build-system))
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure)
+         (replace 'install
+          (lambda _
+            (let ((doc-dir  (string-append %output "/share/doc/"
+                                           ,name "-" ,version))
+                  (ttf-font-dir (string-append %output
+                                               "/share/fonts/ttf"))
+                  (otf-font-dir (string-append %output
+                                               "/share/fonts/otf"))
+                  (woff-font-dir (string-append %output
+                                                "/share/fonts/woff")))
+              (mkdir-p doc-dir)
+              (substitute* "Makefile"
+                (("\\$\\(TMPDIR\\)") doc-dir)
+                (("sfd/\\*.ttf") "")
+                (("sfd/\\*.otf") "")
+                (("sfd/\\*.woff") ""))
+              ;; XXX The FreeFont Makefile tries to use the current time and
+              ;; date as names for generated files, and fails silently. But the
+              ;; fonts are still installed, so don't use INVOKE for now.
+              (system* "make" "ttftar" "otftar" "wofftar")
+              (mkdir-p ttf-font-dir)
+              (mkdir-p otf-font-dir)
+              (mkdir-p woff-font-dir)
+              (for-each (lambda (file)
+                          (install-file file ttf-font-dir))
+                        (filter
+                          (lambda (file) (string-suffix? "ttf" file))
+                          (find-files "." "")))
+              (for-each (lambda (file)
+                          (install-file file otf-font-dir))
+                        (filter
+                          (lambda (file) (string-suffix? "otf" file))
+                          (find-files "." "")))
+              (for-each (lambda (file)
+                          (install-file file woff-font-dir))
+                        (filter
+                          (lambda (file) (string-suffix? "woff" file))
+                          (find-files "." "")))))))
        #:test-target "tests"))
     ;; replace python 3 with python 2
     ;; python 3 support commits aren't yet released in 20120503
diff --git a/gnu/packages/genealogy.scm b/gnu/packages/genealogy.scm
index 869f69add8..79b24ed048 100644
--- a/gnu/packages/genealogy.scm
+++ b/gnu/packages/genealogy.scm
@@ -55,7 +55,7 @@
        ("intltool" ,intltool)))
     (inputs
      `(("cairo" ,cairo)
-       ("font-gnu-freefont-ttf" ,font-gnu-freefont-ttf)
+       ("font-gnu-freefont" ,font-gnu-freefont)
        ("geocode-glib" ,geocode-glib)
        ("gexiv2" ,gexiv2)
        ("ghostscript" ,ghostscript)
-- 
2.26.2


[-- Attachment #3: source-date-epoch-snippet --]
[-- Type: text/plain, Size: 708 bytes --]

     `(#:modules ((srfi srfi-19) ; make-time, et cetera
                  (guix build utils)
                  (guix build gnu-build-system))
       #:phases
       (modify-phases %standard-phases
         ;; The FreeFont build scripts try to use the current time and date as
         ;; names for generated files.
         (add-after 'unpack 'source-date-epoch
           (lambda _
             (substitute* "Makefile"
               (("\\$\\(shell date \\+\\\"%Y%m%d\\\"\\)")
                (date->string
                  (time-utc->date
                    (make-time time-utc 0
                               (string->number (getenv "SOURCE_DATE_EPOCH"))))
                  "~4")))
             #t))


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-04-22 21:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-22 21:51 bug#40783: GNU FreeFont silent build failure Leo Famulari

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).