From 6767a2c0345107689aa69aaeb62ea9f5a2d33660 Mon Sep 17 00:00:00 2001 From: Ingo Blechschmidt Date: Sun, 21 Jun 2020 13:18:10 +0200 Subject: [PATCH 1/2] libpcap: don't remove static library --- pkgs/development/libraries/libpcap/default.nix | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pkgs/development/libraries/libpcap/default.nix b/pkgs/development/libraries/libpcap/default.nix index d9cb91e4fb3..882ec992580 100644 --- a/pkgs/development/libraries/libpcap/default.nix +++ b/pkgs/development/libraries/libpcap/default.nix @@ -28,10 +28,6 @@ stdenv.mkDerivation rec { substituteInPlace configure --replace " -arch i386" "" ''; - postInstall = '' - rm -f $out/lib/libpcap.a - ''; - meta = { homepage = "https://www.tcpdump.org"; description = "Packet Capture Library"; From ec84e89e58477833824ab022bb9d389bd56c590c Mon Sep 17 00:00:00 2001 From: Ingo Blechschmidt Date: Sun, 21 Jun 2020 15:06:55 +0200 Subject: [PATCH 2/2] libpcap: remove static library unless dontDisableStatic is set --- pkgs/development/libraries/libpcap/default.nix | 6 ++++++ pkgs/tools/networking/dsniff/default.nix | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/libpcap/default.nix b/pkgs/development/libraries/libpcap/default.nix index 882ec992580..fcb599e00f5 100644 --- a/pkgs/development/libraries/libpcap/default.nix +++ b/pkgs/development/libraries/libpcap/default.nix @@ -28,6 +28,12 @@ stdenv.mkDerivation rec { substituteInPlace configure --replace " -arch i386" "" ''; + postInstall = '' + if [ "$dontDisableStatic" -ne "1" ]; then + rm -f $out/lib/libpcap.a + fi + ''; + meta = { homepage = "https://www.tcpdump.org"; description = "Packet Capture Library"; diff --git a/pkgs/tools/networking/dsniff/default.nix b/pkgs/tools/networking/dsniff/default.nix index 4fe381cdd7a..50de41b921c 100644 --- a/pkgs/tools/networking/dsniff/default.nix +++ b/pkgs/tools/networking/dsniff/default.nix @@ -14,7 +14,7 @@ let }; pcap = symlinkJoin { inherit (libpcap) name; - paths = [ libpcap ]; + paths = [ (libpcap.overrideAttrs(old: { dontDisableStatic = true; })) ]; postBuild = '' cp -rs $out/include/pcap $out/include/net # prevent references to libpcap