forked from M-Labs/artiq
1
0
Fork 0

flake: make board package a Python package

This commit is contained in:
Sebastien Bourdeauducq 2021-09-01 18:46:23 +08:00 committed by occheung
parent 952acce65b
commit 64ce7e498b
1 changed files with 3 additions and 3 deletions

View File

@ -208,7 +208,7 @@
artiq-board-kc705-nist-clock = let artiq-board-kc705-nist-clock = let
makeArtiqBoardPackage = { target, variant, buildCommand ? "python -m artiq.gateware.targets.${target} -V ${variant}" }: makeArtiqBoardPackage = { target, variant, buildCommand ? "python -m artiq.gateware.targets.${target} -V ${variant}" }:
pkgs.stdenv.mkDerivation { pkgs.python3Packages.toPythonModule (pkgs.stdenv.mkDerivation {
name = "artiq-board-${target}-${variant}"; name = "artiq-board-${target}-${variant}";
phases = [ "buildPhase" "checkPhase" "installPhase" ]; phases = [ "buildPhase" "checkPhase" "installPhase" ];
cargoDeps = rustPlatform.fetchCargoTarball { cargoDeps = rustPlatform.fetchCargoTarball {
@ -246,7 +246,7 @@
''; '';
installPhase = installPhase =
'' ''
TARGET_DIR=$out TARGET_DIR=$out/${pkgs.python3Packages.python.sitePackages}/artiq/board-support/${target}-${variant}
mkdir -p $TARGET_DIR mkdir -p $TARGET_DIR
cp artiq_${target}/${variant}/gateware/top.bit $TARGET_DIR cp artiq_${target}/${variant}/gateware/top.bit $TARGET_DIR
if [ -e artiq_${target}/${variant}/software/bootloader/bootloader.bin ] if [ -e artiq_${target}/${variant}/software/bootloader/bootloader.bin ]
@ -259,7 +259,7 @@
''; '';
# don't mangle ELF files as they are not for NixOS # don't mangle ELF files as they are not for NixOS
dontFixup = true; dontFixup = true;
}; });
in makeArtiqBoardPackage { in makeArtiqBoardPackage {
target = "kc705"; target = "kc705";
variant = "nist_clock"; variant = "nist_clock";