skim: 0.15.7 -> 0.16.0 (#376410)
[NixPkgs.git] / pkgs / by-name / qg / qgroundcontrol / package.nix
blob758642bb91307110cb435ce09a700edf40169e9e
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   SDL2,
6   libsForQt5,
7   gst_all_1,
8   wayland,
9   pkg-config,
12 stdenv.mkDerivation rec {
13   pname = "qgroundcontrol";
14   version = "4.4.3";
16   propagatedBuildInputs = with libsForQt5; [
17     qtbase
18     qtcharts
19     qtlocation
20     qtserialport
21     qtsvg
22     qtquickcontrols2
23     qtgraphicaleffects
24     qtspeech
25     qtx11extras
26   ];
28   gstInputs = with gst_all_1; [
29     gstreamer
30     gst-plugins-base
31     (gst-plugins-good.override { qt5Support = true; })
32     gst-plugins-bad
33     gst-libav
34     wayland
35   ];
37   buildInputs = [ SDL2 ] ++ gstInputs ++ propagatedBuildInputs;
38   nativeBuildInputs =
39     [ pkg-config ]
40     ++ (with libsForQt5; [
41       qmake
42       qttools
43       wrapQtAppsHook
44     ]);
46   preConfigure = ''
47     mkdir build
48     cd build
49   '';
51   qmakeFlags = [
52     "CONFIG+=StableBuild"
53     # Default install tries to copy Qt files into package
54     "CONFIG+=QGC_DISABLE_BUILD_SETUP"
55     # Tries to download x86_64-only prebuilt binaries
56     "DEFINES+=DISABLE_AIRMAP"
57     "../qgroundcontrol.pro"
58   ];
60   installPhase = ''
61     runHook preInstall
63     cd ..
65     mkdir -p $out/share/applications
66     sed 's/Exec=.*$/Exec=QGroundControl/g' --in-place deploy/qgroundcontrol.desktop
67     cp -v deploy/qgroundcontrol.desktop $out/share/applications
69     mkdir -p $out/bin
70     cp -v build/staging/QGroundControl "$out/bin/"
72     mkdir -p $out/share/qgroundcontrol
73     cp -rv resources/ $out/share/qgroundcontrol
75     mkdir -p $out/share/pixmaps
76     cp -v resources/icons/qgroundcontrol.png $out/share/pixmaps
78     runHook postInstall
79   '';
81   postInstall = ''
82     qtWrapperArgs+=(--prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0")
83   '';
85   # TODO: package mavlink so we can build from a normal source tarball
86   src = fetchFromGitHub {
87     owner = "mavlink";
88     repo = "qgroundcontrol";
89     rev = "v${version}";
90     hash = "sha256-pHs9pRL5fAeRtDcNPCdqy4oPYyJ0mbJjLDlotFfjOl4=";
91     fetchSubmodules = true;
92   };
94   patches = [
95     ./disable-bad-message.patch
96   ];
98   meta = {
99     description = "Provides full ground station support and configuration for the PX4 and APM Flight Stacks";
100     homepage = "https://qgroundcontrol.com/";
101     changelog = "https://github.com/mavlink/qgroundcontrol/blob/master/ChangeLog.md";
102     license = lib.licenses.gpl3Plus;
103     platforms = lib.platforms.linux;
104     maintainers = with lib.maintainers; [
105       lopsided98
106       pandapip1
107     ];
108     mainProgram = "QGroundControl";
109   };