Commit 5e6e3520 authored by fridtjof's avatar fridtjof
Browse files

net-snmp: darwin support

The autotools files shipped in the source tarball did not want to link, so I added autoreconfHook to just remake them.
parent cbfd4704
Loading
Loading
Loading
Loading
+12 −4
Original line number Diff line number Diff line
{ lib, stdenv, fetchurl
, file, openssl, perl, nettools
, withPerlTools ? false }: let
, autoreconfHook
, withPerlTools ? false
, darwin }: let

  perlWithPkgs = perl.withPackages (ps: with ps; [
    JSON
@@ -52,9 +54,15 @@ in stdenv.mkDerivation rec {
      -e "/NETSNMP_CONFIGURE_OPTIONS/ s|$NIX_STORE/[a-z0-9]\{32\}-|$NIX_STORE/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-|g"
  '';

  nativeBuildInputs = [ nettools file ];
  nativeBuildInputs = [ nettools file autoreconfHook ];
  buildInputs = [ openssl ]
    ++ lib.optional withPerlTools perlWithPkgs;
    ++ lib.optional withPerlTools perlWithPkgs
    ++ lib.optionals stdenv.isDarwin [
      darwin.apple_sdk.frameworks.ApplicationServices
      darwin.apple_sdk.frameworks.CoreServices
      darwin.apple_sdk.frameworks.IOKit
      darwin.apple_sdk.frameworks.DiskArbitration
    ];

  enableParallelBuilding = true;
  # Missing dependencies during relinking:
@@ -74,6 +82,6 @@ in stdenv.mkDerivation rec {
    description = "Clients and server for the SNMP network monitoring protocol";
    homepage = "http://www.net-snmp.org/";
    license = licenses.bsd3;
    platforms = platforms.linux;
    platforms = platforms.unix;
  };
}