Skip to content

Commit

Permalink
bpfman: init at 0.5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
pizzapim committed Dec 29, 2024
1 parent 5fa8415 commit a30de30
Showing 1 changed file with 72 additions and 0 deletions.
72 changes: 72 additions & 0 deletions pkgs/by-name/bp/bpfman/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
lib,
rustPlatform,
fetchFromGitHub,
llvmPackages_12,
pkg-config,
openssl,
enableSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd,
installShellFiles,
stdenv,
systemd,
...
}:
rustPlatform.buildRustPackage rec {
pname = "bpfman";
version = "0.5.4";

src = fetchFromGitHub {
owner = "bpfman";
repo = "bpfman";
rev = "v${version}";
hash = "sha256-HD8Qdy7wvV2zGoPRLYZu+NpG28T5Q4WfLr5UnZB+bkg=";
};

useFetchCargoVendor = true;
cargoHash = "sha256-X9qSGSXRX8WEGKD4Wc2iRhmky1uGCspG8muyCsyeIiQ=";

nativeBuildInputs = [
llvmPackages_12.llvm
pkg-config
installShellFiles
];
buildInputs = [ openssl ];

postInstall =
''
compdir=./.output/completions
cargo xtask build-completion
installShellCompletion --cmd bpfman \
--bash $compdir/bpfman.bash \
--fish $compdir/bpfman.fish \
--fish $compdir/bpfman.elv
''
+ lib.optionalString enableSystemd ''
mkdir -p $out/lib/systemd/system
cp scripts/bpfman.socket $out/lib/systemd/system
substitute scripts/bpfman.service \
$out/lib/systemd/system/bpfman.service \
--replace /usr/sbin/bpfman-rpc $out/bin/bpfman-rpc
'';

checkFlags = [
# Tests needing network connectivity
"--skip=oci_utils::image_manager::tests::image_pull_and_bytecode_verify"
"--skip=oci_utils::image_manager::tests::image_pull_and_bytecode_verify_legacy"
"--skip=oci_utils::image_manager::tests::image_pull_failure"
"--skip=oci_utils::image_manager::tests::image_pull_policy_never_failure"
"--skip=oci_utils::image_manager::tests::private_image_pull_and_bytecode_verify"
];

meta = with lib; {
description = "An eBPF Manager for Linux and Kubernetes";
mainProgram = "bpfman";
homepage = "https://bpfman.io";
license = with licenses; [
asl20
bsd2
gpl2Only
];
maintainers = with maintainers; [ pizzapim ];
};
}

0 comments on commit a30de30

Please sign in to comment.