about summary refs log tree commit diff
path: root/pkgs/tools/text/diffutils
diff options
context:
space:
mode:
authorSergei Trofimovich <slyich@gmail.com>2023-01-29 18:51:22 +0000
committerSergei Trofimovich <slyich@gmail.com>2023-02-20 18:59:36 +0000
commitcdf6a4230156ad23e16ce2eedcfd2a328365bdf6 (patch)
tree5fa3945a417725fecabbe0c3c048308245883009 /pkgs/tools/text/diffutils
parent2be9646b90944cbf0ffd5a96023b9d370c2949ab (diff)
downloadnixlib-cdf6a4230156ad23e16ce2eedcfd2a328365bdf6.tar
nixlib-cdf6a4230156ad23e16ce2eedcfd2a328365bdf6.tar.gz
nixlib-cdf6a4230156ad23e16ce2eedcfd2a328365bdf6.tar.bz2
nixlib-cdf6a4230156ad23e16ce2eedcfd2a328365bdf6.tar.lz
nixlib-cdf6a4230156ad23e16ce2eedcfd2a328365bdf6.tar.xz
nixlib-cdf6a4230156ad23e16ce2eedcfd2a328365bdf6.tar.zst
nixlib-cdf6a4230156ad23e16ce2eedcfd2a328365bdf6.zip
diffutils: 3.8 -> 3.9
Changes: https://savannah.gnu.org/forum/forum.php?forum_id=10282
Diffstat (limited to 'pkgs/tools/text/diffutils')
-rw-r--r--pkgs/tools/text/diffutils/default.nix16
-rw-r--r--pkgs/tools/text/diffutils/fix-diff-D.patch15
2 files changed, 29 insertions, 2 deletions
diff --git a/pkgs/tools/text/diffutils/default.nix b/pkgs/tools/text/diffutils/default.nix
index d5f27747cf1c..fb0a95c49e13 100644
--- a/pkgs/tools/text/diffutils/default.nix
+++ b/pkgs/tools/text/diffutils/default.nix
@@ -7,13 +7,25 @@
 
 stdenv.mkDerivation rec {
   pname = "diffutils";
-  version = "3.8";
+  version = "3.9";
 
   src = fetchurl {
     url = "mirror://gnu/diffutils/diffutils-${version}.tar.xz";
-    sha256 = "sha256-pr3X0bMSZtEcT03mwbdI1GB6sCMa9RiPwlM9CuJDj+w=";
+    hash = "sha256-2A076QogGGjeg9eNrTQTrYgWDMU7zDbrnq98INvwI/E=";
   };
 
+  patches = [
+    # Backport of a fix for 'diff -D' output.
+    # TODO: remove when updating to 3.10.
+    ./fix-diff-D.patch
+  ];
+
+  postPatch = ''
+    # avoid the need for help2man
+    # TODO: can be removed when fix-diff-D.patch is removed.
+    touch man/diff.1
+  '';
+
   outputs = [ "out" "info" ];
 
   nativeBuildInputs = [ xz.bin ];
diff --git a/pkgs/tools/text/diffutils/fix-diff-D.patch b/pkgs/tools/text/diffutils/fix-diff-D.patch
new file mode 100644
index 000000000000..616f09279140
--- /dev/null
+++ b/pkgs/tools/text/diffutils/fix-diff-D.patch
@@ -0,0 +1,15 @@
+https://git.savannah.gnu.org/cgit/diffutils.git/patch/?id=ba08fbbb0ca5da455bf695236c57bc50e7faed50
+https://github.com/NixOS/nixpkgs/pull/213421#issuecomment-1407749912
+
+Fix 'diff -D' regression
+--- a/src/diff.c
++++ b/src/diff.c
+@@ -416,7 +416,7 @@ main (int argc, char **argv)
+ 	    char *base = b;
+ 	    int changes = 0;
+ 
+-	    for (i = 0; i < sizeof sizeof C_ifdef_group_formats; i++)
++	    for (i = 0; i < sizeof C_ifdef_group_formats; i++)
+ 	      {
+ 		char ch = C_ifdef_group_formats[i];
+ 		switch (ch)