2021-08-22 19:37:13 +03:00
|
|
|
{ lib, stdenv, fetchurl, fetchpatch }:
|
2005-08-30 17:56:15 +04:00
|
|
|
|
2021-09-25 19:40:56 +03:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "cpio";
|
2019-11-06 19:30:02 +03:00
|
|
|
version = "2.13";
|
2013-03-21 02:01:36 +04:00
|
|
|
|
2005-08-30 17:56:15 +04:00
|
|
|
src = fetchurl {
|
2021-09-25 19:40:56 +03:00
|
|
|
url = "mirror://gnu/cpio/cpio-${version}.tar.bz2";
|
2019-11-06 19:30:02 +03:00
|
|
|
sha256 = "0vbgnhkawdllgnkdn6zn1f56fczwk0518krakz2qbwhxmv2vvdga";
|
2005-08-30 17:56:15 +04:00
|
|
|
};
|
2009-02-12 22:04:44 +03:00
|
|
|
|
2021-09-25 19:38:53 +03:00
|
|
|
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")
|
2021-09-12 10:11:59 +03:00
|
|
|
(fetchpatch {
|
|
|
|
# upstream build fix against -fno-common compilers like >=gcc-10
|
|
|
|
name = "fno-common-fix.patch";
|
|
|
|
url = "https://git.savannah.gnu.org/cgit/cpio.git/patch/?id=641d3f489cf6238bb916368d4ba0d9325a235afb";
|
|
|
|
sha256 = "1ffawzxjw72kzpdwffi2y7pvibrmwf4jzrxdq9f4a75q6crl66iq";
|
|
|
|
})
|
2021-08-22 19:37:13 +03:00
|
|
|
];
|
|
|
|
|
2021-12-02 02:46:27 +03:00
|
|
|
separateDebugInfo = true;
|
|
|
|
|
2021-09-25 19:40:56 +03:00
|
|
|
preConfigure = lib.optionalString stdenv.isCygwin ''
|
2014-10-23 22:10:12 +04:00
|
|
|
sed -i gnu/fpending.h -e 's,include <stdio_ext.h>,,'
|
2021-09-25 19:40:56 +03:00
|
|
|
'';
|
2014-10-23 22:10:12 +04:00
|
|
|
|
2015-09-18 07:04:49 +03:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-01-11 10:54:33 +03:00
|
|
|
meta = with lib; {
|
2020-04-01 04:11:51 +03:00
|
|
|
homepage = "https://www.gnu.org/software/cpio/";
|
2010-08-03 14:55:58 +04:00
|
|
|
description = "A program to create or extract from cpio archives";
|
2018-08-15 21:20:08 +03:00
|
|
|
license = licenses.gpl3;
|
|
|
|
platforms = platforms.all;
|
2015-08-25 01:37:54 +03:00
|
|
|
priority = 6; # resolves collision with gnutar's "libexec/rmt"
|
2009-02-12 22:04:44 +03:00
|
|
|
};
|
2005-08-30 17:56:15 +04:00
|
|
|
}
|