Merge pull request #15139 from aneeshusa/allow-sha512-for-various-fetch-derivations
Allow any hash function for some git-based fetch* derivations
This commit is contained in:
commit
85b3613751
|
@ -221,39 +221,54 @@ in
|
||||||
|
|
||||||
fetchzip = callPackage ../build-support/fetchzip { };
|
fetchzip = callPackage ../build-support/fetchzip { };
|
||||||
|
|
||||||
fetchFromGitHub = { owner, repo, rev, sha256, name ? "${repo}-${rev}-src" }: fetchzip {
|
fetchFromGitHub = {
|
||||||
inherit name sha256;
|
owner, repo, rev, name ? "${repo}-${rev}-src",
|
||||||
|
... # For hash agility
|
||||||
|
}@args: fetchzip ({
|
||||||
|
inherit name;
|
||||||
url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz";
|
url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz";
|
||||||
meta.homepage = "https://github.com/${owner}/${repo}/";
|
meta.homepage = "https://github.com/${owner}/${repo}/";
|
||||||
} // { inherit rev; };
|
} // removeAttrs args [ "owner" "repo" "rev" ]) // { inherit rev; };
|
||||||
|
|
||||||
fetchFromBitbucket = { owner, repo, rev, sha256, name ? "${repo}-${rev}-src" }: fetchzip {
|
fetchFromBitbucket = {
|
||||||
inherit name sha256;
|
owner, repo, rev, name ? "${repo}-${rev}-src",
|
||||||
|
... # For hash agility
|
||||||
|
}@args: fetchzip ({
|
||||||
|
inherit name;
|
||||||
url = "https://bitbucket.org/${owner}/${repo}/get/${rev}.tar.gz";
|
url = "https://bitbucket.org/${owner}/${repo}/get/${rev}.tar.gz";
|
||||||
meta.homepage = "https://bitbucket.org/${owner}/${repo}/";
|
meta.homepage = "https://bitbucket.org/${owner}/${repo}/";
|
||||||
extraPostFetch = ''rm -f "$out"/.hg_archival.txt''; # impure file; see #12002
|
extraPostFetch = ''rm -f "$out"/.hg_archival.txt''; # impure file; see #12002
|
||||||
};
|
} // removeAttrs args [ "owner" "repo" "rev" ]) // { inherit rev; };
|
||||||
|
|
||||||
# cgit example, snapshot support is optional in cgit
|
# cgit example, snapshot support is optional in cgit
|
||||||
fetchFromSavannah = { repo, rev, sha256, name ? "${repo}-${rev}-src" }: fetchzip {
|
fetchFromSavannah = {
|
||||||
inherit name sha256;
|
repo, rev, name ? "${repo}-${rev}-src",
|
||||||
|
... # For hash agility
|
||||||
|
}@args: fetchzip ({
|
||||||
|
inherit name;
|
||||||
url = "http://git.savannah.gnu.org/cgit/${repo}.git/snapshot/${repo}-${rev}.tar.gz";
|
url = "http://git.savannah.gnu.org/cgit/${repo}.git/snapshot/${repo}-${rev}.tar.gz";
|
||||||
meta.homepage = "http://git.savannah.gnu.org/cgit/${repo}.git/";
|
meta.homepage = "http://git.savannah.gnu.org/cgit/${repo}.git/";
|
||||||
};
|
} // removeAttrs args [ "repo" "rev" ]) // { inherit rev; };
|
||||||
|
|
||||||
# gitlab example
|
# gitlab example
|
||||||
fetchFromGitLab = { owner, repo, rev, sha256, name ? "${repo}-${rev}-src" }: fetchzip {
|
fetchFromGitLab = {
|
||||||
inherit name sha256;
|
owner, repo, rev, name ? "${repo}-${rev}-src",
|
||||||
|
... # For hash agility
|
||||||
|
}@args: fetchzip ({
|
||||||
|
inherit name;
|
||||||
url = "https://gitlab.com/${owner}/${repo}/repository/archive.tar.gz?ref=${rev}";
|
url = "https://gitlab.com/${owner}/${repo}/repository/archive.tar.gz?ref=${rev}";
|
||||||
meta.homepage = "https://gitlab.com/${owner}/${repo}/";
|
meta.homepage = "https://gitlab.com/${owner}/${repo}/";
|
||||||
};
|
} // removeAttrs args [ "owner" "repo" "rev" ]) // { inherit rev; };
|
||||||
|
|
||||||
# gitweb example, snapshot support is optional in gitweb
|
# gitweb example, snapshot support is optional in gitweb
|
||||||
fetchFromRepoOrCz = { repo, rev, sha256, name ? "${repo}-${rev}-src" }: fetchzip {
|
fetchFromRepoOrCz = {
|
||||||
inherit name sha256;
|
repo, rev, name ? "${repo}-${rev}-src",
|
||||||
|
... # For hash agility
|
||||||
|
}@args: fetchzip ({
|
||||||
|
inherit name;
|
||||||
url = "http://repo.or.cz/${repo}.git/snapshot/${rev}.tar.gz";
|
url = "http://repo.or.cz/${repo}.git/snapshot/${rev}.tar.gz";
|
||||||
meta.homepage = "http://repo.or.cz/${repo}.git/";
|
meta.homepage = "http://repo.or.cz/${repo}.git/";
|
||||||
};
|
} // removeAttrs args [ "repo" "rev" ]) // { inherit rev; };
|
||||||
|
|
||||||
fetchNuGet = callPackage ../build-support/fetchnuget { };
|
fetchNuGet = callPackage ../build-support/fetchnuget { };
|
||||||
buildDotnetPackage = callPackage ../build-support/build-dotnet-package { };
|
buildDotnetPackage = callPackage ../build-support/build-dotnet-package { };
|
||||||
|
|
Loading…
Reference in New Issue