about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/science/robotics/gazebo/default.nix
blob: 86572e73c75632883c119aa4d12dafb634fc9e14 (plain) (blame)
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
{ stdenv, fetchurl, cmake, pkgconfig, boost, protobuf, freeimage
  , boost-build, boost_process
  , xorg_sys_opengl, tbb, ogre, tinyxml-2
  , libtar, glxinfo,  libusb-compat-0_1, libxslt, ignition
  , pythonPackages, utillinux

  # these deps are hidden; cmake doesn't catch them
  , gazeboSimulator, sdformat ? gazeboSimulator.sdformat, curl, tinyxml, qt4
  , xlibsWrapper
  , withIgnitionTransport ? true
  , libav, withLibAvSupport ? true
  , openal, withAudioSupport ? false
  , withQuickBuild ? false, withHeadless ? false, withLowMemorySupport ? false
  , doxygen, withDocs ? true
  , bullet, withBulletEngineSupport ? false
  , graphviz, withModelEditorSchematicView ? true # graphviz needed for this view
  , gdal, withDigitalElevationTerrainsSupport ? true
  , gts, withConstructiveSolidGeometrySupport ? true
  , hdf5, withHdf5Support ? true
  , version ? "7.0.0"
  , src-sha256 ? "127q2g93kvmak2b6vhl13xzg56h09v14s4pki8wv7aqjv0c3whbl"
  , ...
}: with stdenv.lib;

stdenv.mkDerivation rec {
  inherit version;
  pname = "gazebo";

  src = fetchurl {
    url = "https://osrf-distributions.s3.amazonaws.com/gazebo/releases/${pname}-${version}.tar.bz2";
    sha256 = src-sha256;
  };

  enableParallelBuilding = true; # gazebo needs this so bad
  cmakeFlags = [
  "-DCMAKE_INSTALL_LIBDIR:PATH=lib"
  "-DCMAKE_INSTALL_INCLUDEDIR=include" ]
    ++ optional withQuickBuild [ "-DENABLE_TESTS_COMPILATION=False" ]
    ++ optional withLowMemorySupport [ "-DUSE_LOW_MEMORY_TESTS=True" ]
    ++ optional withHeadless [ "-DENABLE_SCREEN_TESTS=False" ];

  nativeBuildInputs = [ cmake pkgconfig ];

  propagatedNativeBuildInputs = [ boost boost-build boost_process protobuf ];

  buildInputs = [
    #cmake boost protobuf
    freeimage
    xorg_sys_opengl
    tbb
    ogre
    tinyxml-2
    libtar
    glxinfo
    libusb-compat-0_1
    libxslt
    ignition.math2
    sdformat
    pythonPackages.pyopengl

    # TODO: add these hidden deps to cmake configuration & submit upstream
    curl
    tinyxml
    xlibsWrapper
    qt4
  ] ++ optional stdenv.isLinux utillinux # on Linux needs uuid/uuid.h
    ++ optional withDocs doxygen
    ++ optional withLibAvSupport libav  #TODO: package rubygem-ronn and put it here
    ++ optional withAudioSupport openal
    ++ optional withBulletEngineSupport bullet
    ++ optional withIgnitionTransport ignition.transport
    ++ optional withModelEditorSchematicView graphviz
    ++ optional withDigitalElevationTerrainsSupport gdal
    ++ optional withConstructiveSolidGeometrySupport gts
    ++ optional withHdf5Support hdf5;

  meta = with stdenv.lib; {
    homepage = "http://gazebosim.org/";
    description = "Multi-robot simulator for outdoor environments";
    license = licenses.asl20;
    maintainers = with maintainers; [ pxc ];
    platforms = platforms.all;
  };
}