summary refs log tree commit diff
path: root/pkgs/development/libraries/libpcap
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2018-05-10 12:55:36 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2018-05-10 14:18:14 -0400
commit48300199566229bd1409eb8f1f2cf8b8871d6b67 (patch)
tree56968c1af9afb87b49b3ac97863485f7534b6ef1 /pkgs/development/libraries/libpcap
parent1080e264fb19f55e5c20edb0fad744ff2366c3dc (diff)
downloadnixpkgs-48300199566229bd1409eb8f1f2cf8b8871d6b67.tar
nixpkgs-48300199566229bd1409eb8f1f2cf8b8871d6b67.tar.gz
nixpkgs-48300199566229bd1409eb8f1f2cf8b8871d6b67.tar.bz2
nixpkgs-48300199566229bd1409eb8f1f2cf8b8871d6b67.tar.lz
nixpkgs-48300199566229bd1409eb8f1f2cf8b8871d6b67.tar.xz
nixpkgs-48300199566229bd1409eb8f1f2cf8b8871d6b67.tar.zst
nixpkgs-48300199566229bd1409eb8f1f2cf8b8871d6b67.zip
libpcap: Remove crossAttrs
Diffstat (limited to 'pkgs/development/libraries/libpcap')
-rw-r--r--pkgs/development/libraries/libpcap/default.nix20
1 files changed, 10 insertions, 10 deletions
diff --git a/pkgs/development/libraries/libpcap/default.nix b/pkgs/development/libraries/libpcap/default.nix
index bef5f9a9da3..94555438693 100644
--- a/pkgs/development/libraries/libpcap/default.nix
+++ b/pkgs/development/libraries/libpcap/default.nix
@@ -12,10 +12,16 @@ stdenv.mkDerivation rec {
 
   # We need to force the autodetection because detection doesn't
   # work in pure build enviroments.
-  configureFlags =
-    if stdenv.isLinux then [ "--with-pcap=linux" ]
-    else if stdenv.isDarwin then [ "--with-pcap=bpf" ]
-    else [];
+  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;
 
   prePatch = stdenv.lib.optionalString stdenv.isDarwin ''
     substituteInPlace configure --replace " -arch i386" ""
@@ -39,12 +45,6 @@ stdenv.mkDerivation rec {
 
   preInstall = ''mkdir -p $out/bin'';
 
-  crossAttrs = {
-    # Stripping hurts in static libraries
-    dontStrip = true;
-    configureFlags = configureFlags ++ [ "ac_cv_linux_vers=2" ];
-  };
-
   meta = with stdenv.lib; {
     homepage = http://www.tcpdump.org;
     description = "Packet Capture Library";