From 506dcaabb4e004ed5db214f7efbbc278e89f6212 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Tue, 9 May 2023 13:43:23 +0000 Subject: stdenv: fix meson rust cross compilation --- pkgs/desktops/gnome/core/gnome-tour/default.nix | 11 ----------- pkgs/development/libraries/gstreamer/rs/default.nix | 10 +--------- pkgs/stdenv/generic/make-derivation.nix | 2 ++ 3 files changed, 3 insertions(+), 20 deletions(-) (limited to 'pkgs') diff --git a/pkgs/desktops/gnome/core/gnome-tour/default.nix b/pkgs/desktops/gnome/core/gnome-tour/default.nix index 26ac73f546d5c..bb658fcd4489f 100644 --- a/pkgs/desktops/gnome/core/gnome-tour/default.nix +++ b/pkgs/desktops/gnome/core/gnome-tour/default.nix @@ -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; diff --git a/pkgs/development/libraries/gstreamer/rs/default.nix b/pkgs/development/libraries/gstreamer/rs/default.nix index 1d06f88095971..ee467f965c817 100644 --- a/pkgs/development/libraries/gstreamer/rs/default.nix +++ b/pkgs/development/libraries/gstreamer/rs/default.nix @@ -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"; diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index d235ffefaab40..bd0d85fc676a3 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -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; -- cgit 1.4.1