forked from M-Labs/nix-scripts
stm32: work around hydra restricted mode
This commit is contained in:
parent
60e16ada2a
commit
a6f8e1a558
|
@ -8,24 +8,28 @@ let
|
||||||
rustPlatform = pkgs.recurseIntoAttrs (pkgs.callPackage ./rustPlatform.nix {
|
rustPlatform = pkgs.recurseIntoAttrs (pkgs.callPackage ./rustPlatform.nix {
|
||||||
inherit rustManifest;
|
inherit rustManifest;
|
||||||
});
|
});
|
||||||
buildStm32Firmware = { name, src, cargoSha256 ? (import "${src}/cargosha256.nix") }:
|
buildStm32Firmware = { name, src }:
|
||||||
rustPlatform.buildRustPackage rec {
|
let
|
||||||
inherit name;
|
cargoSha256Drv = pkgs.runCommand "${name}-cargosha256" { } ''cp "${src}/cargosha256.nix" $out'';
|
||||||
version = "0.0.0";
|
in
|
||||||
|
rustPlatform.buildRustPackage rec {
|
||||||
|
inherit name;
|
||||||
|
version = "0.0.0";
|
||||||
|
|
||||||
inherit src cargoSha256;
|
inherit src;
|
||||||
|
cargoSha256 = (import cargoSha256Drv);
|
||||||
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
export CARGO_HOME=$(mktemp -d cargo-home.XXX)
|
export CARGO_HOME=$(mktemp -d cargo-home.XXX)
|
||||||
cargo build --release
|
cargo build --release
|
||||||
'';
|
'';
|
||||||
|
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -p $out $out/nix-support
|
mkdir -p $out $out/nix-support
|
||||||
cp target/thumbv7em-none-eabihf/release/${name} $out/${name}.elf
|
cp target/thumbv7em-none-eabihf/release/${name} $out/${name}.elf
|
||||||
echo file binary-dist $out/${name}.elf >> $out/nix-support/hydra-build-products
|
echo file binary-dist $out/${name}.elf >> $out/nix-support/hydra-build-products
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue