all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] gnu: fontforge: Build fonts bit-reproducibly.
@ 2016-03-23 13:21 alírio eyng
  2016-03-23 22:21 ` Ludovic Courtès
  0 siblings, 1 reply; 4+ messages in thread
From: alírio eyng @ 2016-03-23 13:21 UTC (permalink / raw)
  To: guix-devel

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



[-- Attachment #2: 0001-gnu-fontforge-Build-fonts-bit-reproducibly.patch --]
[-- Type: text/x-patch, Size: 1805 bytes --]

From 701b9711b870ad4abdbea17616c98a456b93f86d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?al=C3=ADrio=20eyng?= <alirioeyng@gmail.com>
Date: Wed, 23 Mar 2016 13:13:35 +0000
Subject: [PATCH] gnu: fontforge: Build fonts bit-reproducibly.

* gnu/packages/fontutils.scm (fontforge)[source](snippet): Remove time dump on ttf.
---
 gnu/packages/fontutils.scm | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/gnu/packages/fontutils.scm b/gnu/packages/fontutils.scm
index 34f391e..0f57675 100644
--- a/gnu/packages/fontutils.scm
+++ b/gnu/packages/fontutils.scm
@@ -352,13 +352,17 @@ definitions.")
             (modules '((guix build utils)))
             (snippet
              ;; Make builds bit-reproducible by using fixed date strings.
-             '(substitute* "configure"
-                (("^FONTFORGE_MODTIME=.*$")
-                 "FONTFORGE_MODTIME=\"1458399002\"\n")
-                (("^FONTFORGE_MODTIME_STR=.*$")
-                 "FONTFORGE_MODTIME_STR=\"15:50 CET 19-Mar-2016\"\n")
-                (("^FONTFORGE_VERSIONDATE=.*$")
-                 "FONTFORGE_VERSIONDATE=\"20160319\"\n")))))
+             '(begin
+               (substitute* "configure"
+                 (("^FONTFORGE_MODTIME=.*$")
+                  "FONTFORGE_MODTIME=\"1458399002\"\n")
+                 (("^FONTFORGE_MODTIME_STR=.*$")
+                  "FONTFORGE_MODTIME_STR=\"15:50 CET 19-Mar-2016\"\n")
+                 (("^FONTFORGE_VERSIONDATE=.*$")
+                  "FONTFORGE_VERSIONDATE=\"20160319\"\n"))
+               (substitute* "fontforge/tottf.c"
+                 (("at.>head\\.createtime\\[0\\]") "0")
+                 (("at.>head\\.modtime\\[0\\]") "0"))))))
    (build-system gnu-build-system)
    (native-inputs
     `(("pkg-config" ,pkg-config)))
-- 
1.9.1


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

* Re: [PATCH] gnu: fontforge: Build fonts bit-reproducibly.
  2016-03-23 13:21 [PATCH] gnu: fontforge: Build fonts bit-reproducibly alírio eyng
@ 2016-03-23 22:21 ` Ludovic Courtès
  2016-03-24  6:43   ` alírio eyng
  0 siblings, 1 reply; 4+ messages in thread
From: Ludovic Courtès @ 2016-03-23 22:21 UTC (permalink / raw)
  To: alírio eyng; +Cc: guix-devel

alírio eyng <alirioeyng@gmail.com> skribis:

> +               (substitute* "fontforge/tottf.c"
> +                 (("at.>head\\.createtime\\[0\\]") "0")
> +                 (("at.>head\\.modtime\\[0\\]") "0"))))))

Interesting, great that you found it!

This is for timestamps recorded in TTF files, right?

Perhaps it would be best to honor the ‘SOURCE_DATE_EPOCH’ environment
variable¹ instead of always using zero?

Our build environment systematically sets ‘SOURCE_DATE_EPOCH’ so we’d be
fine, but Fontforge users who expect a meaningful timestamp in there
would still have it.  And the patch could even be submitted upstream
eventually.

WDYT?

See also
<https://wiki.debian.org/ReproducibleBuilds/TimestampsInFontsGeneratedWithFontForge>,
which mentions other font formats.

Thanks,
Ludo’.

¹ https://reproducible-builds.org/specs/source-date-epoch/

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

