2018-12-04 05:54:13 -08:00
|
|
|
{ stdenv, fetchurl, flex, bison }:
|
2005-11-03 11:41:36 -08:00
|
|
|
|
2008-09-01 06:00:24 -07:00
|
|
|
stdenv.mkDerivation rec {
|
2018-12-04 05:54:13 -08:00
|
|
|
name = "libpcap-1.9.0";
|
2017-01-21 16:43:07 -08:00
|
|
|
|
2005-11-03 11:41:36 -08:00
|
|
|
src = fetchurl {
|
2018-06-28 11:43:35 -07:00
|
|
|
url = "https://www.tcpdump.org/release/${name}.tar.gz";
|
2018-12-04 05:54:13 -08:00
|
|
|
sha256 = "06bhydl4vr4z9c3vahl76f2j96z1fbrcl7wwismgs4sris08inrf";
|
2005-11-03 11:41:36 -08:00
|
|
|
};
|
2017-01-21 16:43:07 -08:00
|
|
|
|
2012-12-28 10:20:09 -08:00
|
|
|
nativeBuildInputs = [ flex bison ];
|
2017-01-21 16:43:07 -08:00
|
|
|
|
2014-10-28 14:29:05 -07:00
|
|
|
# We need to force the autodetection because detection doesn't
|
|
|
|
# work in pure build enviroments.
|
2018-05-10 09:55:36 -07:00
|
|
|
configureFlags = [
|
|
|
|
("--with-pcap=" + {
|
|
|
|
linux = "linux";
|
|
|
|
darwin = "bpf";
|
|
|
|
}.${stdenv.hostPlatform.parsed.kernel.name})
|
|
|
|
] ++ stdenv.lib.optionals (stdenv.hostPlatform == stdenv.buildPlatform) [
|
|
|
|
"ac_cv_linux_vers=2"
|
|
|
|
];
|
|
|
|
|
|
|
|
dontStrip = stdenv.hostPlatform != stdenv.buildPlatform;
|
2009-02-12 12:28:01 -08:00
|
|
|
|
2015-07-23 15:47:16 -07:00
|
|
|
prePatch = stdenv.lib.optionalString stdenv.isDarwin ''
|
|
|
|
substituteInPlace configure --replace " -arch i386" ""
|
|
|
|
'';
|
|
|
|
|
2012-01-18 12:16:00 -08:00
|
|
|
preInstall = ''mkdir -p $out/bin'';
|
2017-01-21 16:43:07 -08:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2018-12-04 05:54:13 -08:00
|
|
|
homepage = https://www.tcpdump.org;
|
2010-09-15 05:57:49 -07:00
|
|
|
description = "Packet Capture Library";
|
2017-01-21 16:43:07 -08:00
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ fpletz ];
|
2018-10-18 12:33:10 -07:00
|
|
|
license = licenses.bsd3;
|
2010-09-15 05:57:49 -07:00
|
|
|
};
|
2005-11-03 11:41:36 -08:00
|
|
|
}
|