diff options
author | Jörg Thalheim <joerg@thalheim.io> | 2019-12-21 20:52:55 +0000 |
---|---|---|
committer | Jörg Thalheim <joerg@thalheim.io> | 2019-12-21 22:55:43 +0000 |
commit | a446ac2bb094a9bf61b5489983f5ebb6c0e5f36b (patch) | |
tree | f155163002d4551ddfa0ce7e105fb6d6224867eb /pkgs/servers | |
parent | 2a60519881cb43bf96b6daa31c62c9e58751513c (diff) | |
download | nixpkgs-a446ac2bb094a9bf61b5489983f5ebb6c0e5f36b.tar nixpkgs-a446ac2bb094a9bf61b5489983f5ebb6c0e5f36b.tar.gz nixpkgs-a446ac2bb094a9bf61b5489983f5ebb6c0e5f36b.tar.bz2 nixpkgs-a446ac2bb094a9bf61b5489983f5ebb6c0e5f36b.tar.lz nixpkgs-a446ac2bb094a9bf61b5489983f5ebb6c0e5f36b.tar.xz nixpkgs-a446ac2bb094a9bf61b5489983f5ebb6c0e5f36b.tar.zst nixpkgs-a446ac2bb094a9bf61b5489983f5ebb6c0e5f36b.zip |
net-snmp: add multiple outputs to reduce closure size
Diffstat (limited to 'pkgs/servers')
-rw-r--r-- | pkgs/servers/monitoring/net-snmp/default.nix | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/pkgs/servers/monitoring/net-snmp/default.nix b/pkgs/servers/monitoring/net-snmp/default.nix index 2bbab30d9ec..ed2abbc7fc8 100644 --- a/pkgs/servers/monitoring/net-snmp/default.nix +++ b/pkgs/servers/monitoring/net-snmp/default.nix @@ -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; { |