2016-11-02 23:35:33 +00:00
|
|
|
{ stdenv, fetchFromGitHub, cmake, mesa, freeglut, darwin }:
|
2012-02-19 10:51:04 +00:00
|
|
|
|
2013-03-09 13:54:43 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2016-04-17 03:24:01 +01:00
|
|
|
name = "bullet-${version}";
|
|
|
|
version = "2.83.7";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "bulletphysics";
|
|
|
|
repo = "bullet3";
|
|
|
|
rev = version;
|
|
|
|
sha256 = "1zz3vs6i5975y9mgb1k1vxrjbf1028v0nc11p646dsvv2vplxx5r";
|
2012-02-19 10:51:04 +00:00
|
|
|
};
|
2013-03-09 13:54:43 +00:00
|
|
|
|
2016-11-02 23:35:33 +00:00
|
|
|
buildInputs = [ cmake ] ++
|
|
|
|
(if stdenv.isDarwin
|
|
|
|
then with darwin.apple_sdk.frameworks; [ Cocoa OpenGL ]
|
|
|
|
else [mesa freeglut]);
|
2016-04-17 03:24:01 +01:00
|
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
|
|
|
cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" "-DBUILD_CPU_DEMOS=OFF" ] ++
|
|
|
|
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 03:24:01 +01:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
2012-02-19 10:51:04 +00:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
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
|
|
|
'';
|
|
|
|
homepage = http://code.google.com/p/bullet/;
|
|
|
|
license = stdenv.lib.licenses.zlib;
|
2013-03-09 13:54:43 +00:00
|
|
|
maintainers = with stdenv.lib.maintainers; [ aforemny ];
|
2016-11-02 23:35:33 +00:00
|
|
|
platforms = with stdenv.lib.platforms; unix;
|
2012-02-19 10:51:04 +00:00
|
|
|
};
|
|
|
|
}
|