pi-coding-agent: remove vendored Linux binaries on Darwin

This commit is contained in:
FlameFlag
2026-05-14 03:51:36 +03:00
parent b651dd816b
commit 062d5c8cf7
@@ -7,6 +7,7 @@
writableTmpDirAsHomeHook,
ripgrep,
makeBinaryWrapper,
stdenvNoCC,
}:
buildNpmPackage (finalAttrs: {
pname = "pi-coding-agent";
@@ -65,7 +66,17 @@ buildNpmPackage (finalAttrs: {
# Clean up now-dangling .bin symlinks
find "$nm/.bin" -xtype l -delete
''
+ lib.optionalString stdenvNoCC.hostPlatform.isDarwin ''
# Remove foreign Linux binaries that make audit-tmpdir try to inspect ELF
# RPATHs with patchelf
find "$nm/koffi/build/koffi" -mindepth 1 -maxdepth 1 -type d \
! -name 'darwin_*' -exec rm -r {} +
rm -rf \
"$nm/@anthropic-ai/sandbox-runtime/dist/vendor/seccomp" \
"$nm/@anthropic-ai/sandbox-runtime/vendor/seccomp"
'';
postFixup = "wrapProgram $out/bin/pi --prefix PATH : ${lib.makeBinPath [ ripgrep ]}";
doInstallCheck = true;