13 rustPlatform.buildRustPackage {
14 inherit pname version;
16 src = fetchFromGitHub {
19 rev = "refs/tags/v${version}";
20 hash = "sha256-PLUB0t9eDR0mYUI6TiUxafo6yMymwdTux7ykF8rTGGc=";
23 cargoHash = "sha256-PJclGjQTAOvnl8LJTxlDyEuzdWE1R7A2gJe1I1sKde0=";
25 nativeBuildInputs = [ cargo-about ];
27 # Remove RiscV64 specialisation when this is fixed:
28 # * https://github.com/NixOS/nixpkgs/pull/310158#pullrequestreview-2046944158
29 # * https://github.com/rust-vmm/seccompiler/pull/72
30 cargoBuildFlags = lib.optional stdenv.hostPlatform.isRiscV64 "--no-default-features";
33 sed -i '1ino-clearly-defined = true' about.toml # disable network requests
34 cargo about generate --config about.toml -o THIRD_PARTY_LICENSES.HTML about.hbs
37 # Tests don't work for native non-x86 compilation
38 # because upstream overrides the name of the linker executables,
39 # see https://github.com/NixOS/nixpkgs/pull/310158#issuecomment-2118845043
40 doCheck = stdenv.hostPlatform.isx86_64;
43 "--skip=cli::test::log_mode_without_args_works" # `Permission denied` (needs `CAP_SYS_PTRACE`)
44 "--skip=tracer::test::tracer_emits_exec_event" # needs `/bin/true`
48 # Remove test binaries (e.g. `empty-argv`, `corrupted-envp`) and only retain `tracexec`
49 find "$out/bin" -type f \! -name tracexec -print0 | xargs -0 rm -v
51 install -Dm644 LICENSE -t "$out/share/licenses/tracexec/"
52 install -Dm644 THIRD_PARTY_LICENSES.HTML -t "$out/share/licenses/tracexec/"
55 passthru.updateScript = nix-update-script { };
58 changelog = "https://github.com/kxxt/tracexec/blob/v${version}/CHANGELOG.md";
59 description = "Small utility for tracing execve{,at} and pre-exec behavior";
60 homepage = "https://github.com/kxxt/tracexec";
61 license = lib.licenses.gpl2Plus;
62 mainProgram = "tracexec";
63 maintainers = with lib.maintainers; [
67 platforms = lib.platforms.linux;