nixpkgs/pkgs/applications/science/robotics/qgroundcontrol/default.nix

77 lines
2 KiB
Nix
Raw Normal View History

2020-07-11 19:27:23 +00:00
{ lib, mkDerivation, fetchFromGitHub, SDL2
, qtbase, qtcharts, qtlocation, qtserialport, qtsvg, qtquickcontrols2
2020-06-04 21:41:40 +00:00
, qtgraphicaleffects, qtspeech, qtx11extras, qmake, qttools
, gst_all_1, wayland, pkg-config
2016-03-24 23:06:20 +00:00
}:
mkDerivation rec {
pname = "qgroundcontrol";
2021-05-14 00:24:22 +00:00
version = "4.1.3";
2016-03-24 23:06:20 +00:00
qtInputs = [
qtbase qtcharts qtlocation qtserialport qtsvg qtquickcontrols2
2020-06-04 21:41:40 +00:00
qtgraphicaleffects qtspeech qtx11extras
2016-03-24 23:06:20 +00:00
];
gstInputs = with gst_all_1; [
2020-06-04 21:41:40 +00:00
gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad wayland
2016-03-24 23:06:20 +00:00
];
buildInputs = [ SDL2 ] ++ gstInputs ++ qtInputs;
nativeBuildInputs = [ pkg-config qmake qttools ];
2016-03-24 23:06:20 +00:00
2016-05-29 16:51:07 +00:00
preConfigure = ''
mkdir build
cd build
'';
qmakeFlags = [
2021-02-06 19:43:52 +00:00
"CONFIG+=StableBuild"
# Default install tries to copy Qt files into package
"CONFIG+=QGC_DISABLE_BUILD_SETUP"
"../qgroundcontrol.pro"
];
2016-05-29 16:51:07 +00:00
2016-03-24 23:06:20 +00:00
installPhase = ''
2020-06-04 21:41:40 +00:00
runHook preInstall
2016-05-29 16:51:07 +00:00
cd ..
2016-03-24 23:06:20 +00:00
mkdir -p $out/share/applications
sed 's/Exec=.*$/Exec=QGroundControl/g' --in-place deploy/qgroundcontrol.desktop
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/"
2016-03-24 23:06:20 +00:00
mkdir -p $out/share/qgroundcontrol
cp -rv resources/ $out/share/qgroundcontrol
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 21:41:40 +00:00
runHook postInstall
2016-03-24 23:06:20 +00:00
'';
postInstall = ''
2020-06-04 21:41:40 +00: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 19:27:23 +00:00
src = fetchFromGitHub {
owner = "mavlink";
repo = pname;
rev = "v${version}";
2021-05-14 00:24:22 +00:00
sha256 = "0fbf564vzckvy1dc8f6yd8vpnzwzsgynva13bl2ks06768rrq9fb";
2016-03-24 23:06:20 +00:00
fetchSubmodules = true;
};
meta = with lib; {
description = "Provides full ground station support and configuration for the PX4 and APM Flight Stacks";
homepage = "http://qgroundcontrol.org/";
license = licenses.gpl3Plus;
platforms = platforms.linux;
2020-06-04 21:41:40 +00:00
maintainers = with maintainers; [ lopsided98 ];
2016-03-24 23:06:20 +00:00
};
}