unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Version of package fontforge
@ 2019-06-03 10:41 Tilman List
  2019-06-05 10:07 ` Ricardo Wurmus
  2019-06-07  4:53 ` ison
  0 siblings, 2 replies; 6+ messages in thread
From: Tilman List @ 2019-06-03 10:41 UTC (permalink / raw)
  To: help-guix

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

Hello,

when I tried to compile lilypond, I had some problems with the package
fontforge. In Guix it is listed as version 20190317, but when I do "fontforge
--version", i get:

Copyright (c) 2000-2018 by George Williams. See AUTHORS for Contributors.
 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
 with many parts BSD <http://fontforge.org/license.html>;;. Please read LICENSE.
 Based on sources from 00:00 UTC  1-Jan-1970-ML-D.
 Based on source from git with hash: 
fontforge 00:00 UTC  1-Jan-1970
libfontforge 19700101

So lilypond's configure script complains about the version of fontforge. I
think that the right version is installed, but there went something wrong with
the date indicating the version. It seems that no matter which release I
compile the compiled program always shows the date of compilation as the
version. I do not have this problem, when I compile the fontforge package -- I
actually compiled the the release 20190317 and the compiled program shows the
version 20190603... But when installing it via "guix install fontforge" it has
the version 19700101. Do you have any ideas, how I can fix that?

Thank you!

Tilman

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Version of package fontforge
  2019-06-03 10:41 Version of package fontforge Tilman List
@ 2019-06-05 10:07 ` Ricardo Wurmus
  2019-06-06  5:51   ` ison
  2019-06-07  4:53 ` ison
  1 sibling, 1 reply; 6+ messages in thread
From: Ricardo Wurmus @ 2019-06-05 10:07 UTC (permalink / raw)
  To: Tilman List; +Cc: help-guix


Hi Tilman,

> when I tried to compile lilypond, I had some problems with the package
> fontforge. In Guix it is listed as version 20190317, but when I do "fontforge
> --version", i get:
>
> Copyright (c) 2000-2018 by George Williams. See AUTHORS for Contributors.
>  License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
>  with many parts BSD <http://fontforge.org/license.html>;;. Please read LICENSE.
>  Based on sources from 00:00 UTC  1-Jan-1970-ML-D.
>  Based on source from git with hash:
> fontforge 00:00 UTC  1-Jan-1970
> libfontforge 19700101

We may need to patch fontforge.  The version is derived from the current
date at build time:

    fontforge-20190317/configure.ac:FONTFORGE_VERSIONDATE="$(date -u $FONTFORGE_DATE_OPTS +'%Y%m%d')"
    fontforge-20190317/configure:#define FONTFORGE_VERSIONDATE_RAW $FONTFORGE_VERSIONDATE

And that’s what’s used in fontforge-20190317/fontforge/start.c.

We don’t run “date” during the configuration; during builds
SOURCE_DATE_EPOCH is set:

    fontforge-20190317/configure.ac:FONTFORGE_DATE_NOW=${SOURCE_DATE_EPOCH:-$(date +'%s')}

We may need to patch fontforge so that these values are properly defined.

--
Ricardo

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Version of package fontforge
  2019-06-05 10:07 ` Ricardo Wurmus
@ 2019-06-06  5:51   ` ison
  0 siblings, 0 replies; 6+ messages in thread
From: ison @ 2019-06-06  5:51 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: help-guix

Assuming it would be ok to just set the date to the package version date, which
sounds reproducible to me, then using the date produced by:
date -u -d "20190317" +'%s'
gives: 1552780800

I did a quick test to set the configure-flags with this value:

  (arguments
    (append (package-arguments fontforge)
            '(#:configure-flags (list "SOURCE_DATE_EPOCH=1552780800"))))

And with that, if I run fontforge --version I get:

  Copyright (c) 2000-2018 by George Williams. See AUTHORS for Contributors.
   License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
   with many parts BSD <http://fontforge.org/license.html>. Please read LICENSE.
   Based on sources from 00:00 UTC 17-Mar-2019-ML-D.
   Based on source from git with hash: 
  fontforge 00:00 UTC 17-Mar-2019
  libfontforge 20190317

Which looks like the desired output.
However, the best solution would probably be to programmatically obtain
1552780800. I'm not sure what the best way would be to do that. I'm looking at
some of the available date commands inside SRFI-19 and I don't see anything for
converting a string like "20190317" to seconds.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Version of package fontforge
  2019-06-03 10:41 Version of package fontforge Tilman List
  2019-06-05 10:07 ` Ricardo Wurmus
