From 09558b2d4b0e5fb74fc5c40b4c6cb0b7e72f7d00 Mon Sep 17 00:00:00 2001 From: Colin Date: Wed, 27 Aug 2025 01:12:45 +0000 Subject: [PATCH] spot: fix cross compilation --- pkgs/by-name/sp/spot/package.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/by-name/sp/spot/package.nix b/pkgs/by-name/sp/spot/package.nix index 630682bce77c..9133809ac988 100644 --- a/pkgs/by-name/sp/spot/package.nix +++ b/pkgs/by-name/sp/spot/package.nix @@ -40,6 +40,12 @@ stdenv.mkDerivation rec { hash = "sha256-731aD+yJkyrNMmYtgKYzXIAyLegDBzTT2XqZs5usXiI="; }; + postPatch = '' + substituteInPlace src/meson.build --replace-fail \ + "cargo_output = 'src' / rust_target / meson.project_name()" \ + "cargo_output = 'src' / '${stdenv.hostPlatform.rust.cargoShortTarget}' / rust_target / meson.project_name()" + ''; + nativeBuildInputs = [ appstream-glib blueprint-compiler @@ -71,6 +77,9 @@ stdenv.mkDerivation rec { # https://github.com/xou816/spot/issues/313 mesonBuildType = "release"; + # For https://github.com/xou816/spot/blob/21ee601f655caa4ca9cae1033a27459fe6289318/src/meson.build#L122 + env.CARGO_BUILD_TARGET = stdenv.hostPlatform.rust.rustcTargetSpec; + passthru = { updateScript = nix-update-script { }; };