2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
2020-09-25 04:45:31 +00:00
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, go-md2man
|
|
|
|
, installShellFiles
|
|
|
|
, pkg-config
|
|
|
|
, bcc
|
|
|
|
, libseccomp
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "oci-seccomp-bpf-hook";
|
2021-04-22 02:08:21 +00:00
|
|
|
version = "1.2.2";
|
2020-09-25 04:45:31 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "containers";
|
|
|
|
repo = "oci-seccomp-bpf-hook";
|
|
|
|
rev = "v${version}";
|
2021-04-22 02:08:21 +00:00
|
|
|
sha256 = "sha256-SRphs8zwKz6jlAixVZkHdww0jroaBNK82kSLj1gs6Wg=";
|
2020-09-25 04:45:31 +00:00
|
|
|
};
|
|
|
|
vendorSha256 = null;
|
|
|
|
|
|
|
|
outputs = [ "out" "man" ];
|
|
|
|
nativeBuildInputs = [
|
|
|
|
go-md2man
|
|
|
|
installShellFiles
|
|
|
|
pkg-config
|
|
|
|
];
|
|
|
|
buildInputs = [
|
|
|
|
bcc
|
|
|
|
libseccomp
|
|
|
|
];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
checkPhase = ''
|
|
|
|
go test -v ./...
|
|
|
|
'';
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
buildPhase = ''
|
|
|
|
make
|
|
|
|
'';
|
|
|
|
|
|
|
|
postBuild = ''
|
|
|
|
substituteInPlace oci-seccomp-bpf-hook.json --replace HOOK_BIN_DIR "$out/bin"
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
install -Dm755 bin/* -t $out/bin
|
|
|
|
install -Dm644 oci-seccomp-bpf-hook.json -t $out
|
|
|
|
installManPage docs/*.[1-9]
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-09-25 04:45:31 +00:00
|
|
|
homepage = "https://github.com/containers/oci-seccomp-bpf-hook";
|
|
|
|
description = ''
|
|
|
|
OCI hook to trace syscalls and generate a seccomp profile
|
|
|
|
'';
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ saschagrunert ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
badPlatforms = [ "aarch64-linux" ];
|
|
|
|
};
|
|
|
|
}
|