* Re: [PATCH] gnu: fontforge: Build fonts bit-reproducibly.
  2016-03-23 22:21 ` Ludovic Courtès
@ 2016-03-24  6:43   ` alírio eyng
  2016-03-31 22:05     ` Ludovic Courtès
  0 siblings, 1 reply; 4+ messages in thread
From: alírio eyng @ 2016-03-24  6:43 UTC (permalink / raw)
  To: ludo; +Cc: guix-devel

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

>> +               (substitute* "fontforge/tottf.c"
>> +                 (("at.>head\\.createtime\\[0\\]") "0")
>> +                 (("at.>head\\.modtime\\[0\\]") "0"))))))

> This is for timestamps recorded in TTF files, right?
yes
> Perhaps it would be best to honor the ‘SOURCE_DATE_EPOCH’ environment
> variable¹ instead of always using zero?

> Fontforge users who expect a meaningful timestamp in there
> would still have it.  And the patch could even be submitted upstream
> eventually.
actually there are four values, two are about the font source and two
are about the font executable
the font executable times are not readable in the gui and by the work
on debian, they are not readable in the api, so this change only
low-level things invisible to users
this don't change dates on font information (because these come from
font source)
so i don't see any reason to fiddle with environment variables and
conversions to integer in c

as the two values come from the same place, the updated patch change just once

[-- Attachment #2: 0001-gnu-fontforge-Build-fonts-bit-reproducibly.patch --]
[-- Type: text/x-patch, Size: 1761 bytes --]

From 0dde3aaf3ec712b34567f82ccf6894b5522de5be Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?al=C3=ADrio=20eyng?= <alirioeyng@gmail.com>
Date: Thu, 24 Mar 2016 06:17:04 +0000
Subject: [PATCH] gnu: fontforge: Build fonts bit-reproducibly.

* gnu/packages/fontutils.scm (fontforge)[source](snippet): Remove timestamp on ttf.
---
 gnu/packages/fontutils.scm | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/gnu/packages/fontutils.scm b/gnu/packages/fontutils.scm
index 34f391e..2821867 100644
--- a/gnu/packages/fontutils.scm
+++ b/gnu/packages/fontutils.scm
@@ -352,13 +352,16 @@ definitions.")
             (modules '((guix build utils)))
             (snippet
              ;; Make builds bit-reproducible by using fixed date strings.
-             '(substitute* "configure"
-                (("^FONTFORGE_MODTIME=.*$")
-                 "FONTFORGE_MODTIME=\"1458399002\"\n")
-                (("^FONTFORGE_MODTIME_STR=.*$")
-                 "FONTFORGE_MODTIME_STR=\"15:50 CET 19-Mar-2016\"\n")
-                (("^FONTFORGE_VERSIONDATE=.*$")
-                 "FONTFORGE_VERSIONDATE=\"20160319\"\n")))))
+             '(begin
+               (substitute* "configure"
+                 (("^FONTFORGE_MODTIME=.*$")
+                  "FONTFORGE_MODTIME=\"1458399002\"\n")
+                 (("^FONTFORGE_MODTIME_STR=.*$")
+                  "FONTFORGE_MODTIME_STR=\"15:50 CET 19-Mar-2016\"\n")
+                 (("^FONTFORGE_VERSIONDATE=.*$")
+                  "FONTFORGE_VERSIONDATE=\"20160319\"\n"))
+               (substitute* "fontforge/tottf.c"
+                 (("cvt_unix_to_1904\\(now") "cvt_unix_to_1904(0"))))))
    (build-system gnu-build-system)
    (native-inputs
     `(("pkg-config" ,pkg-config)))
-- 
1.9.1


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

* Re: [PATCH] gnu: fontforge: Build fonts bit-reproducibly.
  2016-03-24  6:43   ` alírio eyng
@ 2016-03-31 22:05     ` Ludovic Courtès
  0 siblings, 0 replies; 4+ messages in thread
From: Ludovic Courtès @ 2016-03-31 22:05 UTC (permalink / raw)
  To: alírio eyng; +Cc: guix-devel

alírio eyng <alirioeyng@gmail.com> skribis:

>> Perhaps it would be best to honor the ‘SOURCE_DATE_EPOCH’ environment
>> variable¹ instead of always using zero?
>
>> Fontforge users who expect a meaningful timestamp in there
>> would still have it.  And the patch could even be submitted upstream
>> eventually.
> actually there are four values, two are about the font source and two
> are about the font executable
> the font executable times are not readable in the gui and by the work
> on debian, they are not readable in the api, so this change only
> low-level things invisible to users

There may be other programs out there that do display the timestamp,
though.

> this don't change dates on font information (because these come from
> font source)
> so i don't see any reason to fiddle with environment variables and
> conversions to integer in c

Well, I think this is debatable, and most likely in this form the change
is not acceptable for upstream.

I committed it anyway because I think it does more good than harm in our
case.

Thank you!

Ludo’.

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

end of thread, other threads:[~2016-03-31 22:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-23 13:21 [PATCH] gnu: fontforge: Build fonts bit-reproducibly alírio eyng
2016-03-23 22:21 ` Ludovic Courtès
2016-03-24  6:43   ` alírio eyng
2016-03-31 22:05     ` Ludovic Courtès

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.