summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2022-02-10 20:28:49 +0000
committerAlyssa Ross <hi@alyssa.is>2022-06-04 21:26:57 +0000
commit1623d81e507520b5207307bc2bf8cfcddf90944a (patch)
tree6584bf52d6b70a59e10cd8eef51280f42ad2afa8
parent7a4ec5c4fa75e4ccd68f9402c7d9871d89dc9655 (diff)
downloadnixpkgs-1623d81e507520b5207307bc2bf8cfcddf90944a.tar
nixpkgs-1623d81e507520b5207307bc2bf8cfcddf90944a.tar.gz
nixpkgs-1623d81e507520b5207307bc2bf8cfcddf90944a.tar.bz2
nixpkgs-1623d81e507520b5207307bc2bf8cfcddf90944a.tar.lz
nixpkgs-1623d81e507520b5207307bc2bf8cfcddf90944a.tar.xz
nixpkgs-1623d81e507520b5207307bc2bf8cfcddf90944a.tar.zst
nixpkgs-1623d81e507520b5207307bc2bf8cfcddf90944a.zip
meson: add Rust cross support
We don't currently have any software in Nixpkgs that uses Meson's Rust
support that I could find (rather than just shelling out to Cargo from
Meson), but it's easy to test this works regardless, e.g. with the
following which uses Meson's built-in template for a Rust project.

	stdenv.mkDerivation {
	  name = "rust-test";

	  unpackPhase = ''
	    mkdir src
	    cd src
	    meson init -l rust
	  '';

	  nativeBuildInputs = [ meson ninja rustc ];
	}
-rw-r--r--pkgs/development/tools/build-managers/meson/default.nix2
1 files changed, 2 insertions, 0 deletions
diff --git a/pkgs/development/tools/build-managers/meson/default.nix b/pkgs/development/tools/build-managers/meson/default.nix
index 88426ae713d..b0c9965c6ab 100644
--- a/pkgs/development/tools/build-managers/meson/default.nix
+++ b/pkgs/development/tools/build-managers/meson/default.nix
@@ -2,6 +2,7 @@
 , stdenv
 , fetchpatch
 , installShellFiles
+, rust
 , ninja
 , pkg-config
 , python3
@@ -92,6 +93,7 @@ python3.pkgs.buildPythonApplication rec {
 
       [binaries]
       llvm-config = 'llvm-config-native'
+      rust = ['rustc', '--target=${rust.toRustTargetSpec stdenv.targetPlatform}']
     '';
 
   setupHook = substituteAll {