2020-07-18 16:06:22 +00:00
|
|
|
{ lib, mkDerivation, fetchFromGitHub, SDL2
|
2020-04-24 23:36:52 +00:00
|
|
|
, qtbase, qtcharts, qtlocation, qtserialport, qtsvg, qtquickcontrols2
|
2020-06-18 07:06:33 +00:00
|
|
|
, qtgraphicaleffects, qtspeech, qtx11extras, qmake, qttools
|
2021-02-05 17:12:51 +00:00
|
|
|
, gst_all_1, wayland, pkg-config
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
mkDerivation rec {
|
|
|
|
pname = "qgroundcontrol";
|
2022-10-30 15:09:59 +00:00
|
|
|
version = "4.2.4";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
qtInputs = [
|
|
|
|
qtbase qtcharts qtlocation qtserialport qtsvg qtquickcontrols2
|
2020-06-18 07:06:33 +00:00
|
|
|
qtgraphicaleffects qtspeech qtx11extras
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
gstInputs = with gst_all_1; [
|
2022-08-12 12:06:08 +00:00
|
|
|
gstreamer
|
|
|
|
gst-plugins-base
|
|
|
|
(gst-plugins-good.override { qt5Support = true; })
|
|
|
|
gst-plugins-bad
|
|
|
|
gst-libav
|
|
|
|
wayland
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [ SDL2 ] ++ gstInputs ++ qtInputs;
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config qmake qttools ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
mkdir build
|
|
|
|
cd build
|
|
|
|
'';
|
|
|
|
|
|
|
|
qmakeFlags = [
|
2021-02-13 14:23:35 +00:00
|
|
|
"CONFIG+=StableBuild"
|
2020-04-24 23:36:52 +00:00
|
|
|
# Default install tries to copy Qt files into package
|
|
|
|
"CONFIG+=QGC_DISABLE_BUILD_SETUP"
|
2022-02-20 05:27:41 +00:00
|
|
|
# Tries to download x86_64-only prebuilt binaries
|
|
|
|
"DEFINES+=DISABLE_AIRMAP"
|
2020-04-24 23:36:52 +00:00
|
|
|
"../qgroundcontrol.pro"
|
|
|
|
];
|
|
|
|
|
|
|
|
installPhase = ''
|
2020-06-18 07:06:33 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
cd ..
|
|
|
|
|
|
|
|
mkdir -p $out/share/applications
|
|
|
|
sed 's/Exec=.*$/Exec=QGroundControl/g' --in-place deploy/qgroundcontrol.desktop
|
|
|
|
cp -v deploy/qgroundcontrol.desktop $out/share/applications
|
|
|
|
|
|
|
|
mkdir -p $out/bin
|
2021-02-13 14:23:35 +00:00
|
|
|
cp -v build/staging/QGroundControl "$out/bin/"
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
mkdir -p $out/share/qgroundcontrol
|
|
|
|
cp -rv resources/ $out/share/qgroundcontrol
|
|
|
|
|
|
|
|
mkdir -p $out/share/pixmaps
|
|
|
|
cp -v resources/icons/qgroundcontrol.png $out/share/pixmaps
|
2020-06-18 07:06:33 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
2020-06-18 07:06:33 +00:00
|
|
|
qtWrapperArgs+=(--prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0")
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
# TODO: package mavlink so we can build from a normal source tarball
|
2020-07-18 16:06:22 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mavlink";
|
|
|
|
repo = pname;
|
2020-04-24 23:36:52 +00:00
|
|
|
rev = "v${version}";
|
2022-10-30 15:09:59 +00:00
|
|
|
sha256 = "sha256-pPxqYxBlw9re1rlUU2qz0gFRmT+PmslrcBv97VEG84k=";
|
2020-04-24 23:36:52 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
patches = [
|
|
|
|
# fix build problems caused by https://github.com/mavlink/qgroundcontrol/pull/10132
|
|
|
|
# remove once updated past 4.2.0
|
|
|
|
./fix-10132.patch
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Provides full ground station support and configuration for the PX4 and APM Flight Stacks";
|
2022-02-20 05:27:41 +00:00
|
|
|
homepage = "http://qgroundcontrol.com/";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
platforms = platforms.linux;
|
2020-06-18 07:06:33 +00:00
|
|
|
maintainers = with maintainers; [ lopsided98 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|