From 211f15a271fe2e300aef7daa688d5060ac41ea46 Mon Sep 17 00:00:00 2001 From: fbewivpjsbsby <132867585+fbewivpjsbsby@users.noreply.github.com> Date: Mon, 8 May 2023 13:35:03 +0800 Subject: [PATCH] phantomsocks: fix build tag Co-Authored-By: Sandro --- pkgs/tools/networking/phantomsocks/default.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkgs/tools/networking/phantomsocks/default.nix b/pkgs/tools/networking/phantomsocks/default.nix index fc8fef3a14b..6f3c3ad9a33 100644 --- a/pkgs/tools/networking/phantomsocks/default.nix +++ b/pkgs/tools/networking/phantomsocks/default.nix @@ -1,6 +1,11 @@ { lib , buildGoModule , fetchFromGitHub +, stdenv +, libpcap +# Cann't be build with both pcap and rawsocket tags +, withPcap ? (!stdenv.isLinux && !withRawsocket) +, withRawsocket ? (stdenv.isLinux && !withPcap) }: buildGoModule rec { @@ -16,6 +21,13 @@ buildGoModule rec { vendorHash = "sha256-c0NQfZuMMWz1ASwFBcpMNjxZwXLo++gMYBiNgvT8ZLQ="; + ldflags = [ + "-s" "-w" + ]; + buildInputs = lib.optional withPcap libpcap; + tags = lib.optional withPcap "pcap" + ++ lib.optional withRawsocket "rawsocket"; + meta = with lib;{ homepage = "https://github.com/macronut/phantomsocks"; description = "A cross-platform proxy client/server for Linux/Windows/macOS";