Skip to content

Commit 64aedcd

Browse files
authored
spot: fix cross compilation (#437722)
2 parents 93a095c + 09558b2 commit 64aedcd

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pkgs/by-name/sp/spot/package.nix

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ stdenv.mkDerivation rec {
4040
hash = "sha256-731aD+yJkyrNMmYtgKYzXIAyLegDBzTT2XqZs5usXiI=";
4141
};
4242

43+
postPatch = ''
44+
substituteInPlace src/meson.build --replace-fail \
45+
"cargo_output = 'src' / rust_target / meson.project_name()" \
46+
"cargo_output = 'src' / '${stdenv.hostPlatform.rust.cargoShortTarget}' / rust_target / meson.project_name()"
47+
'';
48+
4349
nativeBuildInputs = [
4450
appstream-glib
4551
blueprint-compiler
@@ -71,6 +77,9 @@ stdenv.mkDerivation rec {
7177
# https://github.com/xou816/spot/issues/313
7278
mesonBuildType = "release";
7379

80+
# For https://github.com/xou816/spot/blob/21ee601f655caa4ca9cae1033a27459fe6289318/src/meson.build#L122
81+
env.CARGO_BUILD_TARGET = stdenv.hostPlatform.rust.rustcTargetSpec;
82+
7483
passthru = {
7584
updateScript = nix-update-script { };
7685
};

0 commit comments

Comments
 (0)