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