mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-18 02:46:28 +00:00
287d6d5d3a
...instead of just for i686-linux. Without a --with-pcap= configure flag, the build system tries to auto-detect the backend by poking in /dev, /usr/include etc... In the pure nix world, this auto-detection fails. (Good, we don't want host details to leak into the build.) The end result of this (failed) auto-detection; no packet capture possible: $ sudo tcpdump -i wlp2s0 tcpdump: live packet capture not supported on this system This fixes the above issue on 64-bit linux systems, and probably other architectures supported by linux.
28 lines
658 B
Nix
28 lines
658 B
Nix
{ stdenv, fetchurl, flex, bison }:
|
|
|
|
stdenv.mkDerivation rec {
|
|
name = "libpcap-1.5.3";
|
|
|
|
src = fetchurl {
|
|
url = "http://www.tcpdump.org/release/${name}.tar.gz";
|
|
sha256 = "14wyjywrdi1ikaj6yc9c72m6m2r64z94lb0gm7k1a3q6q5cj3scs";
|
|
};
|
|
|
|
nativeBuildInputs = [ flex bison ];
|
|
|
|
configureFlags = stdenv.lib.optionals stdenv.isLinux "--with-pcap=linux";
|
|
|
|
preInstall = ''mkdir -p $out/bin'';
|
|
|
|
crossAttrs = {
|
|
# Stripping hurts in static libraries
|
|
dontStrip = true;
|
|
configureFlags = configureFlags ++ [ "ac_cv_linux_vers=2" ];
|
|
};
|
|
|
|
meta = {
|
|
homepage = http://www.tcpdump.org;
|
|
description = "Packet Capture Library";
|
|
};
|
|
}
|