2023-05-24 13:37:59 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, SDL2, qtbase, qtcharts, qtlocation, qtserialport
|
|
|
|
, qtsvg, qtquickcontrols2, qtgraphicaleffects, qtspeech, qtx11extras, qmake
|
|
|
|
, qttools, gst_all_1, wayland, pkg-config, wrapQtAppsHook }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "qgroundcontrol";
|
2023-08-04 22:07:22 +00:00
|
|
|
version = "4.2.8";
|
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;
|
2023-05-24 13:37:59 +00:00
|
|
|
nativeBuildInputs = [ pkg-config qmake qttools wrapQtAppsHook ];
|
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}";
|
2023-08-04 22:07:22 +00:00
|
|
|
sha256 = "sha256-EmGtVy/cHiZ2SqOOKmt9vCUQbyT5Sl8XnkRlhn9BdvA=";
|
2020-04-24 23:36:52 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
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 ];
|
2023-05-24 13:37:59 +00:00
|
|
|
mainProgram = "QGroundControl";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|