mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 14:54:29 +01:00
Made tcpdump crossbuild.
svn path=/nixpkgs/trunk/; revision=20543
This commit is contained in:
parent
5b7f1ef09a
commit
4a44d32444
3 changed files with 33 additions and 2 deletions
|
@ -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" ];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -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/;
|
||||
|
|
17
pkgs/tools/networking/tcpdump/disable-ipv6.patch
Normal file
17
pkgs/tools/networking/tcpdump/disable-ipv6.patch
Normal file
|
@ -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:
|
||||
|
Loading…
Reference in a new issue