diff options
Diffstat (limited to 'nixpkgs/pkgs/build-support/rust/default.nix')
-rw-r--r-- | nixpkgs/pkgs/build-support/rust/default.nix | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/nixpkgs/pkgs/build-support/rust/default.nix b/nixpkgs/pkgs/build-support/rust/default.nix index 5ff430475caa..2193a5825dfd 100644 --- a/nixpkgs/pkgs/build-support/rust/default.nix +++ b/nixpkgs/pkgs/build-support/rust/default.nix @@ -16,6 +16,7 @@ let , cargoDepsHook ? "" , cargoBuildFlags ? [] , buildType ? "release" + , meta ? {} , cargoVendorDir ? null , ... } @ args: @@ -47,7 +48,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; @@ -105,7 +105,7 @@ let "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} ) @@ -149,6 +149,11 @@ let ''; passthru = { inherit cargoDeps; } // (args.passthru or {}); + + meta = { + # default to Rust's platforms + platforms = rustc.meta.platforms; + } // meta; }) // { overrideRustAttrs = f: buildRustPackage (args // (f args)); }; |