2019-06-16 20:59:06 +01:00
|
|
|
{stdenv, fetchurl, unzip, makeDesktopItem, nwjs, wrapGAppsHook, gsettings-desktop-schemas, gtk3 }:
|
2018-11-07 13:24:19 +00:00
|
|
|
|
|
|
|
let
|
2019-10-13 10:58:00 +01:00
|
|
|
pname = "betaflight-configurator";
|
2018-11-07 13:24:19 +00:00
|
|
|
desktopItem = makeDesktopItem {
|
2019-10-13 10:58:00 +01:00
|
|
|
name = pname;
|
|
|
|
exec = pname;
|
|
|
|
icon = pname;
|
2018-11-07 13:24:19 +00:00
|
|
|
comment = "Betaflight configuration tool";
|
|
|
|
desktopName = "Betaflight Configurator";
|
|
|
|
genericName = "Flight controller configuration tool";
|
|
|
|
};
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2019-10-13 10:58:00 +01:00
|
|
|
inherit pname;
|
|
|
|
version = "10.6.0";
|
2018-11-07 13:24:19 +00:00
|
|
|
src = fetchurl {
|
2019-10-13 10:58:00 +01:00
|
|
|
url = "https://github.com/betaflight/${pname}/releases/download/${version}/${pname}_${version}_linux64.zip";
|
|
|
|
sha256 = "09hayzhwangh8b81r038p320vbg0xxlyzrdp9pcmfyxp6s00xslw";
|
2018-11-07 13:24:19 +00:00
|
|
|
};
|
|
|
|
|
2019-05-31 11:12:06 +01:00
|
|
|
nativeBuildInputs = [ wrapGAppsHook ];
|
|
|
|
|
|
|
|
buildInputs = [ unzip gsettings-desktop-schemas gtk3 ];
|
2018-11-07 13:24:19 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin \
|
2019-10-13 10:58:00 +01:00
|
|
|
$out/opt/${pname}
|
2018-11-07 13:24:19 +00:00
|
|
|
|
2019-10-13 10:58:00 +01:00
|
|
|
cp -r . $out/opt/${pname}/
|
|
|
|
install -m 444 -D icon/bf_icon_128.png $out/share/icons/hicolor/128x128/apps/${pname}.png
|
2018-11-07 13:24:19 +00:00
|
|
|
cp -r ${desktopItem}/share/applications $out/share/
|
|
|
|
|
2019-10-13 10:58:00 +01:00
|
|
|
makeWrapper ${nwjs}/bin/nw $out/bin/${pname} --add-flags $out/opt/${pname}
|
2018-11-07 13:24:19 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "The Betaflight flight control system configuration tool";
|
|
|
|
longDescription = ''
|
|
|
|
A crossplatform configuration tool for the Betaflight flight control system.
|
|
|
|
Various types of aircraft are supported by the tool and by Betaflight, e.g.
|
|
|
|
quadcopters, hexacopters, octocopters and fixed-wing aircraft.
|
|
|
|
'';
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/betaflight/betaflight/wiki";
|
2018-11-07 13:24:19 +00:00
|
|
|
license = licenses.gpl3;
|
|
|
|
maintainers = with maintainers; [ wucke13 ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|