summary refs log tree commit diff
diff options
context:
space:
mode:
authorArnout Engelen <arnout@bzzt.net>2023-08-17 12:56:14 +0200
committerGitHub <noreply@github.com>2023-08-17 12:56:14 +0200
commit8398c6fff661a2adc237ee0816fbbb11978f9e05 (patch)
tree06add9dd7930c08d9dfb2dbaf5b5fe3b15b8c7dc
parent0d715184ab971432569cf593afc2969a0b33e4e9 (diff)
parentae011819c4bba539bc8cabd57ee4cc1ccb7428a2 (diff)
downloadnixpkgs-8398c6fff661a2adc237ee0816fbbb11978f9e05.tar
nixpkgs-8398c6fff661a2adc237ee0816fbbb11978f9e05.tar.gz
nixpkgs-8398c6fff661a2adc237ee0816fbbb11978f9e05.tar.bz2
nixpkgs-8398c6fff661a2adc237ee0816fbbb11978f9e05.tar.lz
nixpkgs-8398c6fff661a2adc237ee0816fbbb11978f9e05.tar.xz
nixpkgs-8398c6fff661a2adc237ee0816fbbb11978f9e05.tar.zst
nixpkgs-8398c6fff661a2adc237ee0816fbbb11978f9e05.zip
Merge pull request #245885 from raboof/gettext-msginit-avoid-date-in-generated-output
gettext: do not output date when --no-translator is set
-rw-r--r--pkgs/development/libraries/gettext/0001-msginit-Do-not-use-POT-Creation-Date.patch32
-rw-r--r--pkgs/development/libraries/gettext/default.nix3
2 files changed, 35 insertions, 0 deletions
diff --git a/pkgs/development/libraries/gettext/0001-msginit-Do-not-use-POT-Creation-Date.patch b/pkgs/development/libraries/gettext/0001-msginit-Do-not-use-POT-Creation-Date.patch
new file mode 100644
index 00000000000..eea9dc6e037
--- /dev/null
+++ b/pkgs/development/libraries/gettext/0001-msginit-Do-not-use-POT-Creation-Date.patch
@@ -0,0 +1,32 @@
+From 1e000ca711886055176a2f90197a383d09de0e67 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Miguel=20=C3=81ngel=20Arruga=20Vivas?=
+ <rosen644835@gmail.com>
+Date: Fri, 18 Dec 2020 14:19:36 +0100
+Subject: [PATCH] msginit: Do not use POT-Creation-Date.
+
+* gettext-tools/src/msginit.c (po_revision_date): Do not use
+POT-Creation-Date when the file is automatically generated.
+---
+ gettext-tools/src/msginit.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/gettext-tools/src/msginit.c b/gettext-tools/src/msginit.c
+index 8ca9a3b77..06e0e7195 100644
+--- a/gettext-tools/src/msginit.c
++++ b/gettext-tools/src/msginit.c
+@@ -1075,9 +1075,9 @@ static const char *
+ po_revision_date (const char *header)
+ {
+   if (no_translator)
+-    /* Because the PO file is automatically generated, we use the
+-       POT-Creation-Date, not the current time.  */
+-    return get_field (header, "POT-Creation-Date");
++    /* Because the PO file is automatically generated, we don't
++       generate PO-Revision-Date field.  */
++    return NULL;
+   else
+     {
+       /* Assume the translator will modify the PO file now.  */
+-- 
+2.29.2
+
diff --git a/pkgs/development/libraries/gettext/default.nix b/pkgs/development/libraries/gettext/default.nix
index ec929272dea..0222cb44804 100644
--- a/pkgs/development/libraries/gettext/default.nix
+++ b/pkgs/development/libraries/gettext/default.nix
@@ -17,6 +17,9 @@ stdenv.mkDerivation rec {
   };
   patches = [
     ./absolute-paths.diff
+    # fix reproducibile output, in particular in the grub2 build
+    # https://savannah.gnu.org/bugs/index.php?59658
+    ./0001-msginit-Do-not-use-POT-Creation-Date.patch
   ] ++ lib.optional stdenv.hostPlatform.isWindows (fetchpatch {
     url = "https://aur.archlinux.org/cgit/aur.git/plain/gettext_formatstring-ruby.patch?h=mingw-w64-gettext&id=e8b577ee3d399518d005e33613f23363a7df07ee";
     name = "gettext_formatstring-ruby.patch";