2019-11-10 08:44:34 -08:00
|
|
|
{ stdenv, fetchurl, unzip, cmake, libGLU, libGL, freeglut, libX11, xorgproto
|
2015-12-29 13:47:41 -08:00
|
|
|
, libXi, pkgconfig }:
|
2010-12-17 05:02:17 -08:00
|
|
|
|
2015-12-29 13:47:41 -08:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 05:41:18 -07:00
|
|
|
pname = "box2d";
|
2019-01-17 19:08:41 -08:00
|
|
|
version = "2.3.1";
|
2015-12-29 13:47:41 -08:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/erincatto/Box2D/archive/v${version}.tar.gz";
|
2019-01-17 19:08:41 -08:00
|
|
|
sha256 = "0llpcifl8zbjbpxdwz87drd01m3lwnv82xb4av6kca1xn4w2gmkm";
|
2010-12-17 05:02:17 -08:00
|
|
|
};
|
|
|
|
|
2015-12-29 13:47:41 -08:00
|
|
|
sourceRoot = "Box2D-${version}/Box2D";
|
2010-12-17 05:02:17 -08:00
|
|
|
|
2017-09-14 12:24:37 -07:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
2015-12-29 13:47:41 -08:00
|
|
|
buildInputs = [
|
2019-11-10 08:44:34 -08:00
|
|
|
unzip cmake libGLU libGL freeglut libX11 xorgproto libXi
|
2015-12-29 13:47:41 -08:00
|
|
|
];
|
2010-12-17 05:02:17 -08:00
|
|
|
|
2019-01-04 11:33:50 -08:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DBOX2D_INSTALL=ON"
|
|
|
|
"-DBOX2D_BUILD_SHARED=ON"
|
|
|
|
"-DBOX2D_BUILD_EXAMPLES=OFF"
|
|
|
|
];
|
2010-12-17 05:02:17 -08:00
|
|
|
|
2015-12-29 13:47:41 -08:00
|
|
|
prePatch = ''
|
|
|
|
substituteInPlace Box2D/Common/b2Settings.h \
|
|
|
|
--replace 'b2_maxPolygonVertices 8' 'b2_maxPolygonVertices 15'
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2010-12-17 05:02:17 -08:00
|
|
|
description = "2D physics engine";
|
2020-03-31 18:11:51 -07:00
|
|
|
homepage = "https://box2d.org/";
|
2015-12-29 13:47:41 -08:00
|
|
|
maintainers = [ maintainers.raskin ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
license = licenses.zlib;
|
2010-12-17 05:02:17 -08:00
|
|
|
};
|
2015-12-29 13:47:41 -08:00
|
|
|
}
|