2018-02-24 14:12:44 +01:00
|
|
|
{ stdenv, fetchFromGitHub, cmake, libGLU_combined, freeglut, darwin }:
|
2012-02-19 11:51:04 +01:00
|
|
|
|
2013-03-09 14:54:43 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2016-04-17 04:24:01 +02:00
|
|
|
name = "bullet-${version}";
|
2018-01-05 23:48:43 +01:00
|
|
|
version = "2.87";
|
2016-04-17 04:24:01 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "bulletphysics";
|
|
|
|
repo = "bullet3";
|
|
|
|
rev = version;
|
2018-01-05 23:48:43 +01:00
|
|
|
sha256 = "1msp7w3563vb43w70myjmqsdb97kna54dcfa7yvi9l3bvamb92w3";
|
2012-02-19 11:51:04 +01:00
|
|
|
};
|
2013-03-09 14:54:43 +01:00
|
|
|
|
2016-11-03 00:35:33 +01:00
|
|
|
buildInputs = [ cmake ] ++
|
|
|
|
(if stdenv.isDarwin
|
|
|
|
then with darwin.apple_sdk.frameworks; [ Cocoa OpenGL ]
|
2018-02-24 14:12:44 +01:00
|
|
|
else [libGLU_combined freeglut]);
|
2016-04-17 04:24:01 +02:00
|
|
|
|
2018-01-06 00:02:21 +01:00
|
|
|
patches = [ ./gwen-narrowing.patch ];
|
|
|
|
|
2016-11-03 00:35:33 +01: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 11:42:00 +01:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DBUILD_SHARED_LIBS=ON"
|
|
|
|
"-DBUILD_CPU_DEMOS=OFF"
|
|
|
|
"-DINSTALL_EXTRA_LIBS=ON"
|
|
|
|
] ++ stdenv.lib.optionals stdenv.isDarwin [
|
|
|
|
"-DMACOSX_DEPLOYMENT_TARGET=\"10.9\""
|
|
|
|
"-DOPENGL_FOUND=true"
|
|
|
|
"-DOPENGL_LIBRARIES=${darwin.apple_sdk.frameworks.OpenGL}/Library/Frameworks/OpenGL.framework"
|
|
|
|
"-DOPENGL_INCLUDE_DIR=${darwin.apple_sdk.frameworks.OpenGL}/Library/Frameworks/OpenGL.framework"
|
|
|
|
"-DOPENGL_gl_LIBRARY=${darwin.apple_sdk.frameworks.OpenGL}/Library/Frameworks/OpenGL.framework"
|
|
|
|
"-DCOCOA_LIBRARY=${darwin.apple_sdk.frameworks.Cocoa}/Library/Frameworks/Cocoa.framework"
|
|
|
|
];
|
2016-04-17 04:24:01 +02:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
2012-02-19 11:51:04 +01:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "A professional free 3D Game Multiphysics Library";
|
|
|
|
longDescription = ''
|
|
|
|
Bullet 3D Game Multiphysics Library provides state of the art collision
|
2016-11-03 00:35:33 +01:00
|
|
|
detection, soft body and rigid body dynamics.
|
2012-02-19 11:51:04 +01:00
|
|
|
'';
|
2017-10-27 01:44:19 +02:00
|
|
|
homepage = http://bulletphysics.org;
|
2012-02-19 11:51:04 +01:00
|
|
|
license = stdenv.lib.licenses.zlib;
|
2013-03-09 14:54:43 +01:00
|
|
|
maintainers = with stdenv.lib.maintainers; [ aforemny ];
|
2016-11-03 00:35:33 +01:00
|
|
|
platforms = with stdenv.lib.platforms; unix;
|
2012-02-19 11:51:04 +01:00
|
|
|
};
|
|
|
|
}
|