1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-22 13:41:26 +00:00

Merge pull request #34018 from obsidiansystems/fetchpatch

fetchpatch: Add support for an arbitrary extra prefix
This commit is contained in:
John Ericson 2018-01-18 12:39:39 -05:00 committed by GitHub
commit 5708396f47
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 10 deletions

View file

@ -5,7 +5,7 @@
# stripLen acts as the -p parameter when applying a patch.
{ lib, fetchurl, patchutils }:
{ stripLen ? 0, addPrefixes ? false, excludes ? [], ... }@args:
{ stripLen ? 0, extraPrefix ? null, excludes ? [], ... }@args:
fetchurl ({
postFetch = ''
@ -16,9 +16,9 @@ fetchurl ({
"${patchutils}/bin/filterdiff" \
--include={} \
--strip=${toString stripLen} \
${lib.optionalString addPrefixes ''
--addoldprefix=a/ \
--addnewprefix=b/ \
${lib.optionalString (extraPrefix != null) ''
--addoldprefix=a/${extraPrefix} \
--addnewprefix=b/${extraPrefix} \
''} \
--clean "$out" > "$tmpfile"
${patchutils}/bin/filterdiff \
@ -27,4 +27,4 @@ fetchurl ({
"$tmpfile" > "$out"
${args.postFetch or ""}
'';
} // builtins.removeAttrs args ["stripLen" "addPrefixes" "excludes" "postFetch"])
} // builtins.removeAttrs args ["stripLen" "extraPrefix" "excludes" "postFetch"])

View file

@ -21,13 +21,13 @@ stdenv.mkDerivation rec {
name = "siginfo.patch";
url = "https://git.archlinux.org/svntogit/packages.git/plain/trunk/siginfo.patch?h=packages/libstdc%2B%2B5&id=e36ee8ed9bb5942db14cf6249a2ead14974a2bfa";
sha256 = "15zldbm33yba293dgrgsbv3j332hkc3iqpyc8fa7zl42mh9qk22j";
addPrefixes = true;
extraPrefix = "";
})
(fetchpatch {
name = "gcc-3.4.3-no_multilib_amd64.patch";
url = "https://git.archlinux.org/svntogit/packages.git/plain/trunk/gcc-3.4.3-no_multilib_amd64.patch?h=packages/libstdc%2B%2B5&id=e36ee8ed9bb5942db14cf6249a2ead14974a2bfa";
sha256 = "11m5lc51b0addhc4yq4rz0dwpv6k73rrj73wya3lqdk8rly6cjpm";
addPrefixes = true;
extraPrefix = "";
})
# Required because of glibc 2.26
./struct-ucontext.patch

View file

@ -20,21 +20,21 @@ stdenv.mkDerivation rec {
url = "https://vcs.pcre.org/pcre2/code/trunk/src/pcre2_ucd.c?view=patch&r1=316&r2=670&sortby=date";
sha256 = "10yzglvbn7h06hg7zffr5zh378i5jihvx7d5gggkynws79vgwvfr";
stripLen = 2;
addPrefixes = true;
extraPrefix = "";
})
(fetchpatch {
name = "CVE-2017-7186-part2.patch";
url = "https://vcs.pcre.org/pcre2/code/trunk/src/pcre2_internal.h?view=patch&r1=600&r2=670&sortby=date";
sha256 = "1bggk7vd5hg0bjg96lj4h1lacmr6grq68dm6iz1n7vg3zf7virjn";
stripLen = 2;
addPrefixes = true;
extraPrefix = "";
})
(fetchpatch {
name = "CVE-2017-8786.patch";
url = "https://vcs.pcre.org/pcre2/code/trunk/src/pcre2test.c?r1=692&r2=697&view=patch";
sha256 = "1c629nzrk4il2rfclwyc1a373q58m4q9ys9wr91zhl4skfk7x19b";
stripLen = 2;
addPrefixes = true;
extraPrefix = "";
})
];