net-snmp: add multiple outputs to reduce closure size

This commit is contained in:
Jörg Thalheim 2019-12-21 20:52:55 +00:00
parent 2a60519881
commit a446ac2bb0
No known key found for this signature in database
GPG key ID: B3F5D81B0C6967C4

View file

@ -1,4 +1,5 @@
{ stdenv, fetchurl, fetchpatch, autoreconfHook, file, openssl, perl, perlPackages, unzip, nettools, ncurses }:
{ stdenv, fetchurl, fetchpatch, autoreconfHook, removeReferencesTo
, file, openssl, perl, perlPackages, unzip, nettools, ncurses }:
stdenv.mkDerivation rec {
name = "net-snmp-5.8";
@ -19,6 +20,8 @@ stdenv.mkDerivation rec {
./0002-autoconf-version.patch
];
outputs = [ "bin" "out" "dev" "lib" ];
configureFlags =
[ "--with-default-snmp-version=3"
"--with-sys-location=Unknown"
@ -34,17 +37,21 @@ stdenv.mkDerivation rec {
substituteInPlace testing/fulltests/support/simple_TESTCONF.sh --replace "/bin/netstat" "${nettools}/bin/netstat"
'';
nativeBuildInputs = [ autoreconfHook nettools ];
buildInputs = [ file perl unzip openssl ncurses ];
propagatedBuildInputs = with perlPackages; [ perl JSON Tk TermReadKey ];
nativeBuildInputs = [ autoreconfHook nettools removeReferencesTo ];
buildInputs = with perlPackages; [ file perl unzip openssl ncurses JSON Tk TermReadKey ];
enableParallelBuilding = true;
doCheck = false; # tries to use networking
postInstall = ''
for f in "$out/lib/"*.la $out/bin/net-snmp-config $out/bin/net-snmp-create-v3-user; do
for f in "$lib/lib/"*.la $bin/bin/net-snmp-config $bin/bin/net-snmp-create-v3-user; do
sed 's|-L${openssl.dev}|-L${openssl.out}|g' -i $f
done
mkdir $dev/bin
mv $bin/bin/net-snmp-config $dev/bin
# libraries contain configure options
find $lib/lib -type f -exec remove-references-to -t $bin '{}' +
find $lib/lib -type f -exec remove-references-to -t $dev '{}' +
'';
meta = with stdenv.lib; {