uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
37
pkgs/build-support/rust/lib/default.nix
Normal file
37
pkgs/build-support/rust/lib/default.nix
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
{ lib }:
|
||||
|
||||
rec {
|
||||
# https://doc.rust-lang.org/reference/conditional-compilation.html#target_arch
|
||||
toTargetArch = platform:
|
||||
if platform.isAarch32 then "arm"
|
||||
else platform.parsed.cpu.name;
|
||||
|
||||
# https://doc.rust-lang.org/reference/conditional-compilation.html#target_os
|
||||
toTargetOs = platform:
|
||||
if platform.isDarwin then "macos"
|
||||
else platform.parsed.kernel.name;
|
||||
|
||||
# Returns the name of the rust target, even if it is custom. Adjustments are
|
||||
# because rust has slightly different naming conventions than we do.
|
||||
toRustTarget = platform: let
|
||||
inherit (platform.parsed) cpu vendor kernel abi;
|
||||
cpu_ = platform.rustc.platform.arch or {
|
||||
"armv7a" = "armv7";
|
||||
"armv7l" = "armv7";
|
||||
"armv6l" = "arm";
|
||||
"armv5tel" = "armv5te";
|
||||
"riscv64" = "riscv64gc";
|
||||
}.${cpu.name} or cpu.name;
|
||||
vendor_ = platform.rustc.platform.vendor or {
|
||||
"w64" = "pc";
|
||||
}.${vendor.name} or vendor.name;
|
||||
in platform.rustc.config
|
||||
or "${cpu_}-${vendor_}-${kernel.name}${lib.optionalString (abi.name != "unknown") "-${abi.name}"}";
|
||||
|
||||
# Returns the name of the rust target if it is standard, or the json file
|
||||
# containing the custom target spec.
|
||||
toRustTargetSpec = platform:
|
||||
if (platform.rustc or {}) ? platform
|
||||
then builtins.toFile (toRustTarget platform + ".json") (builtins.toJSON platform.rustc.platform)
|
||||
else toRustTarget platform;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue