2016-05-11 20:50:49 +00:00
|
|
|
{ stdenv, nss, curl, perl }:
|
2010-01-20 14:10:26 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2015-05-29 20:51:55 +00:00
|
|
|
name = "nss-cacert-${nss.version}";
|
2010-01-20 14:10:26 +00:00
|
|
|
|
2015-05-29 20:51:55 +00:00
|
|
|
src = nss.src;
|
|
|
|
|
|
|
|
postPatch = ''
|
2015-06-02 09:33:56 +00:00
|
|
|
unpackFile ${curl.src};
|
2016-05-11 20:50:49 +00:00
|
|
|
|
|
|
|
# Remove dependency on LWP, curl is enough. Also, since curl here
|
|
|
|
# is working on a local file it will not actually get a 200 OK, so
|
|
|
|
# remove that expectation.
|
|
|
|
substituteInPlace curl-*/lib/mk-ca-bundle.pl \
|
|
|
|
--replace 'use LWP::UserAgent;' "" \
|
|
|
|
--replace ' && $out[0] == 200' ""
|
2015-05-29 20:51:55 +00:00
|
|
|
'';
|
|
|
|
|
2016-05-11 20:50:49 +00:00
|
|
|
nativeBuildInputs = [ curl perl ];
|
2010-01-20 14:10:26 +00:00
|
|
|
|
2015-05-29 20:51:55 +00:00
|
|
|
buildPhase = ''
|
|
|
|
perl curl-*/lib/mk-ca-bundle.pl -d "file://$(pwd)/nss/lib/ckfw/builtins/certdata.txt" ca-bundle.crt
|
|
|
|
'';
|
2010-01-20 14:10:26 +00:00
|
|
|
|
2015-05-29 20:51:55 +00:00
|
|
|
installPhase = ''
|
2015-06-05 20:00:52 +00:00
|
|
|
mkdir -pv $out/etc/ssl/certs
|
|
|
|
cp -v ca-bundle.crt $out/etc/ssl/certs
|
2015-05-29 20:51:55 +00:00
|
|
|
'';
|
2010-01-20 14:10:26 +00:00
|
|
|
|
2015-05-29 20:51:55 +00:00
|
|
|
meta = with stdenv.lib; {
|
2010-01-20 14:10:26 +00:00
|
|
|
homepage = http://curl.haxx.se/docs/caextract.html;
|
|
|
|
description = "A bundle of X.509 certificates of public Certificate Authorities (CA)";
|
2015-05-29 20:51:55 +00:00
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = with maintainers; [ wkennington ];
|
2010-01-20 14:10:26 +00:00
|
|
|
};
|
|
|
|
}
|