@@ -0,0 +1,81 @@
1+{ stdenv, fetchurl, cmake, pkgconfig, boost, protobuf, freeimage
2+ , boost-build, boost_process
3+ , xorg_sys_opengl, tbb, ogre, tinyxml-2
4+ , libtar, glxinfo, libusb, libxslt, ruby, ignition
5+ , pythonPackages, utillinux
6+
7+ # these deps are hidden; cmake doesn't catch them
8+ , gazeboSimulator, sdformat ? gazeboSimulator.sdformat, curl, tinyxml, kde4, x11
9+ , withIgnitionTransport ? true
10+ , libav, withLibAvSupport ? true
11+ , openal, withAudioSupport ? false
12+ , withQuickBuild ? false, withHeadless ? false, withLowMemorySupport ? false
13+ , doxygen, withDocs ? true
14+ , bullet, withBulletEngineSupport ? false
15+ , graphviz, withModelEditorSchematicView ? true # graphviz needed for this view
16+ , gdal, withDigitalElevationTerrainsSupport ? true
17+ , gts, withConstructiveSolidGeometrySupport ? true
18+ , hdf5, withHdf5Support ? true
19+ , version ? "7.0.0"
20+ , src-sha256 ? "127q2g93kvmak2b6vhl13xzg56h09v14s4pki8wv7aqjv0c3whbl"
21+ , ...
22+}: with stdenv.lib;
23+
24+stdenv.mkDerivation rec {
25+ inherit version;
26+ name = "gazebo-${version}";
27+
28+ src = fetchurl {
29+ url = "http://osrf-distributions.s3.amazonaws.com/gazebo/releases/${name}.tar.bz2";
30+ sha256 = src-sha256;
31+ };
32+
33+ enableParallelBuilding = true; # gazebo needs this so bad
34+ cmakeFlags = []
35+ ++ optional withQuickBuild [ "-DENABLE_TESTS_COMPILATION=False" ]
36+ ++ optional withLowMemorySupport [ "-DUSE_LOW_MEMORY_TESTS=True" ]
37+ ++ optional withHeadless [ "-DENABLE_SCREEN_TESTS=False" ];
38+
39+ buildInputs = [
40+ #cmake pkgconfig boost protobuf
41+ freeimage
42+ xorg_sys_opengl
43+ tbb
44+ ogre
45+ tinyxml-2
46+ libtar
47+ glxinfo
48+ libusb
49+ libxslt
50+ ignition.math2
51+ sdformat
52+ pythonPackages.pyopengl
53+
54+ # TODO: add these hidden deps to cmake configuration & submit upstream
55+ curl
56+ tinyxml
57+ x11
58+ kde4.qt4
59+ ] ++ optional stdenv.isLinux utillinux # on Linux needs uuid/uuid.h
60+ ++ optional withDocs doxygen
61+ ++ optional withLibAvSupport libav #TODO: package rubygem-ronn and put it here
62+ ++ optional withAudioSupport openal
63+ ++ optional withBulletEngineSupport bullet
64+ ++ optional withIgnitionTransport ignition.transport
65+ ++ optional withModelEditorSchematicView graphviz
66+ ++ optional withDigitalElevationTerrainsSupport gdal
67+ ++ optional withConstructiveSolidGeometrySupport gts
68+ ++ optional withHdf5Support hdf5;
69+
70+ nativeBuildInputs = [ cmake pkgconfig ];
71+
72+ propagatedNativeBuildInputs = [ boost boost-build boost_process protobuf ];
73+
74+ meta = with stdenv.lib; {
75+ homepage = http://gazebosim.org/;
76+ description = "Multi-robot simulator for outdoor environments";
77+ license = licenses.asl20;
78+ maintainers = with maintainers; [ pxc ];
79+ platforms = platforms.all;
80+ };
81+}