This is an automated email from the git hooks/post-receive script.

guix_mirror_bot pushed a commit to branch master
in repository guix.

The following commit(s) were added to refs/heads/master by this push:
     new 1b609b32b83 gnu: font-terminus: Make the build reproducible.
1b609b32b83 is described below

commit 1b609b32b838aecf96b0347bccdb41fa6a494ddd
Author: Sören Tempel <[email protected]>
AuthorDate: Fri Sep 18 21:09:23 2026 +0200

    gnu: font-terminus: Make the build reproducible.
    
    The patch has been taken from nixpkgs.
    
    * gnu/packages/patches/font-terminus-respect-SOURCE_DATE_EPOCH.patch:
    New file.
    * gnu/local.mk (dist_patch_DATA): Register it.
    * gnu/packages/fonts.scm (font-terminus) [source] <patches>: Apply it.
    
    Merges: https://codeberg.org/guix/guix/pulls/11315
    Signed-off-by: 宋文武 <[email protected]>
---
 gnu/local.mk                                       |  1 +
 gnu/packages/fonts.scm                             |  4 +-
 .../font-terminus-respect-SOURCE_DATE_EPOCH.patch  | 85 ++++++++++++++++++++++
 3 files changed, 89 insertions(+), 1 deletion(-)

diff --git a/gnu/local.mk b/gnu/local.mk
index 549c441f983..d40b04cd3da 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1345,6 +1345,7 @@ dist_patch_DATA =                                         
\
   %D%/packages/patches/fluxbox-1.3.7-gcc.patch                 \
   %D%/packages/patches/fmt-9-overspecified-tests.patch \
   %D%/packages/patches/font-gnu-freefont-python3-compat.patch  \
+  %D%/packages/patches/font-terminus-respect-SOURCE_DATE_EPOCH.patch   \
   %D%/packages/patches/fontconfig-cache-ignore-mtime.patch     \
   %D%/packages/patches/fontforge-hurd.patch                    \
   %D%/packages/patches/foobillard++-pkg-config.patch           \
diff --git a/gnu/packages/fonts.scm b/gnu/packages/fonts.scm
index f39a4ab3d3c..891c2906075 100644
--- a/gnu/packages/fonts.scm
+++ b/gnu/packages/fonts.scm
@@ -1064,7 +1064,9 @@ letters to account for regional differences.")
                            (version-major+minor version)
                            "/terminus-font-" version ".tar.gz"))
        (sha256
-        (base32 "0yggffiplk22lgqklfmd2c0rw8gwchynjh5kz4bz8yv2h6vw2qfr"))))
+        (base32 "0yggffiplk22lgqklfmd2c0rw8gwchynjh5kz4bz8yv2h6vw2qfr"))
+       (patches
+        (search-patches "font-terminus-respect-SOURCE_DATE_EPOCH.patch"))))
     (build-system gnu-build-system)
     (outputs (list "out" "pcf-8bit" "otb"))
     (arguments
diff --git a/gnu/packages/patches/font-terminus-respect-SOURCE_DATE_EPOCH.patch 
b/gnu/packages/patches/font-terminus-respect-SOURCE_DATE_EPOCH.patch
new file mode 100644
index 00000000000..3406e896df6
--- /dev/null
+++ b/gnu/packages/patches/font-terminus-respect-SOURCE_DATE_EPOCH.patch
@@ -0,0 +1,85 @@
+Taken from 
https://github.com/NixOS/nixpkgs/blob/ecc58f32d1069a3e3f8a991e2233d365689f748d/pkgs/by-name/te/terminus_font/SOURCE_DATE_EPOCH-for-otb.patch
+
+From 2f935030ddb834426da1180b768e6b1e71d0824a Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <[email protected]>
+Date: Sat, 9 Oct 2021 10:17:05 +0100
+Subject: [PATCH] terminus-font: bin/otb1cli.py: add support for
+ SOURCE_DATE_EPOCH
+
+NixOS (and a few other distributions) strive for bit-reproducible
+builds. terminus-font-4.49.1 fails reproducibility test due to
+timestamp embedding into .otb files. diffoscope says that two
+consecutive builds differ at file creation timestamp:
+
+ $ diffoscope '...-terminus-font-4.49.1' '...-terminus-font-4.49.1.check'
+ - ...-terminus-font-4.49.1/share/fonts/terminus/ter-u12b.otb
+ + ...-terminus-font-4.49.1.check/share/fonts/terminus/ter-u12b.otb
+  showttf {}
+ @@ -1,32 +1,32 @@
+  version=1, numtables=12, searchRange=128 entrySel=3 rangeshift=64
+  File Checksum =b1b0afba (should be 0xb1b0afba), diff=0
+  EBDT checksum=5263c696 actual=5263c696 diff=0 offset=204 len=23056
+  EBLC checksum=350f1222 actual=350f1222 diff=0 offset=23260 len=84
+  OS/2 checksum=8b4939dd actual=8b4939dd diff=0 offset=23344 len=96
+  cmap checksum=da4e56f3 actual=da4e56f3 diff=0 offset=23440 len=1220
+  glyf checksum=00000000 actual=00000000 diff=0 offset=24660 len=0
+ -head checksum=1cb1374e actual=9db28c18 diff=8103bb56 offset=24660 len=54
+ +head checksum=1cb528c7 actual=9dae9a9f diff=811bb258 offset=24660 len=54
+  hhea checksum=055706a2 actual=055706a2 diff=0 offset=24716 len=36
+  hmtx checksum=98000000 actual=98000000 diff=0 offset=24752 len=5424
+  loca checksum=00000000 actual=00000000 diff=0 offset=30176 len=2714
+  maxp checksum=058e0003 actual=058e0003 diff=0 offset=32892 len=32
+  name checksum=208d345e actual=208d345e diff=0 offset=32924 len=448
+  post checksum=ffd80056 actual=ffd80056 diff=0 offset=33372 len=32
+
+  HEAD table (at 24660)
+       Version=1
+       fontRevision=1
+ -     checksumAdj=810154ca
+ +     checksumAdj=80f971d8
+       magicNumber=5f0f3cf5 (0x5f0f3cf5, diff=0)
+       flags=20b baseline_at_0 lsb_at_0 ppem_to_int
+       unitsPerEm=1024
+       create[0]=0
+ -      create[1]=dd831dec
+ -     File created: Wed Oct  6 09:33:32 2021
+ +      create[1]=dd870f65
+ +     File created: Sat Oct  9 09:20:37 2021
+
+The change uses SOURCE_DATE_EPOCH environment variable to override
+on-disk timestamps:
+    https://reproducible-builds.org/docs/source-date-epoch/
+---
+ bin/otb1cli.py | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/bin/otb1cli.py b/bin/otb1cli.py
+index 92ab07b..847b570 100644
+--- a/bin/otb1cli.py
++++ b/bin/otb1cli.py
+@@ -17,6 +17,7 @@
+ #
+ 
+ from datetime import datetime, timezone
++import os
+ 
+ import fnutil
+ import fncli
+@@ -81,8 +82,12 @@ def main_program(nonopt, parsed):
+                       try:
+                               stat = ifs.fstat()
+                               if stat:
+-                                      parsed.created = 
datetime.fromtimestamp(stat.st_ctime, timezone.utc)
+-                                      parsed.modified = 
datetime.fromtimestamp(stat.st_mtime, timezone.utc)
++                                      # Allow deterministic builds when 
SOURCE_DATE_EPOCH is set:
++                                      #  
https://reproducible-builds.org/docs/source-date-epoch/
++                                      ct = 
int(os.environ.get('SOURCE_DATE_EPOCH', stat.st_ctime))
++                                      mt = 
int(os.environ.get('SOURCE_DATE_EPOCH', stat.st_mtime))
++                                      parsed.created = 
datetime.fromtimestamp(ct, timezone.utc)
++                                      parsed.modified = 
datetime.fromtimestamp(mt, timezone.utc)
+                       except Exception as ex:
+                               fnutil.warning(ifs.location(), str(ex))
+ 
+-- 
+2.33.0
+

Reply via email to