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-02-20 05:27:41 +00:00
|
|
|
version = "4.2.0";
|
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; [
|
2020-06-18 07:06:33 +00:00
|
|
|
gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad 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-02-20 05:27:41 +00:00
|
|
|
sha256 = "sha256-TBnJQKO9cwxP9q+bIB1CaGnm9npymJ3iEAD9kPJi9JA=";
|
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 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|