uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
50
pkgs/build-support/fetchsourcehut/default.nix
Normal file
50
pkgs/build-support/fetchsourcehut/default.nix
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
{ fetchgit, fetchhg, fetchzip, lib }:
|
||||
|
||||
{ owner
|
||||
, repo, rev
|
||||
, domain ? "sr.ht"
|
||||
, vc ? "git"
|
||||
, name ? "source"
|
||||
, fetchSubmodules ? false
|
||||
, ... # For hash agility
|
||||
} @ args:
|
||||
|
||||
with lib;
|
||||
|
||||
assert (lib.assertOneOf "vc" vc [ "hg" "git" ]);
|
||||
|
||||
let
|
||||
baseUrl = "https://${vc}.${domain}/${owner}/${repo}";
|
||||
baseArgs = {
|
||||
inherit name;
|
||||
} // removeAttrs args [
|
||||
"owner" "repo" "rev" "domain" "vc" "name" "fetchSubmodules"
|
||||
];
|
||||
vcArgs = baseArgs // {
|
||||
inherit rev;
|
||||
url = baseUrl;
|
||||
};
|
||||
fetcher = if fetchSubmodules then vc else "zip";
|
||||
cases = {
|
||||
git = {
|
||||
fetch = fetchgit;
|
||||
arguments = vcArgs // { fetchSubmodules = true; };
|
||||
};
|
||||
hg = {
|
||||
fetch = fetchhg;
|
||||
arguments = vcArgs // { fetchSubrepos = true; };
|
||||
};
|
||||
zip = {
|
||||
fetch = fetchzip;
|
||||
arguments = baseArgs // {
|
||||
url = "${baseUrl}/archive/${rev}.tar.gz";
|
||||
postFetch = optionalString (vc == "hg") ''
|
||||
rm -f "$out/.hg_archival.txt"
|
||||
''; # impure file; see #12002
|
||||
};
|
||||
};
|
||||
};
|
||||
in cases.${fetcher}.fetch cases.${fetcher}.arguments // {
|
||||
inherit rev;
|
||||
meta.homepage = "${baseUrl}";
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue