2020-07-11 20:27:23 +01:00
|
|
|
{ lib, mkDerivation, fetchFromGitHub, SDL2
|
2019-10-20 18:27:23 +01:00
|
|
|
, qtbase, qtcharts, qtlocation, qtserialport, qtsvg, qtquickcontrols2
|
2020-06-04 22:41:40 +01:00
|
|
|
, qtgraphicaleffects, qtspeech, qtx11extras, qmake, qttools
|
2021-01-19 06:50:56 +00:00
|
|
|
, gst_all_1, wayland, pkg-config
|
2016-03-24 23:06:20 +00:00
|
|
|
}:
|
|
|
|
|
2019-10-20 18:27:23 +01:00
|
|
|
mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "qgroundcontrol";
|
2021-09-13 05:11:37 +01:00
|
|
|
version = "4.1.4";
|
2016-03-24 23:06:20 +00:00
|
|
|
|
|
|
|
qtInputs = [
|
2019-10-20 18:27:23 +01:00
|
|
|
qtbase qtcharts qtlocation qtserialport qtsvg qtquickcontrols2
|
2020-06-04 22:41:40 +01:00
|
|
|
qtgraphicaleffects qtspeech qtx11extras
|
2016-03-24 23:06:20 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
gstInputs = with gst_all_1; [
|
2020-06-04 22:41:40 +01:00
|
|
|
gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad wayland
|
2016-03-24 23:06:20 +00:00
|
|
|
];
|
|
|
|
|
2019-10-20 18:27:23 +01:00
|
|
|
buildInputs = [ SDL2 ] ++ gstInputs ++ qtInputs;
|
2021-01-19 06:50:56 +00:00
|
|
|
nativeBuildInputs = [ pkg-config qmake qttools ];
|
2016-03-24 23:06:20 +00:00
|
|
|
|
2016-05-29 17:51:07 +01:00
|
|
|
preConfigure = ''
|
|
|
|
mkdir build
|
|
|
|
cd build
|
|
|
|
'';
|
|
|
|
|
2018-01-12 18:18:08 +00:00
|
|
|
qmakeFlags = [
|
2021-02-06 19:43:52 +00:00
|
|
|
"CONFIG+=StableBuild"
|
2018-01-12 18:18:08 +00:00
|
|
|
# Default install tries to copy Qt files into package
|
|
|
|
"CONFIG+=QGC_DISABLE_BUILD_SETUP"
|
|
|
|
"../qgroundcontrol.pro"
|
|
|
|
];
|
2016-05-29 17:51:07 +01:00
|
|
|
|
2016-03-24 23:06:20 +00:00
|
|
|
installPhase = ''
|
2020-06-04 22:41:40 +01:00
|
|
|
runHook preInstall
|
|
|
|
|
2016-05-29 17:51:07 +01:00
|
|
|
cd ..
|
2018-01-12 18:18:08 +00:00
|
|
|
|
2016-03-24 23:06:20 +00:00
|
|
|
mkdir -p $out/share/applications
|
2018-11-11 13:25:13 +00:00
|
|
|
sed 's/Exec=.*$/Exec=QGroundControl/g' --in-place deploy/qgroundcontrol.desktop
|
2018-01-12 18:18:08 +00:00
|
|
|
cp -v deploy/qgroundcontrol.desktop $out/share/applications
|
|
|
|
|
2016-03-24 23:06:20 +00:00
|
|
|
mkdir -p $out/bin
|
2021-02-06 19:43:52 +00:00
|
|
|
cp -v build/staging/QGroundControl "$out/bin/"
|
2018-01-12 18:18:08 +00:00
|
|
|
|
2016-03-24 23:06:20 +00:00
|
|
|
mkdir -p $out/share/qgroundcontrol
|
|
|
|
cp -rv resources/ $out/share/qgroundcontrol
|
2018-01-12 18:18:08 +00:00
|
|
|
|
2016-03-24 23:06:20 +00:00
|
|
|
mkdir -p $out/share/pixmaps
|
|
|
|
cp -v resources/icons/qgroundcontrol.png $out/share/pixmaps
|
2020-06-04 22:41:40 +01:00
|
|
|
|
|
|
|
runHook postInstall
|
2016-03-24 23:06:20 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
2020-06-04 22:41:40 +01:00
|
|
|
qtWrapperArgs+=(--prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0")
|
2016-03-24 23:06:20 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
# TODO: package mavlink so we can build from a normal source tarball
|
2020-07-11 20:27:23 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mavlink";
|
|
|
|
repo = pname;
|
2019-10-20 18:27:23 +01:00
|
|
|
rev = "v${version}";
|
2021-09-13 05:11:37 +01:00
|
|
|
sha256 = "0lhc36jpy7a5bnysqi574nk5izglj557mf8n9lcsgvzwxlkb2rbf";
|
2016-03-24 23:06:20 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
2019-10-20 18:27:23 +01:00
|
|
|
meta = with lib; {
|
2016-06-20 11:53:46 +01:00
|
|
|
description = "Provides full ground station support and configuration for the PX4 and APM Flight Stacks";
|
2019-10-20 18:27:23 +01:00
|
|
|
homepage = "http://qgroundcontrol.org/";
|
2018-01-12 18:18:08 +00:00
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
platforms = platforms.linux;
|
2020-06-04 22:41:40 +01:00
|
|
|
maintainers = with maintainers; [ lopsided98 ];
|
2016-03-24 23:06:20 +00:00
|
|
|
};
|
|
|
|
}
|