@ 2019-06-07  4:53 ` ison
  2019-06-11 10:20   ` Ludovic Courtès
  2019-06-28 21:06   ` Tilman List
  1 sibling, 2 replies; 6+ messages in thread
From: ison @ 2019-06-07  4:53 UTC (permalink / raw)
  To: Tilman List; +Cc: help-guix

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

Here's a patch to set the version date based on the packages version string.
I also added a comment above the version to note that the version date depends
on its format, in case it ever changes in the future.

Does someone want to look it over and make sure it looks ok, and follows the
right conventions?

[-- Attachment #2: 0001-Fix-fontforge-source-date-epoch.patch --]
[-- Type: text/plain, Size: 1497 bytes --]

From e2fe29485a1f65d65fd7db5b6111d4cfe8ca1485 Mon Sep 17 00:00:00 2001
From: ison <ison@airmail.cc>
Date: Thu, 6 Jun 2019 22:46:12 -0600
Subject: [PATCH] Fix fontforge source date epoch

---
 gnu/packages/fontutils.scm | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/fontutils.scm b/gnu/packages/fontutils.scm
index 1982d0bf4b..44107277cb 100644
--- a/gnu/packages/fontutils.scm
+++ b/gnu/packages/fontutils.scm
@@ -555,6 +555,8 @@ definitions.")
 (define-public fontforge
   (package
    (name "fontforge")
+   ;; SOURCE_DATE_EPOCH generated from version string
+   ;; expects format YYYYMMDD
    (version "20190317")
    (source (origin
             (method url-fetch)
@@ -592,7 +594,18 @@ definitions.")
              ("python"          ,python-2)
              ("zlib"            ,zlib)))
    (arguments
-    '(#:phases
+    `(#:modules ((guix build utils)
+                 (guix build gnu-build-system)
+                 (srfi srfi-19))
+      #:configure-flags
+      (list (format #f "SOURCE_DATE_EPOCH=~a"
+                    (time-second
+                      (date->time-utc
+                        (string->date
+                          (string-append ,version
+                                         "-0000")
+                          "~Y~m~d~z")))))
+      #:phases
       (modify-phases %standard-phases
         (add-after 'install 'set-library-path
           (lambda* (#:key inputs outputs #:allow-other-keys)
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: Version of package fontforge
  2019-06-07  4:53 ` ison
@ 2019-06-11 10:20   ` Ludovic Courtès
  2019-06-28 21:06   ` Tilman List
  1 sibling, 0 replies; 6+ messages in thread
From: Ludovic Courtès @ 2019-06-11 10:20 UTC (permalink / raw)
  To: ison; +Cc: help-guix

Hello ison,

ison <ison@airmail.cc> skribis:

> From e2fe29485a1f65d65fd7db5b6111d4cfe8ca1485 Mon Sep 17 00:00:00 2001
> From: ison <ison@airmail.cc>
> Date: Thu, 6 Jun 2019 22:46:12 -0600
> Subject: [PATCH] Fix fontforge source date epoch
>
> ---
>  gnu/packages/fontutils.scm | 15 ++++++++++++++-
>  1 file changed, 14 insertions(+), 1 deletion(-)

The patch LGTM.  Given that it entails a lot of rebuilds, it’ll have to
go to the ‘core-updates’ branch.  The branch is currently in flux, but
I’ll test it there and push it soonish if everything goes well.

Thanks!

Ludo’.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Version of package fontforge
  2019-06-07  4:53 ` ison
  2019-06-11 10:20   ` Ludovic Courtès
@ 2019-06-28 21:06   ` Tilman List
  1 sibling, 0 replies; 6+ messages in thread
From: Tilman List @ 2019-06-28 21:06 UTC (permalink / raw)
  To: ison; +Cc: help-guix

Thank you!

On Thu, 2019-06-06 at 22:53 -0600, ison wrote:
> Here's a patch to set the version date based on the packages version string.
> I also added a comment above the version to note that the version date depends
> on its format, in case it ever changes in the future.
> 
> Does someone want to look it over and make sure it looks ok, and follows the
> right conventions?

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-06-28 21:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-03 10:41 Version of package fontforge Tilman List
2019-06-05 10:07 ` Ricardo Wurmus
2019-06-06  5:51   ` ison
2019-06-07  4:53 ` ison
2019-06-11 10:20   ` Ludovic Courtès
2019-06-28 21:06   ` Tilman List

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).