biglybt: 3.5.0.0 -> 3.6.0.0
[NixPkgs.git] / pkgs / applications / science / robotics / qgroundcontrol / default.nix
blob25b1f4e5d5ce63e9f24af1c0e9a59a562f485226
1 { lib, stdenv, fetchFromGitHub, SDL2, qtbase, qtcharts, qtlocation, qtserialport
2 , qtsvg, qtquickcontrols2, qtgraphicaleffects, qtspeech, qtx11extras, qmake
3 , qttools, gst_all_1, wayland, pkg-config, wrapQtAppsHook }:
5 stdenv.mkDerivation rec {
6   pname = "qgroundcontrol";
7   version = "4.3.0";
9   propagatedBuildInputs = [
10     qtbase qtcharts qtlocation qtserialport qtsvg qtquickcontrols2
11     qtgraphicaleffects qtspeech qtx11extras
12   ];
14   gstInputs = with gst_all_1; [
15     gstreamer
16     gst-plugins-base
17     (gst-plugins-good.override { qt5Support = true; })
18     gst-plugins-bad
19     gst-libav
20     wayland
21   ];
23   buildInputs = [ SDL2 ] ++ gstInputs ++ propagatedBuildInputs;
24   nativeBuildInputs = [ pkg-config qmake qttools wrapQtAppsHook ];
26   preConfigure = ''
27     mkdir build
28     cd build
29   '';
31   qmakeFlags = [
32     "CONFIG+=StableBuild"
33     # Default install tries to copy Qt files into package
34     "CONFIG+=QGC_DISABLE_BUILD_SETUP"
35     # Tries to download x86_64-only prebuilt binaries
36     "DEFINES+=DISABLE_AIRMAP"
37     "../qgroundcontrol.pro"
38   ];
40   installPhase = ''
41     runHook preInstall
43     cd ..
45     mkdir -p $out/share/applications
46     sed 's/Exec=.*$/Exec=QGroundControl/g' --in-place deploy/qgroundcontrol.desktop
47     cp -v deploy/qgroundcontrol.desktop $out/share/applications
49     mkdir -p $out/bin
50     cp -v build/staging/QGroundControl "$out/bin/"
52     mkdir -p $out/share/qgroundcontrol
53     cp -rv resources/ $out/share/qgroundcontrol
55     mkdir -p $out/share/pixmaps
56     cp -v resources/icons/qgroundcontrol.png $out/share/pixmaps
58     runHook postInstall
59   '';
61   postInstall = ''
62     qtWrapperArgs+=(--prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0")
63   '';
65   # TODO: package mavlink so we can build from a normal source tarball
66   src = fetchFromGitHub {
67     owner = "mavlink";
68     repo = pname;
69     rev = "v${version}";
70     sha256 = "sha256-a0+cpT413qi88PvaWQPxKABHfK7vbPE7B42n84n/SAk=";
71     fetchSubmodules = true;
72   };
74   meta = with lib; {
75     description = "Provides full ground station support and configuration for the PX4 and APM Flight Stacks";
76     homepage = "http://qgroundcontrol.com/";
77     license = licenses.gpl3Plus;
78     platforms = platforms.linux;
79     maintainers = with maintainers; [ lopsided98 ];
80     mainProgram = "QGroundControl";
81   };