12 stdenv.mkDerivation rec {
16 src = fetchFromGitHub {
17 owner = "bulletphysics";
20 sha256 = "sha256-AGP05GoxLjHqlnW63/KkZe+TjO3IKcgBi+Qb/osQuCM=";
23 nativeBuildInputs = [ cmake ];
24 buildInputs = lib.optionals stdenv.isLinux [ libGLU libGL freeglut ]
25 ++ lib.optionals stdenv.isDarwin [ Cocoa OpenGL ];
28 substituteInPlace examples/ThirdPartyLibs/Gwen/CMakeLists.txt \
29 --replace "-DGLEW_STATIC" "-DGLEW_STATIC -Wno-narrowing"
30 '' + lib.optionalString stdenv.isDarwin ''
31 sed -i 's/FIND_PACKAGE(OpenGL)//' CMakeLists.txt
32 sed -i 's/FIND_LIBRARY(COCOA_LIBRARY Cocoa)//' CMakeLists.txt
36 "-DBUILD_SHARED_LIBS=ON"
37 "-DBUILD_CPU_DEMOS=OFF"
38 "-DINSTALL_EXTRA_LIBS=ON"
39 ] ++ lib.optionals stdenv.isDarwin [
41 "-DOPENGL_LIBRARIES=${OpenGL}/Library/Frameworks/OpenGL.framework"
42 "-DOPENGL_INCLUDE_DIR=${OpenGL}/Library/Frameworks/OpenGL.framework"
43 "-DOPENGL_gl_LIBRARY=${OpenGL}/Library/Frameworks/OpenGL.framework"
44 "-DCOCOA_LIBRARY=${Cocoa}/Library/Frameworks/Cocoa.framework"
45 "-DBUILD_BULLET2_DEMOS=OFF"
46 "-DBUILD_UNIT_TESTS=OFF"
47 "-DBUILD_BULLET_ROBOTICS_GUI_EXTRA=OFF"
50 env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang
51 "-Wno-error=argument-outside-range -Wno-error=c++11-narrowing";
54 description = "A professional free 3D Game Multiphysics Library";
56 Bullet 3D Game Multiphysics Library provides state of the art collision
57 detection, soft body and rigid body dynamics.
59 homepage = "http://bulletphysics.org";
60 license = licenses.zlib;
61 maintainers = with maintainers; [ aforemny ];
62 platforms = platforms.unix;