mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-17 07:13:23 +01:00
Merge pull request #99335 from obsidiansystems/make-rust-platform-separate
makeRustPlatform: Put back in it's own file.
This commit is contained in:
commit
f3db41d730
5 changed files with 26 additions and 19 deletions
|
@ -13,6 +13,7 @@
|
|||
, CoreFoundation, Security
|
||||
, llvmPackages_5
|
||||
, pkgsBuildTarget, pkgsBuildBuild
|
||||
, makeRustPlatform
|
||||
} @ args:
|
||||
|
||||
import ./default.nix {
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
, CoreFoundation, Security
|
||||
, llvmPackages_5
|
||||
, pkgsBuildTarget, pkgsBuildBuild
|
||||
, makeRustPlatform
|
||||
} @ args:
|
||||
|
||||
import ./default.nix {
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
, CoreFoundation, Security
|
||||
, llvmPackages_5
|
||||
, pkgsBuildTarget, pkgsBuildBuild
|
||||
, makeRustPlatform
|
||||
}: rec {
|
||||
# https://doc.rust-lang.org/reference/conditional-compilation.html#target_arch
|
||||
toTargetArch = platform:
|
||||
|
@ -33,24 +34,6 @@
|
|||
in platform.rustc.config
|
||||
or "${cpu_}-${vendor.name}-${kernel.name}${lib.optionalString (abi.name != "unknown") "-${abi.name}"}";
|
||||
|
||||
makeRustPlatform = { rustc, cargo, ... }: rec {
|
||||
rust = {
|
||||
inherit rustc cargo;
|
||||
};
|
||||
|
||||
fetchCargoTarball = buildPackages.callPackage ../../../build-support/rust/fetchCargoTarball.nix {
|
||||
inherit cargo;
|
||||
};
|
||||
|
||||
buildRustPackage = callPackage ../../../build-support/rust {
|
||||
inherit rustc cargo fetchCargoTarball;
|
||||
};
|
||||
|
||||
rustcSrc = callPackage ./rust-src.nix {
|
||||
inherit rustc;
|
||||
};
|
||||
};
|
||||
|
||||
# This just contains tools for now. But it would conceivably contain
|
||||
# libraries too, say if we picked some default/recommended versions from
|
||||
# `cratesIO` to build by Hydra and/or try to prefer/bias in Cargo.lock for
|
||||
|
|
21
pkgs/development/compilers/rust/make-rust-platform.nix
Normal file
21
pkgs/development/compilers/rust/make-rust-platform.nix
Normal file
|
@ -0,0 +1,21 @@
|
|||
{ buildPackages, callPackage }:
|
||||
|
||||
{ rustc, cargo, ... }:
|
||||
|
||||
rec {
|
||||
rust = {
|
||||
inherit rustc cargo;
|
||||
};
|
||||
|
||||
fetchCargoTarball = buildPackages.callPackage ../../../build-support/rust/fetchCargoTarball.nix {
|
||||
inherit cargo;
|
||||
};
|
||||
|
||||
buildRustPackage = callPackage ../../../build-support/rust {
|
||||
inherit rustc cargo fetchCargoTarball;
|
||||
};
|
||||
|
||||
rustcSrc = callPackage ./rust-src.nix {
|
||||
inherit rustc;
|
||||
};
|
||||
}
|
|
@ -9680,7 +9680,8 @@ in
|
|||
rustPackages = rustPackages_1_45;
|
||||
|
||||
inherit (rustPackages) cargo clippy rustc rustPlatform;
|
||||
inherit (rust) makeRustPlatform;
|
||||
|
||||
makeRustPlatform = callPackage ../development/compilers/rust/make-rust-platform.nix {};
|
||||
|
||||
buildRustCrate = callPackage ../build-support/rust/build-rust-crate { };
|
||||
buildRustCrateHelpers = callPackage ../build-support/rust/build-rust-crate/helpers.nix { };
|
||||
|
|
Loading…
Reference in a new issue