2015-12-29 22:47:41 +01:00
|
|
|
{ stdenv, fetchurl, unzip, cmake, mesa, freeglut, libX11, xproto, inputproto
|
|
|
|
, libXi, pkgconfig }:
|
2010-12-17 14:02:17 +01:00
|
|
|
|
2015-12-29 22:47:41 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2014-07-01 11:58:11 +02:00
|
|
|
name = "box2d-${version}";
|
2015-12-29 22:47:41 +01:00
|
|
|
version = "2.3.0";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/erincatto/Box2D/archive/v${version}.tar.gz";
|
|
|
|
sha256 = "1dmbswh4x2n5l3c9h0k72m0z4rdpzfy1xl8m8p3rf5rwkvk3bkg2";
|
2010-12-17 14:02:17 +01:00
|
|
|
};
|
|
|
|
|
2015-12-29 22:47:41 +01:00
|
|
|
sourceRoot = "Box2D-${version}/Box2D";
|
2010-12-17 14:02:17 +01:00
|
|
|
|
2017-09-14 21:24:37 +02:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
2015-12-29 22:47:41 +01:00
|
|
|
buildInputs = [
|
2017-09-14 21:24:37 +02:00
|
|
|
unzip cmake mesa freeglut libX11 xproto inputproto libXi
|
2015-12-29 22:47:41 +01:00
|
|
|
];
|
2010-12-17 14:02:17 +01:00
|
|
|
|
2015-12-29 22:47:41 +01:00
|
|
|
cmakeFlags = [ "-DBOX2D_INSTALL=ON" "-DBOX2D_BUILD_SHARED=ON" ];
|
2010-12-17 14:02:17 +01:00
|
|
|
|
2015-12-29 22:47:41 +01:00
|
|
|
prePatch = ''
|
|
|
|
substituteInPlace Box2D/Common/b2Settings.h \
|
|
|
|
--replace 'b2_maxPolygonVertices 8' 'b2_maxPolygonVertices 15'
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2010-12-17 14:02:17 +01:00
|
|
|
description = "2D physics engine";
|
2015-12-29 22:47:41 +01:00
|
|
|
homepage = http://box2d.org/;
|
|
|
|
maintainers = [ maintainers.raskin ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
license = licenses.zlib;
|
2010-12-17 14:02:17 +01:00
|
|
|
};
|
2015-12-29 22:47:41 +01:00
|
|
|
}
|