nixpkgs/pkgs/development/libraries/libpcap/default.nix
Bjørn Forsman 287d6d5d3a libpcap: pass --with-pcap=linux for all linux systems
...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.
2014-10-16 20:32:28 +02:00

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";
};
}