nixpkgs/pkgs/build-support/fetchfossil/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

34 lines
750 B
Nix
Raw Normal View History

2023-02-06 20:49:02 +00:00
{stdenv, lib, fossil, cacert}:
2023-11-22 08:47:57 +00:00
{ name ? null
, url
, rev
, sha256 ? ""
, hash ? ""
}:
2023-11-22 08:47:57 +00:00
if hash != "" && sha256 != "" then
throw "Only one of sha256 or hash can be set"
else
stdenv.mkDerivation {
2023-02-06 20:49:02 +00:00
name = "fossil-archive" + (lib.optionalString (name != null) "-${name}");
builder = ./builder.sh;
nativeBuildInputs = [fossil cacert];
# Envvar docs are hard to find. A link for the future:
# https://www.fossil-scm.org/index.html/doc/trunk/www/env-opts.md
impureEnvVars = [ "http_proxy" ];
2023-11-22 08:47:57 +00:00
outputHashAlgo = if hash != "" then null else "sha256";
outputHashMode = "recursive";
2023-11-22 08:47:57 +00:00
outputHash = if hash != "" then
hash
else if sha256 != "" then
sha256
else
lib.fakeSha256;
inherit url rev;
preferLocalBuild = true;
}