aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/pkgs/applications/science/robotics/apmplanner2/default.nix
blob: e6d1c544ee4c30255990dabd7771fc9c06a2bda6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{ lib, mkDerivation, fetchFromGitHub, fetchpatch, qmake
, qtbase, qtscript, qtwebkit, qtserialport, qtsvg, qtdeclarative, qtquickcontrols2
, alsaLib, libsndfile, flite, openssl, udev, SDL2
}:

mkDerivation rec {
  pname = "apmplanner2";
  version = "2.0.28-rc1";

  src = fetchFromGitHub {
    owner = "ArduPilot";
    repo = "apm_planner";
    rev = version;
    sha256 = "18yn8bdz5hmgb0m5hlk8bibz4cj4g25w75pm1rvc4ds0mr1qgyjd";
  };

  buildInputs = [
    alsaLib libsndfile flite openssl udev SDL2
    qtbase qtscript qtwebkit qtserialport qtsvg qtdeclarative qtquickcontrols2
  ];

  nativeBuildInputs = [ qmake ];

  qmakeFlags = [ "apm_planner.pro" ];

  # this ugly hack is necessary, as `bin/apmplanner2` needs the contents of `share/APMPlanner2` inside of `bin/`
  preFixup = ''
    ln --relative --symbolic $out/share/APMPlanner2/* $out/bin/
    substituteInPlace $out/share/applications/apmplanner2.desktop \
      --replace /usr $out
  '';

  enableParallelBuilding = true;

  meta = {
    description = "Ground station software for autonomous vehicles";
    longDescription = ''
      A GUI ground control station for autonomous vehicles using the MAVLink protocol.
      Includes support for the APM and PX4 based controllers.
    '';
    homepage = "https://ardupilot.org/planner2/";
    license = lib.licenses.gpl3;
    maintainers = with lib.maintainers; [ wucke13 ];
  };
}