nixpkgs/pkgs/by-name/oc/oci-seccomp-bpf-hook/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

62 lines
1.2 KiB
Nix

{ lib
, buildGoModule
, fetchFromGitHub
, go-md2man
, installShellFiles
, pkg-config
, bcc
, libseccomp
}:
buildGoModule rec {
pname = "oci-seccomp-bpf-hook";
version = "1.2.10";
src = fetchFromGitHub {
owner = "containers";
repo = "oci-seccomp-bpf-hook";
rev = "v${version}";
sha256 = "sha256-bWlm+JYNf7+faKSQfW5fhxoH/D2I8ujjakswH+1r49o=";
};
vendorHash = null;
outputs = [ "out" "man" ];
nativeBuildInputs = [
go-md2man
installShellFiles
pkg-config
];
buildInputs = [
bcc
libseccomp
];
checkPhase = ''
go test -v ./...
'';
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]
'';
meta = with lib; {
homepage = "https://github.com/containers/oci-seccomp-bpf-hook";
description = ''
OCI hook to trace syscalls and generate a seccomp profile
'';
mainProgram = "oci-seccomp-bpf-hook";
license = licenses.asl20;
maintainers = with maintainers; [ saschagrunert ];
platforms = platforms.linux;
};
}