2010-06-12 12:21:20 +01:00
|
|
|
{stdenv, mercurial, nix}: {name ? null, url, tag ? null, md5 ? null, sha256 ? null}:
|
2007-09-04 13:45:00 +01:00
|
|
|
|
2009-11-14 20:14:21 +00:00
|
|
|
# TODO: statically check if mercurial as the https support if the url starts woth https.
|
2007-09-04 13:45:00 +01:00
|
|
|
stdenv.mkDerivation {
|
2010-06-12 12:21:20 +01:00
|
|
|
name = "fetchhg" + (if (name != null) then "-${name}" else "");
|
2007-09-04 13:45:00 +01:00
|
|
|
builder = ./builder.sh;
|
|
|
|
buildInputs = [mercurial nix];
|
|
|
|
|
|
|
|
# Nix <= 0.7 compatibility.
|
|
|
|
id = md5;
|
|
|
|
|
2010-06-12 12:21:20 +01:00
|
|
|
outputHashAlgo = if (md5 != null) then "md5" else "sha256";
|
2007-09-04 13:45:00 +01:00
|
|
|
outputHashMode = "recursive";
|
2010-06-12 12:21:20 +01:00
|
|
|
outputHash = if (md5 != null) then md5 else sha256;
|
2007-09-04 13:45:00 +01:00
|
|
|
|
|
|
|
inherit url tag;
|
|
|
|
}
|