mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-01 23:22:37 +00:00
betaflight: init at 3.2.3
This commit is contained in:
parent
0e73580026
commit
144b7d2acc
65
pkgs/development/stm32/betaflight/default.nix
Normal file
65
pkgs/development/stm32/betaflight/default.nix
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
{ stdenv, fetchFromGitHub
|
||||||
|
, gcc-arm-embedded, python2
|
||||||
|
, skipTargets ? [
|
||||||
|
# These targets do not build for various unexplored reasons
|
||||||
|
# TODO ... fix them
|
||||||
|
"AFROMINI"
|
||||||
|
"ALIENWHOOP"
|
||||||
|
"BEEBRAIN"
|
||||||
|
"CJMCU"
|
||||||
|
"FRSKYF3"
|
||||||
|
]}:
|
||||||
|
|
||||||
|
let
|
||||||
|
|
||||||
|
version = "3.2.3";
|
||||||
|
|
||||||
|
in stdenv.mkDerivation rec {
|
||||||
|
|
||||||
|
name = "betaflight-${version}";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "betaflight";
|
||||||
|
repo = "betaflight";
|
||||||
|
rev = "v${version}";
|
||||||
|
sha256 = "0vbjyxfjxgpaiiwvj5bscrlfikzp3wnxpmc4sxcz5yw5mwb9g428";
|
||||||
|
};
|
||||||
|
|
||||||
|
buildInputs = [
|
||||||
|
gcc-arm-embedded
|
||||||
|
python2
|
||||||
|
];
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
sed -ri "s/REVISION.*=.*git log.*/REVISION = ${builtins.substring 0 9 src.rev}/" Makefile # Let's not require git in shell
|
||||||
|
sed -ri "s/binary hex/hex/" Makefile # No need for anything besides .hex
|
||||||
|
'';
|
||||||
|
|
||||||
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
|
preBuild = ''
|
||||||
|
buildFlagsArray=(
|
||||||
|
"SKIP_TARGETS=${toString skipTargets}"
|
||||||
|
"GCC_REQUIRED_VERSION=$(arm-none-eabi-gcc -dumpversion)"
|
||||||
|
all
|
||||||
|
)
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
|
||||||
|
mkdir -p $out
|
||||||
|
cp obj/*.hex $out
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = with stdenv.lib; {
|
||||||
|
description = "Flight controller software (firmware) used to fly multi-rotor craft and fixed wing craft";
|
||||||
|
homepage = https://github.com/betaflight/betaflight;
|
||||||
|
license = licenses.gpl3;
|
||||||
|
maintainers = with maintainers; [ elitak ];
|
||||||
|
platforms = platforms.linux;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
@ -6998,6 +6998,8 @@ with pkgs;
|
|||||||
|
|
||||||
avr8burnomat = callPackage ../development/misc/avr8-burn-omat { };
|
avr8burnomat = callPackage ../development/misc/avr8-burn-omat { };
|
||||||
|
|
||||||
|
betaflight = callPackage ../development/stm32/betaflight { };
|
||||||
|
|
||||||
sourceFromHead = callPackage ../build-support/source-from-head-fun.nix {};
|
sourceFromHead = callPackage ../build-support/source-from-head-fun.nix {};
|
||||||
|
|
||||||
ecj = callPackage ../development/eclipse/ecj { };
|
ecj = callPackage ../development/eclipse/ecj { };
|
||||||
|
Loading…
Reference in New Issue
Block a user