Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 cmake,
6 libGLU,
7 libGL,
8 libglut,
9}:
10
11stdenv.mkDerivation rec {
12 pname = "bullet";
13 version = "3.25";
14
15 src = fetchFromGitHub {
16 owner = "bulletphysics";
17 repo = "bullet3";
18 rev = version;
19 sha256 = "sha256-AGP05GoxLjHqlnW63/KkZe+TjO3IKcgBi+Qb/osQuCM=";
20 };
21
22 nativeBuildInputs = [ cmake ];
23 buildInputs = [
24 libGLU
25 libGL
26 libglut
27 ];
28
29 postPatch = ''
30 substituteInPlace examples/ThirdPartyLibs/Gwen/CMakeLists.txt \
31 --replace "-DGLEW_STATIC" "-DGLEW_STATIC -Wno-narrowing"
32 '';
33
34 cmakeFlags = [
35 "-DBUILD_SHARED_LIBS=ON"
36 "-DBUILD_CPU_DEMOS=OFF"
37 "-DINSTALL_EXTRA_LIBS=ON"
38 ]
39 ++ lib.optionals stdenv.hostPlatform.isDarwin [
40 "-DBUILD_BULLET2_DEMOS=OFF"
41 "-DBUILD_UNIT_TESTS=OFF"
42 "-DBUILD_BULLET_ROBOTICS_GUI_EXTRA=OFF"
43 ];
44
45 env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=argument-outside-range -Wno-error=c++11-narrowing";
46
47 meta = with lib; {
48 description = "Professional free 3D Game Multiphysics Library";
49 longDescription = ''
50 Bullet 3D Game Multiphysics Library provides state of the art collision
51 detection, soft body and rigid body dynamics.
52 '';
53 homepage = "http://bulletphysics.org";
54 license = licenses.zlib;
55 maintainers = with maintainers; [ aforemny ];
56 platforms = platforms.unix;
57 };
58}