ripgrep: fix cross build Linux to FreeBSD

ripgrep was evaluating the emulator for a cross-test, even without
`canRunRg`. This failed when there is no emulator.
This commit is contained in:
Artemis Tosini
2026-07-21 16:24:28 -04:00
parent 82225d2816
commit e5f929032e
+11 -9
View File
@@ -50,15 +50,17 @@ rustPlatform.buildRustPackage (finalAttrs: {
'';
doInstallCheck = true;
installCheckPhase = ''
file="$(mktemp)"
echo "abc\nbcd\ncde" > "$file"
${rg} -N 'bcd' "$file"
${rg} -N 'cd' "$file"
''
+ lib.optionalString withPCRE2 ''
echo '(a(aa)aa)' | ${rg} -P '\((a*|(?R))*\)'
'';
installCheckPhase = lib.optionalString canRunRg (
''
file="$(mktemp)"
echo "abc\nbcd\ncde" > "$file"
${rg} -N 'bcd' "$file"
${rg} -N 'cd' "$file"
''
+ lib.optionalString withPCRE2 ''
echo '(a(aa)aa)' | ${rg} -P '\((a*|(?R))*\)'
''
);
meta = {
description = "Utility that combines the usability of The Silver Searcher with the raw speed of grep";