From 42107ff1e92f2bb553d47e5e1e2ff5b435eec1c9 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sat, 6 Feb 2021 22:00:54 +0800 Subject: [PATCH] mcu: build Sayma MMC firmware --- mcu/default.nix | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/mcu/default.nix b/mcu/default.nix index a900c3d..a455421 100644 --- a/mcu/default.nix +++ b/mcu/default.nix @@ -80,4 +80,26 @@ in pkgs.icestorm ]; }; + # openMMC build system breaks if host compiler is not available, so do not use stdenvNoCC here + sayma-mmc = pkgs.stdenv.mkDerivation { + name = "sayma-mmc"; + src = ; + phases = [ "unpackPhase" "buildPhase" "installPhase" ]; + nativeBuildInputs = [ pkgs.cmake pkgs.gcc-arm-embedded ]; + buildPhase = + '' + mkdir build + cd build + cmake .. -DBOARD=sayma -DBOARD_RTM=sayma -DVERSION= -DTARGET_CONTROLLER=LPC1776 -DCMAKE_BUILD_TYPE=Debug + make + ''; + installPhase = + '' + mkdir $out + cp out/* $out + mkdir -p $out $out/nix-support + echo file binary-dist $out/openMMC.axf >> $out/nix-support/hydra-build-products + echo file binary-dist $out/openMMC.bin >> $out/nix-support/hydra-build-products + ''; + }; }