summary refs log tree commit diff
path: root/pkgs/tools/archivers
diff options
context:
space:
mode:
authorVladimír Čunát <v@cunat.cz>2021-09-26 15:03:03 +0200
committerVladimír Čunát <v@cunat.cz>2021-09-26 15:03:03 +0200
commita641e599a8ff34d9da56fe3b2797451d7dc6a86c (patch)
treed49e7d41bd3e8f31deca5b8b276c5c3a0c4d4671 /pkgs/tools/archivers
parent445a2455ad7af902e226f50bc550056094365015 (diff)
parent7c86d10590ccc5330fed0866fe937faf3e36f7a3 (diff)
downloadnixpkgs-a641e599a8ff34d9da56fe3b2797451d7dc6a86c.tar
nixpkgs-a641e599a8ff34d9da56fe3b2797451d7dc6a86c.tar.gz
nixpkgs-a641e599a8ff34d9da56fe3b2797451d7dc6a86c.tar.bz2
nixpkgs-a641e599a8ff34d9da56fe3b2797451d7dc6a86c.tar.lz
nixpkgs-a641e599a8ff34d9da56fe3b2797451d7dc6a86c.tar.xz
nixpkgs-a641e599a8ff34d9da56fe3b2797451d7dc6a86c.tar.zst
nixpkgs-a641e599a8ff34d9da56fe3b2797451d7dc6a86c.zip
Merge branch 'staging-next' into staging
Diffstat (limited to 'pkgs/tools/archivers')
-rw-r--r--pkgs/tools/archivers/cpio/default.nix31
1 files changed, 18 insertions, 13 deletions
diff --git a/pkgs/tools/archivers/cpio/default.nix b/pkgs/tools/archivers/cpio/default.nix
index adf73732f6d..1ae8de975a5 100644
--- a/pkgs/tools/archivers/cpio/default.nix
+++ b/pkgs/tools/archivers/cpio/default.nix
@@ -1,22 +1,27 @@
 { lib, stdenv, fetchurl, fetchpatch }:
 
-let
+stdenv.mkDerivation rec {
+  pname = "cpio";
   version = "2.13";
-  name = "cpio-${version}";
-in stdenv.mkDerivation {
-  inherit name;
 
   src = fetchurl {
-    url = "mirror://gnu/cpio/${name}.tar.bz2";
+    url = "mirror://gnu/cpio/cpio-${version}.tar.bz2";
     sha256 = "0vbgnhkawdllgnkdn6zn1f56fczwk0518krakz2qbwhxmv2vvdga";
   };
 
-  patches = [
-    (fetchpatch {
-      name = "CVE-2021-38185.patch";
-      url = "https://git.savannah.gnu.org/cgit/cpio.git/patch/?id=dd96882877721703e19272fe25034560b794061b";
-      sha256 = "0vmr0qjwj2ldnzsvccl105ckwgx3ssvn9mp3f27ss0kiyigrzz32";
-    })
+  patches = let
+    fp = suffix: rev: sha256: fetchpatch {
+      name = "CVE-2021-38185-${suffix}.patch";
+      url = "https://git.savannah.gnu.org/cgit/cpio.git/patch/?id=${rev}";
+      inherit sha256;
+    };
+  in [
+    (fp "1" "dd96882877721703e19272fe25034560b794061b"
+        "0vmr0qjwj2ldnzsvccl105ckwgx3ssvn9mp3f27ss0kiyigrzz32")
+    (fp "2" "dfc801c44a93bed7b3951905b188823d6a0432c8"
+        "1qkrhi3lbxk6hflp6w3h4sgssc0wblv8r0qgxqzbjrm36pqwxiwh")
+    (fp "3" "236684f6deb3178043fe72a8e2faca538fa2aae1"
+        "0pidkbxalpj5yz4fr95x8h0rizgjij0xgvjgirfkjk460giawwg6")
     (fetchpatch {
       # upstream build fix against -fno-common compilers like >=gcc-10
       name = "fno-common-fix.patch";
@@ -25,9 +30,9 @@ in stdenv.mkDerivation {
     })
   ];
 
-  preConfigure = if stdenv.isCygwin then ''
+  preConfigure = lib.optionalString stdenv.isCygwin ''
     sed -i gnu/fpending.h -e 's,include <stdio_ext.h>,,'
-  '' else null;
+  '';
 
   enableParallelBuilding = true;