3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/build-support/fetchdarcs/default.nix
Joe Hermaszewski a81f45386b fetchdarcs: Use NIX_SSL_CERT_FILE
`SSL_CERT_FILE` has been replaced with `NIX_SSL_CERT_FILE`.

Before this change using `fetchdarcs` resulted in an error message like:

```
Identifying repository http://hub.darcs.net/scravy/easyplot inventory

darcs failed:  Not a repository: http://hub.darcs.net/scravy/easyplot (Peer certificate cannot be authenticated with given CA certificates)

HINT: Do you have the right URI for the repository?

builder for ‘/nix/store/imyvcs6lvb5yva66krc5wk39931sam8v-fetchdarcs.drv’ failed with exit code 2
```
2017-06-03 20:35:37 +01:00

20 lines
456 B
Nix

{stdenv, darcs, nix, cacert}:
{url, rev ? null, context ? null, md5 ? "", sha256 ? ""}:
if md5 != "" then
throw "fetchdarcs does not support md5 anymore, please use sha256"
else
stdenv.mkDerivation {
name = "fetchdarcs";
NIX_SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
builder = ./builder.sh;
buildInputs = [darcs];
outputHashAlgo = "sha256";
outputHashMode = "recursive";
outputHash = sha256;
inherit url rev context;
}