summaryrefslogtreecommitdiff
path: root/gnu/packages
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages')
-rw-r--r--gnu/packages/dictionaries.scm3
-rw-r--r--gnu/packages/patches/freedict-tools-fix-determinism.patch22
2 files changed, 24 insertions, 1 deletions
diff --git a/gnu/packages/dictionaries.scm b/gnu/packages/dictionaries.scm
index c46b1265c7..21c3f668d2 100644
--- a/gnu/packages/dictionaries.scm
+++ b/gnu/packages/dictionaries.scm
@@ -484,7 +484,8 @@ for SKK Japanese input systems, and various dictionary files.
(commit "3596640e6e0582cc5fb76a342e5d8e7413aa4b34"))) ;"0.6.0" tag
(file-name (git-file-name name version))
(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