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
42
pkgs/build-support/rust/sysroot/Cargo.lock
generated
Normal file
42
pkgs/build-support/rust/sysroot/Cargo.lock
generated
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
[[package]]
|
||||
name = "alloc"
|
||||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"compiler_builtins",
|
||||
"core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "compiler_builtins"
|
||||
version = "0.1.52"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b6591c2442ee984e2b264638a8b5e7ae44fd47b32d28e3a08e2e9c3cdb0c2fb0"
|
||||
dependencies = [
|
||||
"rustc-std-workspace-core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "core"
|
||||
version = "0.0.0"
|
||||
|
||||
[[package]]
|
||||
name = "nixpkgs-sysroot-stub-crate"
|
||||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"alloc",
|
||||
"compiler_builtins",
|
||||
"core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustc-std-workspace-core"
|
||||
version = "1.99.0"
|
||||
dependencies = [
|
||||
"core",
|
||||
]
|
||||
|
||||
[[patch.unused]]
|
||||
name = "rustc-std-workspace-alloc"
|
||||
version = "1.99.0"
|
||||
47
pkgs/build-support/rust/sysroot/cargo.py
Normal file
47
pkgs/build-support/rust/sysroot/cargo.py
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
import os
|
||||
import toml
|
||||
|
||||
rust_src = os.environ['RUSTC_SRC']
|
||||
orig_cargo = os.environ['ORIG_CARGO'] if 'ORIG_CARGO' in os.environ else None
|
||||
|
||||
base = {
|
||||
'package': {
|
||||
'name': 'nixpkgs-sysroot-stub-crate',
|
||||
'version': '0.0.0',
|
||||
'authors': ['The Rust Project Developers'],
|
||||
'edition': '2018',
|
||||
},
|
||||
'dependencies': {
|
||||
'compiler_builtins': {
|
||||
'version': '0.1.0',
|
||||
'features': ['rustc-dep-of-std', 'mem'],
|
||||
},
|
||||
'core': {
|
||||
'path': os.path.join(rust_src, 'core'),
|
||||
},
|
||||
'alloc': {
|
||||
'path': os.path.join(rust_src, 'alloc'),
|
||||
},
|
||||
},
|
||||
'patch': {
|
||||
'crates-io': {
|
||||
'rustc-std-workspace-core': {
|
||||
'path': os.path.join(rust_src, 'rustc-std-workspace-core'),
|
||||
},
|
||||
'rustc-std-workspace-alloc': {
|
||||
'path': os.path.join(rust_src, 'rustc-std-workspace-alloc'),
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
if orig_cargo is not None:
|
||||
with open(orig_cargo, 'r') as f:
|
||||
src = toml.loads(f.read())
|
||||
if 'profile' in src:
|
||||
base['profile'] = src['profile']
|
||||
|
||||
out = toml.dumps(base)
|
||||
|
||||
with open('Cargo.toml', 'x') as f:
|
||||
f.write(out)
|
||||
26
pkgs/build-support/rust/sysroot/src.nix
Normal file
26
pkgs/build-support/rust/sysroot/src.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{ lib, stdenv, rustPlatform, buildPackages
|
||||
, originalCargoToml ? null
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "cargo-src";
|
||||
preferLocalBuild = true;
|
||||
|
||||
unpackPhase = "true";
|
||||
dontConfigure = true;
|
||||
dontBuild = true;
|
||||
|
||||
installPhase = ''
|
||||
export RUSTC_SRC=${rustPlatform.rustLibSrc.override { }}
|
||||
''
|
||||
+ lib.optionalString (originalCargoToml != null) ''
|
||||
export ORIG_CARGO=${originalCargoToml}
|
||||
''
|
||||
+ ''
|
||||
${buildPackages.python3.withPackages (ps: with ps; [ toml ])}/bin/python3 ${./cargo.py}
|
||||
mkdir -p $out/src
|
||||
touch $out/src/lib.rs
|
||||
cp Cargo.toml $out/Cargo.toml
|
||||
cp ${./Cargo.lock} $out/Cargo.lock
|
||||
'';
|
||||
}
|
||||
27
pkgs/build-support/rust/sysroot/update-lockfile.sh
Executable file
27
pkgs/build-support/rust/sysroot/update-lockfile.sh
Executable file
|
|
@ -0,0 +1,27 @@
|
|||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p python3 python3.pkgs.toml cargo
|
||||
|
||||
set -eu pipefile
|
||||
|
||||
HERE=$(readlink -e $(dirname "${BASH_SOURCE[0]}"))
|
||||
NIXPKGS_ROOT="$HERE/../../../.."
|
||||
|
||||
# https://unix.stackexchange.com/a/84980/390173
|
||||
tempdir=$(mktemp -d 2>/dev/null || mktemp -d -t 'update-lockfile')
|
||||
cd "$tempdir"
|
||||
mkdir -p src
|
||||
touch src/lib.rs
|
||||
|
||||
RUSTC_SRC=$(nix-build "${NIXPKGS_ROOT}" -A pkgs.rustPlatform.rustLibSrc --no-out-link)
|
||||
|
||||
ln -s $RUSTC_SRC/{core,alloc} ./
|
||||
|
||||
export RUSTC_SRC
|
||||
python3 "$HERE/cargo.py"
|
||||
|
||||
export RUSTC_BOOTSTRAP=1
|
||||
cargo generate-lockfile
|
||||
|
||||
cp Cargo.lock "$HERE"
|
||||
|
||||
rm -rf "$tempdir"
|
||||
Loading…
Add table
Add a link
Reference in a new issue