Merge: ripgrep: fix Windows build and set meta.platforms (#378959)

This commit is contained in:
Maximilian Bosch
2025-02-05 11:00:45 +01:00
committed by GitHub
+8 -3
View File
@@ -8,11 +8,12 @@
pkg-config,
withPCRE2 ? true,
pcre2,
writableTmpDirAsHomeHook,
}:
let
canRunRg = stdenv.hostPlatform.emulatorAvailable buildPackages;
rg = "${stdenv.hostPlatform.emulator buildPackages} $out/bin/rg";
rg = "${stdenv.hostPlatform.emulator buildPackages} $out/bin/rg${stdenv.hostPlatform.extensions.executable}";
in
rustPlatform.buildRustPackage rec {
pname = "ripgrep";
@@ -28,12 +29,15 @@ rustPlatform.buildRustPackage rec {
useFetchCargoVendor = true;
cargoHash = "sha256-9atn5qyBDy4P6iUoHFhg+TV6Ur71fiah4oTJbBMeEy4=";
nativeBuildInputs = [ installShellFiles ] ++ lib.optional withPCRE2 pkg-config;
nativeBuildInputs = [
installShellFiles
writableTmpDirAsHomeHook # required for wine when cross-compiling to Windows
] ++ lib.optional withPCRE2 pkg-config;
buildInputs = lib.optional withPCRE2 pcre2;
buildFeatures = lib.optional withPCRE2 "pcre2";
preFixup = lib.optionalString canRunRg ''
postFixup = lib.optionalString canRunRg ''
${rg} --generate man > rg.1
installManPage rg.1
@@ -69,5 +73,6 @@ rustPlatform.buildRustPackage rec {
zowoq
];
mainProgram = "rg";
platforms = lib.platforms.all;
};
}