From 74083ae5e5be80ff2040ce90a7702b832b107831 Mon Sep 17 00:00:00 2001 From: FliegendeWurst Date: Sun, 2 Feb 2025 21:30:17 +0100 Subject: [PATCH] ripgrep: fix Windows build and set meta.platforms --- pkgs/by-name/ri/ripgrep/package.nix | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/ri/ripgrep/package.nix b/pkgs/by-name/ri/ripgrep/package.nix index 9e71238f0095..f235bf37d304 100644 --- a/pkgs/by-name/ri/ripgrep/package.nix +++ b/pkgs/by-name/ri/ripgrep/package.nix @@ -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; }; }