2023-02-16 17:41:37 +00:00
|
|
|
{stdenv, lib, fossil, cacert}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
{ name ? null
|
|
|
|
, url
|
|
|
|
, rev
|
|
|
|
, sha256 ? ""
|
|
|
|
, hash ? ""
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
if hash != "" && sha256 != "" then
|
|
|
|
throw "Only one of sha256 or hash can be set"
|
|
|
|
else
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation {
|
2023-02-16 17:41:37 +00:00
|
|
|
name = "fossil-archive" + (lib.optionalString (name != null) "-${name}");
|
2020-04-24 23:36:52 +00:00
|
|
|
builder = ./builder.sh;
|
2020-11-30 08:33:03 +00:00
|
|
|
nativeBuildInputs = [fossil cacert];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# 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" ];
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
outputHashAlgo = if hash != "" then null else "sha256";
|
2020-04-24 23:36:52 +00:00
|
|
|
outputHashMode = "recursive";
|
2024-01-02 11:29:13 +00:00
|
|
|
outputHash = if hash != "" then
|
|
|
|
hash
|
|
|
|
else if sha256 != "" then
|
|
|
|
sha256
|
|
|
|
else
|
|
|
|
lib.fakeSha256;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
inherit url rev;
|
|
|
|
preferLocalBuild = true;
|
|
|
|
}
|