Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

stdenv: fix meson rust cross compilation

+3 -20
-11
pkgs/desktops/gnome/core/gnome-tour/default.nix
··· 17 17 , libadwaita 18 18 , librsvg 19 19 , rustc 20 - , writeText 21 20 , cargo 22 21 }: 23 22 ··· 58 57 libadwaita 59 58 librsvg 60 59 ]; 61 - 62 - mesonFlags = 63 - let 64 - # ERROR: 'rust' compiler binary not defined in cross or native file 65 - crossFile = writeText "cross-file.conf" '' 66 - [binaries] 67 - rust = [ 'rustc', '--target', '${stdenv.hostPlatform.rust.rustcTargetSpec}' ] 68 - ''; 69 - in 70 - lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ "--cross-file=${crossFile}" ]; 71 60 72 61 passthru = { 73 62 updateScript = gnome.updateScript {
+1 -9
pkgs/development/libraries/gstreamer/rs/default.nix
··· 2 2 , stdenv 3 3 , fetchFromGitLab 4 4 , fetchpatch 5 - , writeText 6 5 , rustPlatform 7 6 , meson 8 7 , ninja ··· 204 203 ) ++ [ 205 204 (lib.mesonOption "sodium-source" "system") 206 205 (lib.mesonEnable "doc" enableDocumentation) 207 - ] ++ (let 208 - crossFile = writeText "cross-file.conf" '' 209 - [binaries] 210 - rust = [ 'rustc', '--target', '${stdenv.hostPlatform.rust.rustcTargetSpec}' ] 211 - ''; 212 - in lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ 213 - "--cross-file=${crossFile}" 214 - ]); 206 + ]; 215 207 216 208 # turn off all auto plugins since we use a list of plugins we generate 217 209 mesonAutoFeatures = "disabled";
+2
pkgs/stdenv/generic/make-derivation.nix
··· 402 402 403 403 crossFile = builtins.toFile "cross-file.conf" '' 404 404 [properties] 405 + bindgen_clang_arguments = ['-target', '${stdenv.targetPlatform.config}'] 405 406 needs_exe_wrapper = ${lib.boolToString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform)} 406 407 407 408 [host_machine] ··· 412 413 413 414 [binaries] 414 415 llvm-config = 'llvm-config-native' 416 + rust = ['rustc', '--target', '${stdenv.targetPlatform.rust.rustcTargetSpec}'] 415 417 ''; 416 418 crossFlags = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ "--cross-file=${crossFile}" ]; 417 419 in crossFlags ++ mesonFlags;