2021-01-21 18:00:13 +01:00
|
|
|
{ lib, stdenv, fetchurl, unzip, cmake, libGLU, libGL, freeglut, libX11, xorgproto
|
2020-12-31 08:48:55 +01:00
|
|
|
, libXi, pkg-config }:
|
2010-12-17 14:02:17 +01:00
|
|
|
|
2015-12-29 22:47:41 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "box2d";
|
2019-01-18 04:08:41 +01:00
|
|
|
version = "2.3.1";
|
2015-12-29 22:47:41 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/erincatto/Box2D/archive/v${version}.tar.gz";
|
2019-01-18 04:08:41 +01:00
|
|
|
sha256 = "0llpcifl8zbjbpxdwz87drd01m3lwnv82xb4av6kca1xn4w2gmkm";
|
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
|
|
|
|
2020-12-31 08:48:55 +01:00
|
|
|
nativeBuildInputs = [ cmake unzip pkg-config ];
|
|
|
|
buildInputs = [ libGLU libGL freeglut libX11 xorgproto libXi ];
|
2010-12-17 14:02:17 +01:00
|
|
|
|
2019-01-04 20:33:50 +01:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DBOX2D_INSTALL=ON"
|
|
|
|
"-DBOX2D_BUILD_SHARED=ON"
|
|
|
|
"-DBOX2D_BUILD_EXAMPLES=OFF"
|
|
|
|
];
|
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'
|
|
|
|
'';
|
|
|
|
|
2021-01-21 18:00:13 +01:00
|
|
|
meta = with lib; {
|
2010-12-17 14:02:17 +01:00
|
|
|
description = "2D physics engine";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://box2d.org/";
|
2015-12-29 22:47:41 +01:00
|
|
|
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
|
|
|
}
|