-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ]; | ||
}; | ||
} |