nixpkgs/pkgs/development/libraries/libpcap/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

52 lines
1.2 KiB
Nix
Raw Normal View History

2023-01-21 17:51:23 +00:00
{ lib
, stdenv
, fetchurl
, flex
, bison
, bluez
, libxcrypt
, pkg-config
, withBluez ? false
, withRemote ? false
}:
stdenv.mkDerivation rec {
pname = "libpcap";
2021-06-16 11:32:22 +00:00
version = "1.10.1";
2017-01-22 00:43:07 +00:00
src = fetchurl {
url = "https://www.tcpdump.org/release/${pname}-${version}.tar.gz";
2021-06-16 11:32:22 +00:00
sha256 = "sha256-7ShfSsyvBTRPkJdXV7Pb/ncrpB0cQBwmSLf6RbcRvdQ=";
};
2017-01-22 00:43:07 +00:00
buildInputs = lib.optionals withRemote [ libxcrypt ];
2023-01-21 17:51:23 +00:00
nativeBuildInputs = [ flex bison ]
++ lib.optionals withBluez [ bluez.dev pkg-config ];
2017-01-22 00:43:07 +00:00
2014-10-28 21:29:05 +00:00
# We need to force the autodetection because detection doesn't
2020-07-27 09:50:08 +00:00
# work in pure build environments.
2018-05-10 16:55:36 +00:00
configureFlags = [
2021-04-18 11:16:54 +00:00
"--with-pcap=${if stdenv.isLinux then "linux" else "bpf"}"
] ++ lib.optionals stdenv.isDarwin [
"--disable-universal"
] ++ lib.optionals withRemote [
2023-01-21 17:51:23 +00:00
"--enable-remote"
] ++ lib.optionals (stdenv.hostPlatform == stdenv.buildPlatform)
[ "ac_cv_linux_vers=2" ];
2018-05-10 16:55:36 +00:00
postInstall = ''
if [ "$dontDisableStatic" -ne "1" ]; then
rm -f $out/lib/libpcap.a
fi
'';
meta = with lib; {
homepage = "https://www.tcpdump.org";
description = "Packet Capture Library";
2017-01-22 00:43:07 +00:00
platforms = platforms.unix;
maintainers = with maintainers; [ fpletz ];
2018-10-18 19:33:10 +00:00
license = licenses.bsd3;
};
}