cacert: remove dependency on LWP

The `mk-ca-bundle.pl` script manages quite well using only curl but
fails without LWP being present due to a `use` statement. This removes
the Perl import of the LWP library and adds curl as a build input.
This commit is contained in:
Robert Helgesson 2016-05-11 22:50:49 +02:00
parent e68191e6c4
commit 96fc1e19b8

View File

@ -1,4 +1,4 @@
{ stdenv, nss, curl, perl, perlPackages }: { stdenv, nss, curl, perl }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "nss-cacert-${nss.version}"; name = "nss-cacert-${nss.version}";
@ -7,9 +7,16 @@ stdenv.mkDerivation rec {
postPatch = '' postPatch = ''
unpackFile ${curl.src}; unpackFile ${curl.src};
# 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' ""
''; '';
nativeBuildInputs = [ perl perlPackages.LWP ]; nativeBuildInputs = [ curl perl ];
buildPhase = '' buildPhase = ''
perl curl-*/lib/mk-ca-bundle.pl -d "file://$(pwd)/nss/lib/ckfw/builtins/certdata.txt" ca-bundle.crt perl curl-*/lib/mk-ca-bundle.pl -d "file://$(pwd)/nss/lib/ckfw/builtins/certdata.txt" ca-bundle.crt