mirror of
https://github.com/icewind1991/cynthion-flake.git
synced 2026-06-03 22:34:06 +02:00
split gateware building into individual derivations
This commit is contained in:
parent
bd43c82cae
commit
3e9035e7b5
3 changed files with 56 additions and 35 deletions
41
pkgs/cynthion/single-gateware.nix
Normal file
41
pkgs/cynthion/single-gateware.nix
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
{
|
||||
stdenvNoCC,
|
||||
cynthion-unwrapped,
|
||||
zsh,
|
||||
yosys,
|
||||
nextpnr,
|
||||
trellis,
|
||||
bitstream ? null,
|
||||
platform ? null,
|
||||
...
|
||||
}: stdenvNoCC.mkDerivation {
|
||||
pname = "cynthion-gateware-${bitstream}";
|
||||
version = "${cynthion-unwrapped.version}-${platform}";
|
||||
|
||||
inherit (cynthion-unwrapped) src;
|
||||
dontFixup = true;
|
||||
|
||||
nativeBuildInputs = [
|
||||
cynthion-unwrapped
|
||||
yosys
|
||||
nextpnr
|
||||
trellis
|
||||
zsh
|
||||
];
|
||||
|
||||
LUNA_PLATFORM = "cynthion.gateware.platform:${platform}";
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
|
||||
mkdir -p assets/${platform}
|
||||
python -m cynthion.gateware.${bitstream}.top --dry-run --output assets/${platform}/${bitstream}.bit
|
||||
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/share
|
||||
cp -r assets $out/share
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue