forked from M-Labs/zynq-rs
default.nix: build zc706
This commit is contained in:
parent
ace24112fa
commit
20249cf2da
26
default.nix
26
default.nix
|
@ -28,6 +28,30 @@ let
|
||||||
rustc = rust // { src = rustcSrc; };
|
rustc = rust // { src = rustcSrc; };
|
||||||
cargo = rust;
|
cargo = rust;
|
||||||
});
|
});
|
||||||
|
gcc = pkgsCross.armv7l-hf-multiplatform.buildPackages.gcc;
|
||||||
|
xbuildRustPackage = attrs:
|
||||||
|
(rustPlatform.buildRustPackage attrs)
|
||||||
|
.overrideAttrs (oldAttrs: with oldAttrs; {
|
||||||
|
nativeBuildInputs =
|
||||||
|
oldAttrs.nativeBuildInputs ++ [ cargo-xbuild ];
|
||||||
|
buildPhase = ''
|
||||||
|
cargo xbuild --release --frozen
|
||||||
|
'';
|
||||||
|
XARGO_RUST_SRC = "${rustcSrc}/src";
|
||||||
|
installPhase = ''
|
||||||
|
mkdir $out
|
||||||
|
cp target/armv7-none-eabihf/release/${name} $out/${name}.elf
|
||||||
|
'';
|
||||||
|
});
|
||||||
|
zc706 = xbuildRustPackage {
|
||||||
|
name = "zc706";
|
||||||
|
src = ./.;
|
||||||
|
cargoSha256 = "1n9d8z55cqgpdz4ywyzapbzj7ph7mkfvc87bzyfyyfkx680hz1l9";
|
||||||
|
nativeBuildInputs = [
|
||||||
|
gcc
|
||||||
|
];
|
||||||
|
doCheck = false;
|
||||||
|
};
|
||||||
in {
|
in {
|
||||||
inherit pkgs rustPlatform rustcSrc;
|
inherit pkgs rustPlatform rustcSrc zc706 gcc;
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,9 +12,7 @@ stdenv.mkDerivation {
|
||||||
buildInputs = (with rustPlatform.rust; [
|
buildInputs = (with rustPlatform.rust; [
|
||||||
rustc cargo
|
rustc cargo
|
||||||
cargo-xbuild rustcSrc
|
cargo-xbuild rustcSrc
|
||||||
# pkgsCross.armhf-embedded.buildPackages.gcc
|
gcc
|
||||||
pkgsCross.armv7l-hf-multiplatform.buildPackages.gcc
|
|
||||||
#pkgsCross.armhf-embedded.buildPackages.binutils
|
|
||||||
]) ++ (with pkgs; [ openocd gdb ]);
|
]) ++ (with pkgs; [ openocd gdb ]);
|
||||||
|
|
||||||
# Set Environment Variables
|
# Set Environment Variables
|
||||||
|
|
Loading…
Reference in New Issue