diff options
Diffstat (limited to 'pkgs/build-support/rust/default.nix')
-rw-r--r-- | pkgs/build-support/rust/default.nix | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/pkgs/build-support/rust/default.nix b/pkgs/build-support/rust/default.nix index 762a61b8a579..6afe93c7e4c1 100644 --- a/pkgs/build-support/rust/default.nix +++ b/pkgs/build-support/rust/default.nix @@ -14,6 +14,7 @@ , cargoDepsHook ? "" , cargoBuildFlags ? [] , buildType ? "release" +, meta ? {} , cargoVendorDir ? null , ... } @ args: @@ -45,7 +46,6 @@ let ccForHost="${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc"; cxxForHost="${stdenv.cc}/bin/${stdenv.cc.targetPrefix}c++"; releaseDir = "target/${stdenv.hostPlatform.config}/${buildType}"; - in stdenv.mkDerivation (args // { inherit cargoDeps; @@ -103,7 +103,7 @@ in stdenv.mkDerivation (args // { "CC_${stdenv.hostPlatform.config}"="${ccForHost}" \ "CXX_${stdenv.hostPlatform.config}"="${cxxForHost}" \ cargo build \ - --${buildType} \ + ${stdenv.lib.optionalString (buildType == "release") "--release"} \ --target ${stdenv.hostPlatform.config} \ --frozen ${concatStringsSep " " cargoBuildFlags} ) @@ -147,4 +147,9 @@ in stdenv.mkDerivation (args // { ''; passthru = { inherit cargoDeps; } // (args.passthru or {}); + + meta = { + # default to Rust's platforms + platforms = rustc.meta.platforms; + } // meta; }) |