2021-01-25 08:26:54 +00:00
|
|
|
{ lib
|
2020-08-17 08:39:20 +00:00
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, go-md2man
|
|
|
|
, installShellFiles
|
|
|
|
, pkg-config
|
2020-09-01 07:44:55 +00:00
|
|
|
, bcc
|
|
|
|
, libseccomp
|
2020-08-17 08:39:20 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "oci-seccomp-bpf-hook";
|
2021-04-27 13:13:40 +00:00
|
|
|
version = "1.2.3";
|
2020-08-17 08:39:20 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "containers";
|
|
|
|
repo = "oci-seccomp-bpf-hook";
|
|
|
|
rev = "v${version}";
|
2021-04-27 13:13:40 +00:00
|
|
|
sha256 = "sha256-EKD6tkdQCPlVlb9ScvRwDxYAtbbv9PIqBHH6SvtPDsE=";
|
2020-08-17 08:39:20 +00:00
|
|
|
};
|
|
|
|
vendorSha256 = null;
|
|
|
|
|
|
|
|
outputs = [ "out" "man" ];
|
|
|
|
nativeBuildInputs = [
|
|
|
|
go-md2man
|
|
|
|
installShellFiles
|
|
|
|
pkg-config
|
|
|
|
];
|
|
|
|
buildInputs = [
|
2020-09-01 07:44:55 +00:00
|
|
|
bcc
|
2020-08-17 08:39:20 +00:00
|
|
|
libseccomp
|
|
|
|
];
|
|
|
|
|
2021-01-27 12:55:59 +00:00
|
|
|
checkPhase = ''
|
|
|
|
go test -v ./...
|
|
|
|
'';
|
|
|
|
|
2020-08-17 08:39:20 +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-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-08-17 08:39:20 +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;
|
|
|
|
};
|
|
|
|
}
|