nix-overlay/pkgs/coreutils-advcpmv.nix

31 lines
1.6 KiB
Nix
Raw Normal View History

2020-12-29 00:36:50 +01:00
{ fetchurl, coreutils }:
let
fetchpatch = { file, sha256 }: builtins.fetchurl { url = "https://raw.githubusercontent.com/jarun/advcpmv/master/" + file; inherit sha256; };
patches = {
# nix-hash --type sha256 --base32 --flat *.patch
"8.21" = fetchpatch { file = "advcpmv-0.5-8.21.patch"; sha256 = "15bhjj9f3wcnidxk3dsx1q0p74c2hyilf3zbjiy3wa3v166cgm79"; };
"8.24" = fetchpatch { file = "advcpmv-0.6-8.24.patch"; sha256 = "1f059nqsjcs0m0di0z8y6q1p8j84br05rklamqvd32g0mllc5272"; };
"8.25" = fetchpatch { file = "advcpmv-0.7-8.25.patch"; sha256 = "0zxflpvh1yg3j3v98h4w8j982dwc4vhan3rszklg59d1vjh38w1m"; };
"8.28" = fetchpatch { file = "advcpmv-0.8-8.28.patch"; sha256 = "06vqih7jyb629s510yxjqdv9g6lfvd2dkha17zv0jwhdbsw9d0vg"; };
"8.30" = fetchpatch { file = "advcpmv-0.8-8.30.patch"; sha256 = "06qw9amqd4wwwycjfscxybl1yxgg8x97rlfl32shcg2gamsxjm4r"; };
"8.31" = fetchpatch { file = "advcpmv-0.8-8.31.patch"; sha256 = "0m0plga0m9q8rcg9s2sihxap31q1z64a74jaypvyjzy01gcmccnq"; };
"8.32" = fetchpatch { file = "advcpmv-0.8-8.32.patch"; sha256 = "02h5cwxkzzm5dkf0v9dr39k3ndp506np9w1wrblxl8g02pbvj5sw"; };
2020-12-29 00:36:50 +01:00
};
in
coreutils.overrideAttrs (old: {
pname = "coreutils-advcpmv";
patches = (old.patches or []) ++ [
(
if patches ? ${old.version} then patches."${old.version}"
else throw "Missing advcpmv patch for coreutils version ${old.version}."
)
];
# With the patch above, the test tests/misc/usage_vs_getopt.sh does not work anymore.
postPatch = old.postPatch + ''
sed '2i echo Skipping usage vs getopts test && exit 77' -i ./tests/misc/usage_vs_getopt.sh
'';
})