2019-10-20 10:27:23 -07:00
|
|
|
{ lib, mkDerivation, fetchgit, SDL2
|
|
|
|
, qtbase, qtcharts, qtlocation, qtserialport, qtsvg, qtquickcontrols2
|
|
|
|
, qtgraphicaleffects, qtspeech, qmake
|
2018-07-20 17:44:44 -07:00
|
|
|
, makeWrapper
|
|
|
|
, gst_all_1, pkgconfig
|
2016-03-24 16:06:20 -07:00
|
|
|
}:
|
|
|
|
|
2019-10-20 10:27:23 -07:00
|
|
|
mkDerivation rec {
|
2019-08-15 05:41:18 -07:00
|
|
|
pname = "qgroundcontrol";
|
2019-10-20 10:27:23 -07:00
|
|
|
version = "3.5.5";
|
2016-03-24 16:06:20 -07:00
|
|
|
|
|
|
|
qtInputs = [
|
2019-10-20 10:27:23 -07:00
|
|
|
qtbase qtcharts qtlocation qtserialport qtsvg qtquickcontrols2
|
|
|
|
qtgraphicaleffects qtspeech
|
2016-03-24 16:06:20 -07:00
|
|
|
];
|
|
|
|
|
|
|
|
gstInputs = with gst_all_1; [
|
|
|
|
gstreamer gst-plugins-base
|
|
|
|
];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
2019-10-20 10:27:23 -07:00
|
|
|
buildInputs = [ SDL2 ] ++ gstInputs ++ qtInputs;
|
2017-05-17 12:26:11 -07:00
|
|
|
nativeBuildInputs = [ pkgconfig makeWrapper qmake ];
|
2016-03-24 16:06:20 -07:00
|
|
|
|
2016-05-29 09:51:07 -07:00
|
|
|
preConfigure = ''
|
|
|
|
mkdir build
|
|
|
|
cd build
|
|
|
|
'';
|
|
|
|
|
2020-01-05 14:41:37 -08:00
|
|
|
NIX_CFLAGS_COMPILE = [ "-Wno-address-of-packed-member" ]; # Don't litter logs with these warnings
|
|
|
|
|
2018-01-12 10:18:08 -08:00
|
|
|
qmakeFlags = [
|
|
|
|
# Default install tries to copy Qt files into package
|
|
|
|
"CONFIG+=QGC_DISABLE_BUILD_SETUP"
|
|
|
|
"../qgroundcontrol.pro"
|
|
|
|
];
|
2016-05-29 09:51:07 -07:00
|
|
|
|
2016-03-24 16:06:20 -07:00
|
|
|
installPhase = ''
|
2016-05-29 09:51:07 -07:00
|
|
|
cd ..
|
2018-01-12 10:18:08 -08:00
|
|
|
|
2016-03-24 16:06:20 -07:00
|
|
|
mkdir -p $out/share/applications
|
2018-11-11 05:25:13 -08:00
|
|
|
sed 's/Exec=.*$/Exec=QGroundControl/g' --in-place deploy/qgroundcontrol.desktop
|
2018-01-12 10:18:08 -08:00
|
|
|
cp -v deploy/qgroundcontrol.desktop $out/share/applications
|
|
|
|
|
2016-03-24 16:06:20 -07:00
|
|
|
mkdir -p $out/bin
|
2018-01-12 10:18:08 -08:00
|
|
|
cp -v build/release/QGroundControl "$out/bin/"
|
|
|
|
|
2016-03-24 16:06:20 -07:00
|
|
|
mkdir -p $out/share/qgroundcontrol
|
|
|
|
cp -rv resources/ $out/share/qgroundcontrol
|
2018-01-12 10:18:08 -08:00
|
|
|
|
2016-03-24 16:06:20 -07:00
|
|
|
mkdir -p $out/share/pixmaps
|
|
|
|
cp -v resources/icons/qgroundcontrol.png $out/share/pixmaps
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
2017-05-17 12:26:11 -07:00
|
|
|
wrapProgram "$out/bin/qgroundcontrol" \
|
2016-03-24 16:06:20 -07:00
|
|
|
--prefix GST_PLUGIN_SYSTEM_PATH : "$GST_PLUGIN_SYSTEM_PATH"
|
|
|
|
'';
|
|
|
|
|
|
|
|
# TODO: package mavlink so we can build from a normal source tarball
|
|
|
|
src = fetchgit {
|
|
|
|
url = "https://github.com/mavlink/qgroundcontrol.git";
|
2019-10-20 10:27:23 -07:00
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "05zy6w9lwwh254wa8c6wysa67kk0flywcvipii9b1rmy47slflhs";
|
2016-03-24 16:06:20 -07:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
2019-10-20 10:27:23 -07:00
|
|
|
meta = with lib; {
|
2016-06-20 03:53:46 -07:00
|
|
|
description = "Provides full ground station support and configuration for the PX4 and APM Flight Stacks";
|
2019-10-20 10:27:23 -07:00
|
|
|
homepage = "http://qgroundcontrol.org/";
|
2018-01-12 10:18:08 -08:00
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ pxc ];
|
2016-03-24 16:06:20 -07:00
|
|
|
};
|
|
|
|
}
|