lol

Merge pull request #34018 from obsidiansystems/fetchpatch

fetchpatch: Add support for an arbitrary extra prefix

authored by

John Ericson and committed by
GitHub
5708396f f12f2ed4

+10 -10
+5 -5
pkgs/build-support/fetchpatch/default.nix
··· 5 5 # stripLen acts as the -p parameter when applying a patch. 6 6 7 7 { lib, fetchurl, patchutils }: 8 - { stripLen ? 0, addPrefixes ? false, excludes ? [], ... }@args: 8 + { stripLen ? 0, extraPrefix ? null, excludes ? [], ... }@args: 9 9 10 10 fetchurl ({ 11 11 postFetch = '' ··· 16 16 "${patchutils}/bin/filterdiff" \ 17 17 --include={} \ 18 18 --strip=${toString stripLen} \ 19 - ${lib.optionalString addPrefixes '' 20 - --addoldprefix=a/ \ 21 - --addnewprefix=b/ \ 19 + ${lib.optionalString (extraPrefix != null) '' 20 + --addoldprefix=a/${extraPrefix} \ 21 + --addnewprefix=b/${extraPrefix} \ 22 22 ''} \ 23 23 --clean "$out" > "$tmpfile" 24 24 ${patchutils}/bin/filterdiff \ ··· 27 27 "$tmpfile" > "$out" 28 28 ${args.postFetch or ""} 29 29 ''; 30 - } // builtins.removeAttrs args ["stripLen" "addPrefixes" "excludes" "postFetch"]) 30 + } // builtins.removeAttrs args ["stripLen" "extraPrefix" "excludes" "postFetch"])
+2 -2
pkgs/development/libraries/libstdc++5/default.nix
··· 21 21 name = "siginfo.patch"; 22 22 url = "https://git.archlinux.org/svntogit/packages.git/plain/trunk/siginfo.patch?h=packages/libstdc%2B%2B5&id=e36ee8ed9bb5942db14cf6249a2ead14974a2bfa"; 23 23 sha256 = "15zldbm33yba293dgrgsbv3j332hkc3iqpyc8fa7zl42mh9qk22j"; 24 - addPrefixes = true; 24 + extraPrefix = ""; 25 25 }) 26 26 (fetchpatch { 27 27 name = "gcc-3.4.3-no_multilib_amd64.patch"; 28 28 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"; 29 29 sha256 = "11m5lc51b0addhc4yq4rz0dwpv6k73rrj73wya3lqdk8rly6cjpm"; 30 - addPrefixes = true; 30 + extraPrefix = ""; 31 31 }) 32 32 # Required because of glibc 2.26 33 33 ./struct-ucontext.patch
+3 -3
pkgs/development/libraries/pcre2/default.nix
··· 20 20 url = "https://vcs.pcre.org/pcre2/code/trunk/src/pcre2_ucd.c?view=patch&r1=316&r2=670&sortby=date"; 21 21 sha256 = "10yzglvbn7h06hg7zffr5zh378i5jihvx7d5gggkynws79vgwvfr"; 22 22 stripLen = 2; 23 - addPrefixes = true; 23 + extraPrefix = ""; 24 24 }) 25 25 (fetchpatch { 26 26 name = "CVE-2017-7186-part2.patch"; 27 27 url = "https://vcs.pcre.org/pcre2/code/trunk/src/pcre2_internal.h?view=patch&r1=600&r2=670&sortby=date"; 28 28 sha256 = "1bggk7vd5hg0bjg96lj4h1lacmr6grq68dm6iz1n7vg3zf7virjn"; 29 29 stripLen = 2; 30 - addPrefixes = true; 30 + extraPrefix = ""; 31 31 }) 32 32 (fetchpatch { 33 33 name = "CVE-2017-8786.patch"; 34 34 url = "https://vcs.pcre.org/pcre2/code/trunk/src/pcre2test.c?r1=692&r2=697&view=patch"; 35 35 sha256 = "1c629nzrk4il2rfclwyc1a373q58m4q9ys9wr91zhl4skfk7x19b"; 36 36 stripLen = 2; 37 - addPrefixes = true; 37 + extraPrefix = ""; 38 38 }) 39 39 ]; 40 40