GNU bug report logs -
#74411
[PATCH 0/4] Add DICT and FreeDict projects packages
Previous Next
Reported by: Runciter <runciter <at> whispers-vpn.org>
Date: Mon, 18 Nov 2024 05:05:02 UTC
Severity: normal
Tags: patch
Done: Ludovic Courtès <ludo <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #41 received at 74411 <at> debbugs.gnu.org (full text, mbox):
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 <at> 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 3e5d991890..a6daf209e3 100644
--- a/gnu/packages/dictionaries.scm
+++ b/gnu/packages/dictionaries.scm
@@ -483,7 +483,8 @@ (define-public freedict-tools-0.6.0
(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
This bug report was last modified 222 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.