mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-25 20:34:52 +03:00
fetchgit: add 'deepClone' argument to disable shallow fetching
This patch resolves https://github.com/NixOS/nixpkgs/issues/6395. Deep
cloning is useful in combination with 'leaveDotGit' for builds that want
to run "git describe" to obtain a proper version string, etc., like the
'haskellngPackages.cabal2nix' package does.
(cherry picked from commit 5d02f0e854
)
Conflicts:
pkgs/build-support/fetchgit/default.nix
This commit is contained in:
parent
d954a695e7
commit
4fde9fdfca
@ -8,6 +8,7 @@ header "exporting $url (rev $rev) into $out"
|
||||
|
||||
$fetcher --builder --url "$url" --out "$out" --rev "$rev" \
|
||||
${leaveDotGit:+--leave-dotGit} \
|
||||
${deepClone:+--deepClone} \
|
||||
${fetchSubmodules:+--fetch-submodules}
|
||||
|
||||
stopNest
|
||||
|
@ -1,5 +1,6 @@
|
||||
{stdenv, git, cacert}:
|
||||
{url, rev ? "HEAD", md5 ? "", sha256 ? "", leaveDotGit ? false, fetchSubmodules ? true
|
||||
{url, rev ? "HEAD", md5 ? "", sha256 ? "", leaveDotGit ? deepClone
|
||||
, fetchSubmodules ? true, deepClone ? false
|
||||
, name ? "git-export"
|
||||
}:
|
||||
|
||||
@ -26,6 +27,7 @@
|
||||
*/
|
||||
|
||||
assert md5 != "" || sha256 != "";
|
||||
assert deepClone -> leaveDotGit;
|
||||
|
||||
stdenv.mkDerivation {
|
||||
inherit name;
|
||||
@ -37,7 +39,7 @@ stdenv.mkDerivation {
|
||||
outputHashMode = "recursive";
|
||||
outputHash = if sha256 == "" then md5 else sha256;
|
||||
|
||||
inherit url rev leaveDotGit fetchSubmodules;
|
||||
inherit url rev leaveDotGit fetchSubmodules deepClone;
|
||||
|
||||
GIT_SSL_CAINFO = "${cacert}/etc/ca-bundle.crt";
|
||||
|
||||
@ -51,4 +53,3 @@ stdenv.mkDerivation {
|
||||
|
||||
preferLocalBuild = true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user