stm32: add humpback fpga build dependencies

This commit is contained in:
Sebastien Bourdeauducq 2020-09-25 14:35:09 +08:00
parent fe728a7303
commit 657d3c1b27
1 changed files with 8 additions and 2 deletions

View File

@ -8,7 +8,7 @@ let
rustPlatform = pkgs.recurseIntoAttrs (pkgs.callPackage ./rustPlatform.nix { rustPlatform = pkgs.recurseIntoAttrs (pkgs.callPackage ./rustPlatform.nix {
inherit rustManifest; inherit rustManifest;
}); });
buildStm32Firmware = { name, src, patchPhase ? "", checkPhase ? "" }: buildStm32Firmware = { name, src, patchPhase ? "", extraBuildInputs ? [], checkPhase ? "" }:
let let
cargoSha256Drv = pkgs.runCommand "${name}-cargosha256" { } ''cp "${src}/cargosha256.nix" $out''; cargoSha256Drv = pkgs.runCommand "${name}-cargosha256" { } ''cp "${src}/cargosha256.nix" $out'';
in in
@ -20,7 +20,7 @@ let
cargoSha256 = (import cargoSha256Drv); cargoSha256 = (import cargoSha256Drv);
inherit patchPhase; inherit patchPhase;
buildInputs = [ pkgs.llvm ]; buildInputs = [ pkgs.llvm ] ++ extraBuildInputs;
buildPhase = '' buildPhase = ''
export CARGO_HOME=$(mktemp -d cargo-home.XXX) export CARGO_HOME=$(mktemp -d cargo-home.XXX)
cargo build --release cargo build --release
@ -58,5 +58,11 @@ in
humpback-dds = buildStm32Firmware { humpback-dds = buildStm32Firmware {
name = "humpback-dds"; name = "humpback-dds";
src = <humpbackDdsSrc>; src = <humpbackDdsSrc>;
extraBuildInputs = [
(pkgs.python3.withPackages(ps: [ (pkgs.callPackage "${<humpbackDdsSrc>}/nix/migen.nix" {}) ]))
pkgs.yosys
pkgs.nextpnr
pkgs.icestorm
];
}; };
} }