From: Runciter via Guix-patches via <guix-patches@gnu.org>
To: 74411@debbugs.gnu.org
Cc: Runciter <runciter@whispers-vpn.org>
Subject: [bug#74411] [PATCH v3 5/5] gnu: freedict-tools: Fix non-determinism of dictzip compressed file headers.
Date: Sun, 01 Dec 2024 21:00:29 +0000 [thread overview]
Message-ID: <7eff2fc08e8f01e7f696b40d4addcd1646fd65e4.1733086737.git.runciter@whispers-vpn.org> (raw)
In-Reply-To: <5aeac28fdf163ab55801c6185c0dc47f35e649ef.1733086737.git.runciter@whispers-vpn.org>
Reset .dict file mtime to start of the epoch before compressing with dictzip.
* gnu/packages/patches/freedict-tools-fix-determinism.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/dictionaries.scm (freedict-tools): Use it.
Signed-off-by: Runciter <runciter@whispers-vpn.org>
---
gnu/local.mk | 1 +
gnu/packages/dictionaries.scm | 3 ++-
.../freedict-tools-fix-determinism.patch | 22 +++++++++++++++++++
3 files changed, 25 insertions(+), 1 deletion(-)
create mode 100644 gnu/packages/patches/freedict-tools-fix-determinism.patch
diff --git a/gnu/local.mk b/gnu/local.mk
index 7004d02547..f6b465441a 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1291,6 +1291,7 @@ dist_patch_DATA = \
%D%/packages/patches/fpc-glibc-2.34-compat.patch \
%D%/packages/patches/fpm-newer-clamp-fix.patch \
%D%/packages/patches/freecad-vtk-9.3.patch \
+ %D%/packages/patches/freedict-tools-fix-determinism.patch \
%D%/packages/patches/freedink-engine-fix-sdl-hints.patch \
%D%/packages/patches/freeimage-libtiff-compat.patch \
%D%/packages/patches/freeimage-libraw-0.21-compat.patch \
diff --git a/gnu/packages/dictionaries.scm b/gnu/packages/dictionaries.scm
index e6f9f7f5a8..da86b4f797 100644
--- a/gnu/packages/dictionaries.scm
+++ b/gnu/packages/dictionaries.scm
@@ -483,7 +483,8 @@ (define-public freedict-tools
(url "https://github.com/freedict/tools")
(commit "3596640e6e0582cc5fb76a342e5d8e7413aa4b34")))
(sha256
- (base32 "1raayynvn1j8x0ck8pnbbljl6zxnsyzzil7y54xz03dpj7k9w7mk"))))
+ (base32 "1raayynvn1j8x0ck8pnbbljl6zxnsyzzil7y54xz03dpj7k9w7mk"))
+ (patches (search-patches "freedict-tools-fix-determinism.patch"))))
(inputs (list espeak-ng
python
perl
diff --git a/gnu/packages/patches/freedict-tools-fix-determinism.patch b/gnu/packages/patches/freedict-tools-fix-determinism.patch
new file mode 100644
index 0000000000..ad100bbba9
--- /dev/null
+++ b/gnu/packages/patches/freedict-tools-fix-determinism.patch
@@ -0,0 +1,22 @@
+The compression utility dictzip writes the compressed file's mtime in a header
+of the compressed file. No command-line switch is documented to control or
+suppress this behavior. This makes the build of packages relying on
+freedict-tools such as freedict-dictionaries non-deterministic.
+
+This patch sets the mtime of the .dict file to be compressed by dictzip to the
+start of the epoch on the Greenwich meridian, restoring build determinism.
+
+diff --git a/mk/dicts.mk b/mk/dicts.mk
+index 08e8923..e671cf3 100644
+--- a/mk/dicts.mk
++++ b/mk/dicts.mk
+@@ -265,7 +265,8 @@ $(BUILD_DICTD)/%.dict $(BUILD_DICTD)/%.index: $(BUILD_DICTD)/%.c5 query-dictd
+ dictfmt --without-time -t --headword-separator %%% $(DICTFMTFLAGS) $* < $(notdir $<)
+
+ $(BUILD_DICTD)/%.dict.dz: $(BUILD_DICTD)/%.dict
+- dictzip -k $<
++ touch -m -d "$$(date -u -R -d @0)" $< && \
++ dictzip -k $<
+
+ # prevent make from removing our precious file
+ .PRECIOUS: $(BUILD_DICTD)/$(dictname).dict
--
2.46.0
next prev parent reply other threads:[~2024-12-01 21:01 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-17 18:06 [bug#74411] [PATCH 0/4] Add DICT and FreeDict projects packages Runciter via Guix-patches via
2024-11-18 5:55 ` [bug#74411] [PATCH 1/4] gnu: Add (gnu packages dictd) Runciter via Guix-patches via
2024-11-18 5:56 ` [bug#74411] [PATCH 2/4] gnu: Add dictd-1.13.1 Runciter via Guix-patches via
2024-11-18 5:56 ` [bug#74411] [PATCH 3/4] gnu: Add freedict-tools-0.6.0 Runciter via Guix-patches via
2024-11-18 5:56 ` [bug#74411] [PATCH 4/4] gnu: Add freedict-dictionaries Runciter via Guix-patches via
2024-11-18 6:37 ` [bug#74411] freedict-dictionaries build non-deterministic Runciter via Guix-patches via
2024-11-19 8:43 ` Nicolas Graves via Guix-patches via
2024-11-19 15:13 ` Runciter via Guix-patches via
2024-11-21 0:49 ` [bug#74411] [PATCH v2 1/5] gnu: Add (gnu packages dictd) Runciter via Guix-patches via
2024-11-21 0:49 ` [bug#74411] [PATCH v2 2/5] gnu: Add dictd-1.13.1 Runciter via Guix-patches via
2024-11-29 13:11 ` Ludovic Courtès
2024-11-21 0:50 ` [bug#74411] [PATCH v2 3/5] gnu: Add freedict-tools-0.6.0 Runciter via Guix-patches via
2024-11-29 13:14 ` Ludovic Courtès
2024-11-21 0:50 ` [bug#74411] [PATCH v2 4/5] gnu: Add freedict-dictionaries Runciter via Guix-patches via
2024-11-29 13:28 ` Ludovic Courtès
2024-11-21 0:50 ` [bug#74411] [PATCH v2 5/5] gnu: freedict-tools: Fix non-determinism of dictzip compressed file headers Runciter via Guix-patches via
2024-11-29 13:34 ` Ludovic Courtès
2024-11-29 13:10 ` [bug#74411] [PATCH v2 1/5] gnu: Add (gnu packages dictd) Ludovic Courtès
2024-11-21 1:15 ` [bug#74411] patch v2 non-determinism fix Runciter via Guix-patches via
2024-12-01 20:41 ` [bug#74411] [PATCH v2 1/5] gnu: Add (gnu packages dictd) Runciter via Guix-patches via
2024-12-01 20:53 ` [bug#74411] [PATCH v2 4/5] gnu: Add freedict-dictionaries Runciter via Guix-patches via
2024-12-01 20:59 ` [bug#74411] [PATCH v3 1/5] gnu: Add (gnu packages dictd) Runciter via Guix-patches via
2024-12-01 20:59 ` [bug#74411] [PATCH v3 2/5] gnu: Add dictd Runciter via Guix-patches via
2024-12-01 21:00 ` [bug#74411] [PATCH v3 3/5] gnu: Add freedict-tools Runciter via Guix-patches via
2024-12-01 21:00 ` [bug#74411] [PATCH v3 4/5] gnu: Add freedict-dictionaries Runciter via Guix-patches via
2024-12-01 21:00 ` Runciter via Guix-patches via [this message]
2024-12-02 21:04 ` bug#74411: [PATCH v3 1/5] gnu: Add (gnu packages dictd) Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7eff2fc08e8f01e7f696b40d4addcd1646fd65e4.1733086737.git.runciter@whispers-vpn.org \
--to=guix-patches@gnu.org \
--cc=74411@debbugs.gnu.org \
--cc=runciter@whispers-vpn.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.