depot/third_party/nixpkgs/pkgs/tools/networking/dae/default.nix
Default email fa5436e0a7 Project import generated by Copybara.
GitOrigin-RevId: e8057b67ebf307f01bdcc8fba94d94f75039d1f6
2024-06-05 17:53:02 +02:00

54 lines
1.3 KiB
Nix

{ lib
, clang
, fetchFromGitHub
, buildGoModule
}:
buildGoModule rec {
pname = "dae";
version = "0.6.0rc2";
src = fetchFromGitHub {
owner = "daeuniverse";
repo = "dae";
rev = "v${version}";
hash = "sha256-u+1DkcdXXm/wmKG7yu8nv3OOeG/l5KC+9UcIrYOmsUA=";
fetchSubmodules = true;
};
vendorHash = "sha256-jJbXa3xnQXhEhrhmdi+JqdinLuRrFY5Tb9lsnCancFE=";
proxyVendor = true;
nativeBuildInputs = [ clang ];
ldflags = [
"-s"
"-w"
"-X github.com/daeuniverse/dae/cmd.Version=${version}"
"-X github.com/daeuniverse/dae/common/consts.MaxMatchSetLen_=64"
];
preBuild = ''
make CFLAGS="-D__REMOVE_BPF_PRINTK -fno-stack-protector -Wno-unused-command-line-argument" \
NOSTRIP=y \
ebpf
'';
# network required
doCheck = false;
postInstall = ''
install -Dm444 install/dae.service $out/lib/systemd/system/dae.service
substituteInPlace $out/lib/systemd/system/dae.service \
--replace /usr/bin/dae $out/bin/dae
'';
meta = with lib; {
description = "A Linux high-performance transparent proxy solution based on eBPF";
homepage = "https://github.com/daeuniverse/dae";
license = licenses.agpl3Only;
maintainers = with maintainers; [ oluceps pokon548 ];
platforms = platforms.linux;
mainProgram = "dae";
};
}