···1{ stdenv, fetchFromGitHub
2, gcc-arm-embedded, python2
3, skipTargets ? [
4- # These targets do not build for various unexplored reasons
5- # TODO ... fix them
6- "AFROMINI"
7- "ALIENWHOOP"
8- "BEEBRAIN"
9- "CJMCU"
10- "FRSKYF3"
11]}:
1213let
1415- version = "3.2.3";
1617in stdenv.mkDerivation rec {
18···21 src = fetchFromGitHub {
22 owner = "betaflight";
23 repo = "betaflight";
24- rev = "v${version}";
25- sha256 = "0vbjyxfjxgpaiiwvj5bscrlfikzp3wnxpmc4sxcz5yw5mwb9g428";
26 };
2728 buildInputs = [
···31 ];
3233 postPatch = ''
34- sed -ri "s/REVISION.*=.*git log.*/REVISION = ${builtins.substring 0 9 src.rev}/" Makefile # Let's not require git in shell
35 sed -ri "s/binary hex/hex/" Makefile # No need for anything besides .hex
36 '';
37···3940 preBuild = ''
41 buildFlagsArray=(
42- "SKIP_TARGETS=${toString skipTargets}"
43 "GCC_REQUIRED_VERSION=$(arm-none-eabi-gcc -dumpversion)"
44 all
45 )
···59 homepage = https://github.com/betaflight/betaflight;
60 license = licenses.gpl3;
61 maintainers = with maintainers; [ elitak ];
62- platforms = platforms.linux;
63 };
6465}
···1{ stdenv, fetchFromGitHub
2, gcc-arm-embedded, python2
3, skipTargets ? [
4+ # These targets do not build, for the reasons listed, along with the last version checked.
5+ # Probably all of the issues with these targets need to be addressed upstream.
6+ "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?
7+ "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?
8+ "FURYF3" # 3.4.0-rc4: flash region overflow
9+ "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?
010]}:
1112let
1314+ version = "3.4.0-rc4";
1516in stdenv.mkDerivation rec {
17···20 src = fetchFromGitHub {
21 owner = "betaflight";
22 repo = "betaflight";
23+ rev = "8e9e7574481b1abba9354b24f41eb31054943785"; # Always use a commit id here!
24+ sha256 = "1wyp23p876xbfi9z6gm4xn1nwss3myvrjjjq9pd3s0vf5gkclkg5";
25 };
2627 buildInputs = [
···30 ];
3132 postPatch = ''
33+ sed -ri "s/REVISION.*=.*git log.*/REVISION = ${builtins.substring 0 10 src.rev}/" Makefile # Simulate abbrev'd rev.
34 sed -ri "s/binary hex/hex/" Makefile # No need for anything besides .hex
35 '';
36···3839 preBuild = ''
40 buildFlagsArray=(
41+ "NOBUILD_TARGETS=${toString skipTargets}"
42 "GCC_REQUIRED_VERSION=$(arm-none-eabi-gcc -dumpversion)"
43 all
44 )
···58 homepage = https://github.com/betaflight/betaflight;
59 license = licenses.gpl3;
60 maintainers = with maintainers; [ elitak ];
61+ platforms = [ "i686-linux" "x86_64-linux" ];
62 };
6364}