2015-04-01 17:02:07 +03:00
|
|
|
{stdenv, mercurial, nix}: {name ? null, url, rev ? null, md5 ? null, sha256 ? null, fetchSubrepos ? false}:
|
2007-09-04 16:45:00 +04:00
|
|
|
|
2009-11-14 23:14:21 +03:00
|
|
|
# TODO: statically check if mercurial as the https support if the url starts woth https.
|
2007-09-04 16:45:00 +04:00
|
|
|
stdenv.mkDerivation {
|
2012-12-28 22:54:15 +04:00
|
|
|
name = "hg-archive" + (if name != null then "-${name}" else "");
|
2007-09-04 16:45:00 +04:00
|
|
|
builder = ./builder.sh;
|
2012-08-24 19:10:23 +04:00
|
|
|
buildInputs = [mercurial];
|
2007-09-04 16:45:00 +04:00
|
|
|
|
2015-04-28 23:35:39 +03:00
|
|
|
impureEnvVars = [
|
|
|
|
"http_proxy" "https_proxy" "ftp_proxy" "all_proxy" "no_proxy"
|
|
|
|
];
|
|
|
|
|
2007-09-04 16:45:00 +04:00
|
|
|
# Nix <= 0.7 compatibility.
|
|
|
|
id = md5;
|
|
|
|
|
2015-04-01 17:02:07 +03:00
|
|
|
subrepoClause = if fetchSubrepos then "S" else "";
|
|
|
|
|
2012-12-28 22:54:15 +04:00
|
|
|
outputHashAlgo = if md5 != null then "md5" else "sha256";
|
2007-09-04 16:45:00 +04:00
|
|
|
outputHashMode = "recursive";
|
2012-12-28 22:54:15 +04:00
|
|
|
outputHash = if md5 != null then md5 else sha256;
|
2015-04-28 23:35:39 +03:00
|
|
|
|
2014-06-28 22:33:28 +04:00
|
|
|
inherit url rev;
|
2012-01-10 10:41:44 +04:00
|
|
|
preferLocalBuild = true;
|
2007-09-04 16:45:00 +04:00
|
|
|
}
|