1 { lib, buildPythonApplication, pkgsBuildTarget, python, minijail }:
4 targetClang = pkgsBuildTarget.targetPackages.clangStdenv.cc;
7 buildPythonApplication {
8 pname = "minijail-tools";
9 inherit (minijail) version src;
12 substituteInPlace Makefile --replace /bin/echo echo
16 substituteInPlace tools/compile_seccomp_policy.py \
17 --replace "'constants.json'" "'$out/share/constants.json'"
21 make libconstants.gen.c libsyscalls.gen.c
22 ${targetClang}/bin/${targetClang.targetPrefix}cc -S -emit-llvm \
23 libconstants.gen.c libsyscalls.gen.c
24 ${python.pythonOnBuildForHost.interpreter} tools/generate_constants_json.py \
25 --output constants.json \
26 libconstants.gen.ll libsyscalls.gen.ll
31 cp -v constants.json $out/share/constants.json
35 homepage = "https://android.googlesource.com/platform/external/minijail/+/refs/heads/master/tools/";
36 description = "Set of tools for minijail";
37 license = licenses.asl20;
38 inherit (minijail.meta) maintainers platforms;