diff options
author | Runciter <[email protected]> | 2024-12-01 21:00:29 +0000 |
---|---|---|
committer | Ludovic Courtès <[email protected]> | 2024-12-02 23:18:53 +0100 |
commit | abda22ecb103947372c7359c9e94dab7121f4217 (patch) | |
tree | 298ec8e11730976ea5080baf1343b06f78957d46 /gnu/packages/patches | |
parent | bed1371a9acffa49b160c5110ef4cae5952ca468 (diff) |
gnu: freedict-tools: Fix non-determinism of dictzip compressed file headers.
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 <[email protected]>
Signed-off-by: Ludovic Courtès <[email protected]>
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r-- | gnu/packages/patches/freedict-tools-fix-determinism.patch | 22 |
1 files changed, 22 insertions, 0 deletions
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 |