1 { lib, stdenv, fetchFromGitHub, cmake, libGLU, libGL, freeglut
7 version = "2019-03-27";
9 src = fetchFromGitHub {
12 # roboschool needs the HEAD of a specific branch of this fork, see
13 # https://github.com/openai/roboschool/issues/126#issuecomment-421643980
14 # https://github.com/openai/roboschool/pull/62
15 # https://github.com/openai/roboschool/issues/124
16 rev = "3687507ddc04a15de2c5db1e349ada3f2b34b3d6";
17 sha256 = "1wd7vj9136dl7lfb8ll0rc2fdl723y3ls9ipp7657yfl2xrqhvkb";
20 nativeBuildInputs = [ cmake ];
21 buildInputs = lib.optionals stdenv.isLinux [ libGLU libGL freeglut ]
22 ++ lib.optionals stdenv.isDarwin [ Cocoa OpenGL ];
24 patches = [ ./gwen-narrowing.patch ];
26 postPatch = lib.optionalString stdenv.isDarwin ''
27 sed -i 's/FIND_PACKAGE(OpenGL)//' CMakeLists.txt
28 sed -i 's/FIND_LIBRARY(COCOA_LIBRARY Cocoa)//' CMakeLists.txt
32 "-DBUILD_SHARED_LIBS=ON"
33 "-DBUILD_CPU_DEMOS=OFF"
34 "-DINSTALL_EXTRA_LIBS=ON"
35 ] ++ lib.optionals stdenv.isDarwin [
37 "-DOPENGL_LIBRARIES=${OpenGL}/Library/Frameworks/OpenGL.framework"
38 "-DOPENGL_INCLUDE_DIR=${OpenGL}/Library/Frameworks/OpenGL.framework"
39 "-DOPENGL_gl_LIBRARY=${OpenGL}/Library/Frameworks/OpenGL.framework"
40 "-DCOCOA_LIBRARY=${Cocoa}/Library/Frameworks/Cocoa.framework"
41 "-DBUILD_BULLET2_DEMOS=OFF"
42 "-DBUILD_UNIT_TESTS=OFF"
46 description = "A professional free 3D Game Multiphysics Library";
48 Bullet 3D Game Multiphysics Library provides state of the art collision
49 detection, soft body and rigid body dynamics.
51 homepage = "http://bulletphysics.org";
52 license = licenses.zlib;
53 platforms = platforms.unix;
54 # /tmp/nix-build-bullet-2019-03-27.drv-0/source/src/Bullet3Common/b3Vector3.h:297:7: error: argument value 10880 is outside the valid range [0, 255] [-Wargument-outside-range]
55 # y = b3_splat_ps(y, 0x80);
56 broken = (stdenv.isDarwin && stdenv.isx86_64);