nixpkgs/pkgs/tools/system/minijail/tools.nix
Alexis Hildebrandt 755b915a15 treewide: Remove indefinite article from meta.description
nix run nixpkgs#silver-searcher -- -G '\.nix$' -0l 'description.*"[Aa]n?' pkgs \
  | xargs -0 nix run nixpkgs#gnused -- -i '' -Ee 's/(description.*")[Aa]n? (.)/\1\U\2/'
2024-06-09 23:07:45 +02:00

41 lines
1.1 KiB
Nix

{ lib, buildPythonApplication, pkgsBuildTarget, python, minijail }:
let
targetClang = pkgsBuildTarget.targetPackages.clangStdenv.cc;
in
buildPythonApplication {
pname = "minijail-tools";
inherit (minijail) version src;
postPatch = ''
substituteInPlace Makefile --replace /bin/echo echo
'';
postConfigure = ''
substituteInPlace tools/compile_seccomp_policy.py \
--replace "'constants.json'" "'$out/share/constants.json'"
'';
preBuild = ''
make libconstants.gen.c libsyscalls.gen.c
${targetClang}/bin/${targetClang.targetPrefix}cc -S -emit-llvm \
libconstants.gen.c libsyscalls.gen.c
${python.pythonOnBuildForHost.interpreter} tools/generate_constants_json.py \
--output constants.json \
libconstants.gen.ll libsyscalls.gen.ll
'';
postInstall = ''
mkdir -p $out/share
cp -v constants.json $out/share/constants.json
'';
meta = with lib; {
homepage = "https://android.googlesource.com/platform/external/minijail/+/refs/heads/master/tools/";
description = "Set of tools for minijail";
license = licenses.asl20;
inherit (minijail.meta) maintainers platforms;
};
}