···11{ stdenv, fetchFromGitHub
22, gcc-arm-embedded, python2
33, skipTargets ? [
44- # These targets do not build for various unexplored reasons
55- # TODO ... fix them
66- "AFROMINI"
77- "ALIENWHOOP"
88- "BEEBRAIN"
99- "CJMCU"
1010- "FRSKYF3"
44+ # These targets do not build, for the reasons listed, along with the last version checked.
55+ # Probably all of the issues with these targets need to be addressed upstream.
66+ "AG3X" # 3.4.0-rc4: has not specified a valid STM group, must be one of F1, F3, F405, F411 or F7x5. Have you prepared a valid target.mk?
77+ "ALIENWHOOP" # 3.4.0-rc4: has not specified a valid STM group, must be one of F1, F3, F405, F411 or F7x5. Have you prepared a valid target.mk?
88+ "FURYF3" # 3.4.0-rc4: flash region overflow
99+ "OMNINXT" # 3.4.0-rc4: has not specified a valid STM group, must be one of F1, F3, F405, F411 or F7x5. Have you prepared a valid target.mk?
1110]}:
12111312let
14131515- version = "3.2.3";
1414+ version = "3.4.0-rc4";
16151716in stdenv.mkDerivation rec {
1817···2120 src = fetchFromGitHub {
2221 owner = "betaflight";
2322 repo = "betaflight";
2424- rev = "v${version}";
2525- sha256 = "0vbjyxfjxgpaiiwvj5bscrlfikzp3wnxpmc4sxcz5yw5mwb9g428";
2323+ rev = "8e9e7574481b1abba9354b24f41eb31054943785"; # Always use a commit id here!
2424+ sha256 = "1wyp23p876xbfi9z6gm4xn1nwss3myvrjjjq9pd3s0vf5gkclkg5";
2625 };
27262827 buildInputs = [
···3130 ];
32313332 postPatch = ''
3434- sed -ri "s/REVISION.*=.*git log.*/REVISION = ${builtins.substring 0 9 src.rev}/" Makefile # Let's not require git in shell
3333+ sed -ri "s/REVISION.*=.*git log.*/REVISION = ${builtins.substring 0 10 src.rev}/" Makefile # Simulate abbrev'd rev.
3534 sed -ri "s/binary hex/hex/" Makefile # No need for anything besides .hex
3635 '';
3736···39384039 preBuild = ''
4140 buildFlagsArray=(
4242- "SKIP_TARGETS=${toString skipTargets}"
4141+ "NOBUILD_TARGETS=${toString skipTargets}"
4342 "GCC_REQUIRED_VERSION=$(arm-none-eabi-gcc -dumpversion)"
4443 all
4544 )
···5958 homepage = https://github.com/betaflight/betaflight;
6059 license = licenses.gpl3;
6160 maintainers = with maintainers; [ elitak ];
6262- platforms = platforms.linux;
6161+ platforms = [ "i686-linux" "x86_64-linux" ];
6362 };
64636564}