2016-08-24 21:30:23 +00:00
|
|
|
{ stdenv, fetchgit, git, espeak, SDL, udev, doxygen, cmake
|
2016-03-24 23:06:20 +00:00
|
|
|
, qtbase, qtlocation, qtserialport, qtdeclarative, qtconnectivity, qtxmlpatterns
|
2016-04-16 19:59:18 +00:00
|
|
|
, qtsvg, qtquick1, qtquickcontrols, qtgraphicaleffects, qmakeHook
|
2016-03-24 23:06:20 +00:00
|
|
|
, makeQtWrapper, lndir
|
2017-02-26 19:40:56 +00:00
|
|
|
, gst_all_1, qt-gstreamer1, pkgconfig, glibc
|
2016-03-24 23:06:20 +00:00
|
|
|
, version ? "2.9.4"
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "qgroundcontrol-${version}";
|
|
|
|
buildInputs = [
|
|
|
|
SDL udev doxygen git
|
|
|
|
] ++ gstInputs;
|
|
|
|
|
|
|
|
qtInputs = [
|
|
|
|
qtbase qtlocation qtserialport qtdeclarative qtconnectivity qtxmlpatterns qtsvg
|
|
|
|
qtquick1 qtquickcontrols qtgraphicaleffects
|
|
|
|
];
|
|
|
|
|
|
|
|
gstInputs = with gst_all_1; [
|
|
|
|
gstreamer gst-plugins-base
|
|
|
|
];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
nativeBuildInputs = [
|
2016-04-16 19:59:18 +00:00
|
|
|
pkgconfig makeQtWrapper qmakeHook
|
2016-03-24 23:06:20 +00:00
|
|
|
] ++ qtInputs;
|
|
|
|
|
|
|
|
patches = [ ./0001-fix-gcc-cmath-namespace-issues.patch ];
|
2016-06-19 08:18:30 +00:00
|
|
|
postPatch = ''
|
|
|
|
sed '1i#include <cmath>' -i src/Vehicle/Vehicle.cc \
|
|
|
|
-i src/comm/{QGCFlightGearLink,QGCJSBSimLink}.cc \
|
|
|
|
-i src/{uas/UAS,ui/QGCDataPlot2D}.cc
|
|
|
|
'';
|
2016-03-24 23:06:20 +00:00
|
|
|
|
2016-05-29 16:51:07 +00:00
|
|
|
preConfigure = ''
|
|
|
|
mkdir build
|
|
|
|
cd build
|
|
|
|
'';
|
|
|
|
|
|
|
|
qmakeFlags = [ "../qgroundcontrol.pro" ];
|
|
|
|
|
2016-03-24 23:06:20 +00:00
|
|
|
installPhase = ''
|
2016-05-29 16:51:07 +00:00
|
|
|
cd ..
|
2016-03-24 23:06:20 +00:00
|
|
|
mkdir -p $out/share/applications
|
|
|
|
cp -v qgroundcontrol.desktop $out/share/applications
|
|
|
|
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp -v build/release/qgroundcontrol "$out/bin/"
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
# we need to link to our Qt deps in our own output if we want
|
|
|
|
# this package to work without being installed as a system pkg
|
|
|
|
mkdir -p $out/lib/qt5 $out/etc/xdg
|
|
|
|
for pkg in $qtInputs; do
|
|
|
|
if [[ -d $pkg/lib/qt5 ]]; then
|
|
|
|
for dir in lib/qt5 share etc/xdg; do
|
|
|
|
if [[ -d $pkg/$dir ]]; then
|
|
|
|
${lndir}/bin/lndir "$pkg/$dir" "$out/$dir"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
wrapQtProgram "$out/bin/qgroundcontrol" \
|
|
|
|
--prefix GST_PLUGIN_SYSTEM_PATH : "$GST_PLUGIN_SYSTEM_PATH"
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
|
|
# TODO: package mavlink so we can build from a normal source tarball
|
|
|
|
src = fetchgit {
|
|
|
|
url = "https://github.com/mavlink/qgroundcontrol.git";
|
|
|
|
rev = "refs/tags/v${version}";
|
2016-06-02 11:26:44 +00:00
|
|
|
sha256 = "0isr0zamhvr853c94lblazkilil6zzmvf7afs3mxgn07jn9wrqz3";
|
2016-03-24 23:06:20 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = {
|
2016-06-20 10:53:46 +00:00
|
|
|
description = "Provides full ground station support and configuration for the PX4 and APM Flight Stacks";
|
2016-03-24 23:06:20 +00:00
|
|
|
homepage = http://qgroundcontrol.org/;
|
|
|
|
license = stdenv.lib.licenses.gpl3Plus;
|
|
|
|
platforms = with stdenv.lib.platforms; linux;
|
|
|
|
maintainers = with stdenv.lib.maintainers; [ pxc ];
|
2017-03-24 18:35:27 +00:00
|
|
|
broken = true; # relies improperly on private Qt 5.5 headers
|
2016-03-24 23:06:20 +00:00
|
|
|
};
|
|
|
|
}
|