diff --git a/pkgs/development/libraries/libpcap/default.nix b/pkgs/development/libraries/libpcap/default.nix index fbd73230d73..0b91460e8e3 100644 --- a/pkgs/development/libraries/libpcap/default.nix +++ b/pkgs/development/libraries/libpcap/default.nix @@ -8,11 +8,17 @@ stdenv.mkDerivation rec { sha256 = "1h3kmj485qz1i08xs4sc3a0bmhs1rvq0h7gycs7paap2szhw8552"; }; - buildInputs = [ flex bison ]; + buildNativeInputs = [ flex bison ]; configureFlags = "--with-pcap=linux"; preInstall = ''ensureDir $out/bin''; patches = [ ./libpcap_amd64.patch ]; + + crossAttrs = { + # Stripping hurts in static libraries + dontStrip = true; + configureFlags = [ "--with-pcap=linux" "ac_cv_linux_vers=2" ]; + }; } diff --git a/pkgs/tools/networking/tcpdump/default.nix b/pkgs/tools/networking/tcpdump/default.nix index b7b00599616..939bc400eae 100644 --- a/pkgs/tools/networking/tcpdump/default.nix +++ b/pkgs/tools/networking/tcpdump/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, libpcap }: +{ stdenv, fetchurl, libpcap, enableStatic ? false }: stdenv.mkDerivation rec { name = "tcpdump-4.0.0"; @@ -10,6 +10,14 @@ stdenv.mkDerivation rec { buildInputs = [ libpcap ]; + patches = [ ./disable-ipv6.patch ]; + + crossAttrs = { + LDFLAGS = if enableStatic then "-static" else ""; + configureFlags = [ "ac_cv_linux_vers=2" ] ++ (stdenv.lib.optional + (stdenv.cross.platform.kernelMajor == "2.4") "--disable-ipv6"); + }; + meta = { description = "tcpdump, a famous network sniffer"; homepage = http://www.tcpdump.org/; diff --git a/pkgs/tools/networking/tcpdump/disable-ipv6.patch b/pkgs/tools/networking/tcpdump/disable-ipv6.patch new file mode 100644 index 00000000000..0c869369faa --- /dev/null +++ b/pkgs/tools/networking/tcpdump/disable-ipv6.patch @@ -0,0 +1,17 @@ +Needed for proper building with ipv6 disabled +http://marc.info/?l=tcpdump-workers&m=122606195828825&w=2 +--- a/print-enc.c 2008-11-04 16:24:30 +0000 ++++ b/print-enc.c 2008-11-04 16:45:04 +0000 +@@ -77,9 +77,11 @@ + case AF_INET: + ip_print(gndo, p, length); + break; ++#ifdef INET6 + case AF_INET6: + ip6_print(p, length); + break; ++#endif /*INET6*/ + } + + out: +