nixpkgs/pkgs/build-support/fetchhg/default.nix
Eelco Dolstra e3a873479e
Remove fetchMD5warn
Deprecation warnings should not be used in Nixpkgs because they spam
innocent "nix-env -qa" users with (in this case) dozens of messages
that they can't do anything about.

This also reverts commit 2ca883338389b7ab995924a0cab0211993bdf1da.
2016-11-30 15:14:30 +01:00

23 lines
692 B
Nix

{stdenv, mercurial, nix}: {name ? null, url, rev ? null, md5 ? null, sha256 ? null, fetchSubrepos ? false}:
# TODO: statically check if mercurial as the https support if the url starts woth https.
stdenv.mkDerivation {
name = "hg-archive" + (if name != null then "-${name}" else "");
builder = ./builder.sh;
buildInputs = [mercurial];
impureEnvVars = stdenv.lib.fetchers.proxyImpureEnvVars;
# Nix <= 0.7 compatibility.
id = md5;
subrepoClause = if fetchSubrepos then "S" else "";
outputHashAlgo = if md5 != null then "md5" else "sha256";
outputHashMode = "recursive";
outputHash = if md5 != null then md5 else sha256;
inherit url rev;
preferLocalBuild = true;
}