build standalone
This commit is contained in:
parent
393051f407
commit
ba6da64605
37
default.nix
37
default.nix
@ -1,24 +1,27 @@
|
|||||||
let
|
let
|
||||||
pkgs = import (fetchTarball { url = "https://github.com/NixOS/nixpkgs/archive/20.03.tar.gz"; sha256 = "0182ys095dfx02vl2a20j1hz92dx3mfgz2a6fhn31bqlp1wa8hlq"; }) {};
|
pkgs = import (fetchTarball { url = "https://github.com/NixOS/nixpkgs/archive/20.03.tar.gz"; sha256 = "0182ys095dfx02vl2a20j1hz92dx3mfgz2a6fhn31bqlp1wa8hlq"; }) { };
|
||||||
pyPackages = (python-packages: with python-packages; ([
|
pyPackages = (python-packages: with python-packages; ([
|
||||||
solo-python pytest
|
solo-python
|
||||||
|
pytest
|
||||||
] ++ (with builtins; map (d: getAttr d python-packages) (filter (d: stringLength d > 0) (pkgs.lib.splitString "\n" (builtins.readFile ./tools/requirements.txt))))));
|
] ++ (with builtins; map (d: getAttr d python-packages) (filter (d: stringLength d > 0) (pkgs.lib.splitString "\n" (builtins.readFile ./tools/requirements.txt))))));
|
||||||
python-with-my-packages = pkgs.python3.withPackages pyPackages;
|
python-with-my-packages = pkgs.python3.withPackages pyPackages;
|
||||||
src = ./.;
|
src = with pkgs.lib; builtins.filterSource (path: type: !(hasSuffix path "hex" || hasSuffix path "sha256" || baseNameOf path == "result")) ./.;
|
||||||
in
|
in
|
||||||
with pkgs; stdenv.mkDerivation {
|
with pkgs; stdenv.mkDerivation {
|
||||||
name = "solo";
|
name = "solo";
|
||||||
outputs = [ "out" ];
|
outputs = [ "out" ];
|
||||||
src = with lib; builtins.filterSource (path: type: !(hasSuffix path "hex" || hasSuffix path "sha256" || baseNameOf path == "result")) src;
|
inherit src;
|
||||||
buildInputs = [ gnumake gcc gcc-arm-embedded-8 git python-with-my-packages ];
|
buildInputs = [ src gnumake gcc gcc-arm-embedded-8 git python-with-my-packages ];
|
||||||
phases = [ "unpackPhase" "configurePhase" "buildPhase" "installPhase" ];
|
phases = [ "unpackPhase" "configurePhase" "buildPhase" "installPhase" ];
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -p $out/firmware $out
|
mkdir -p $out/firmware $out/standalone/bin
|
||||||
cd targets/stm32l432
|
make
|
||||||
make cbor
|
cp main $out/standalone/bin/
|
||||||
make build-hacker
|
cd targets/stm32l432
|
||||||
cp *.hex *.sha256 *.elf cubeconfig_stm32l442.ioc $out/firmware/
|
make cbor
|
||||||
'';
|
make build-hacker
|
||||||
keepDebugInfo = true;
|
cp *.hex *.sha256 *.elf cubeconfig_stm32l442.ioc $out/firmware/
|
||||||
|
ln -s ${src} $out/src
|
||||||
|
'';
|
||||||
|
keepDebugInfo = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user