2019-11-10 16:44:34 +00:00
|
|
|
{ stdenv, fetchFromGitHub, cmake, libGLU, libGL, freeglut
|
2018-09-09 14:16:24 +01:00
|
|
|
, Cocoa, OpenGL
|
|
|
|
}:
|
2012-02-19 10:51:04 +00:00
|
|
|
|
2013-03-09 13:54:43 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "bullet";
|
2018-01-05 22:48:43 +00:00
|
|
|
version = "2.87";
|
2016-04-17 03:24:01 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "bulletphysics";
|
|
|
|
repo = "bullet3";
|
|
|
|
rev = version;
|
2018-01-05 22:48:43 +00:00
|
|
|
sha256 = "1msp7w3563vb43w70myjmqsdb97kna54dcfa7yvi9l3bvamb92w3";
|
2012-02-19 10:51:04 +00:00
|
|
|
};
|
2013-03-09 13:54:43 +00:00
|
|
|
|
2018-09-09 14:16:24 +01:00
|
|
|
nativeBuildInputs = [ cmake ];
|
2019-11-10 16:44:34 +00:00
|
|
|
buildInputs = stdenv.lib.optionals stdenv.isLinux [ libGLU libGL freeglut ]
|
2018-09-09 14:16:24 +01:00
|
|
|
++ stdenv.lib.optionals stdenv.isDarwin [ Cocoa OpenGL ];
|
2016-04-17 03:24:01 +01:00
|
|
|
|
2018-01-05 23:02:21 +00:00
|
|
|
patches = [ ./gwen-narrowing.patch ];
|
|
|
|
|
2016-11-02 23:35:33 +00:00
|
|
|
postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
|
|
|
|
sed -i 's/FIND_PACKAGE(OpenGL)//' CMakeLists.txt
|
|
|
|
sed -i 's/FIND_LIBRARY(COCOA_LIBRARY Cocoa)//' CMakeLists.txt
|
|
|
|
'';
|
|
|
|
|
2017-11-20 10:42:00 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DBUILD_SHARED_LIBS=ON"
|
|
|
|
"-DBUILD_CPU_DEMOS=OFF"
|
|
|
|
"-DINSTALL_EXTRA_LIBS=ON"
|
|
|
|
] ++ stdenv.lib.optionals stdenv.isDarwin [
|
|
|
|
"-DOPENGL_FOUND=true"
|
2018-09-09 14:16:24 +01:00
|
|
|
"-DOPENGL_LIBRARIES=${OpenGL}/Library/Frameworks/OpenGL.framework"
|
|
|
|
"-DOPENGL_INCLUDE_DIR=${OpenGL}/Library/Frameworks/OpenGL.framework"
|
|
|
|
"-DOPENGL_gl_LIBRARY=${OpenGL}/Library/Frameworks/OpenGL.framework"
|
|
|
|
"-DCOCOA_LIBRARY=${Cocoa}/Library/Frameworks/Cocoa.framework"
|
|
|
|
"-DBUILD_BULLET2_DEMOS=OFF"
|
|
|
|
"-DBUILD_UNIT_TESTS=OFF"
|
2017-11-20 10:42:00 +00:00
|
|
|
];
|
2016-04-17 03:24:01 +01:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
2012-02-19 10:51:04 +00:00
|
|
|
|
2019-09-17 13:43:52 +01:00
|
|
|
NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang
|
|
|
|
"-Wno-error=argument-outside-range -Wno-error=c++11-narrowing";
|
2019-04-23 03:36:35 +01:00
|
|
|
|
2018-09-09 14:16:24 +01:00
|
|
|
meta = with stdenv.lib; {
|
2012-02-19 10:51:04 +00:00
|
|
|
description = "A professional free 3D Game Multiphysics Library";
|
|
|
|
longDescription = ''
|
|
|
|
Bullet 3D Game Multiphysics Library provides state of the art collision
|
2016-11-02 23:35:33 +00:00
|
|
|
detection, soft body and rigid body dynamics.
|
2012-02-19 10:51:04 +00:00
|
|
|
'';
|
2017-10-27 00:44:19 +01:00
|
|
|
homepage = http://bulletphysics.org;
|
2018-09-09 14:16:24 +01:00
|
|
|
license = licenses.zlib;
|
|
|
|
maintainers = with maintainers; [ aforemny ];
|
|
|
|
platforms = platforms.unix;
|
2012-02-19 10:51:04 +00:00
|
|
|
};
|
|
|
|
}
|