mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 14:54:29 +01:00
stdenv: fix meson rust cross compilation
This commit is contained in:
parent
e3e57b8f18
commit
506dcaabb4
3 changed files with 3 additions and 20 deletions
|
@ -17,7 +17,6 @@
|
|||
, libadwaita
|
||||
, librsvg
|
||||
, rustc
|
||||
, writeText
|
||||
, cargo
|
||||
}:
|
||||
|
||||
|
@ -59,16 +58,6 @@ stdenv.mkDerivation rec {
|
|||
librsvg
|
||||
];
|
||||
|
||||
mesonFlags =
|
||||
let
|
||||
# ERROR: 'rust' compiler binary not defined in cross or native file
|
||||
crossFile = writeText "cross-file.conf" ''
|
||||
[binaries]
|
||||
rust = [ 'rustc', '--target', '${stdenv.hostPlatform.rust.rustcTargetSpec}' ]
|
||||
'';
|
||||
in
|
||||
lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ "--cross-file=${crossFile}" ];
|
||||
|
||||
passthru = {
|
||||
updateScript = gnome.updateScript {
|
||||
packageName = pname;
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
, stdenv
|
||||
, fetchFromGitLab
|
||||
, fetchpatch
|
||||
, writeText
|
||||
, rustPlatform
|
||||
, meson
|
||||
, ninja
|
||||
|
@ -204,14 +203,7 @@ stdenv.mkDerivation rec {
|
|||
) ++ [
|
||||
(lib.mesonOption "sodium-source" "system")
|
||||
(lib.mesonEnable "doc" enableDocumentation)
|
||||
] ++ (let
|
||||
crossFile = writeText "cross-file.conf" ''
|
||||
[binaries]
|
||||
rust = [ 'rustc', '--target', '${stdenv.hostPlatform.rust.rustcTargetSpec}' ]
|
||||
'';
|
||||
in lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
|
||||
"--cross-file=${crossFile}"
|
||||
]);
|
||||
];
|
||||
|
||||
# turn off all auto plugins since we use a list of plugins we generate
|
||||
mesonAutoFeatures = "disabled";
|
||||
|
|
|
@ -402,6 +402,7 @@ else let
|
|||
|
||||
crossFile = builtins.toFile "cross-file.conf" ''
|
||||
[properties]
|
||||
bindgen_clang_arguments = ['-target', '${stdenv.targetPlatform.config}']
|
||||
needs_exe_wrapper = ${lib.boolToString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform)}
|
||||
|
||||
[host_machine]
|
||||
|
@ -412,6 +413,7 @@ else let
|
|||
|
||||
[binaries]
|
||||
llvm-config = 'llvm-config-native'
|
||||
rust = ['rustc', '--target', '${stdenv.targetPlatform.rust.rustcTargetSpec}']
|
||||
'';
|
||||
crossFlags = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ "--cross-file=${crossFile}" ];
|
||||
in crossFlags ++ mesonFlags;
|
||||
|
|
Loading…
Reference in a new issue