2021-12-27 00:04:16 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, libGLU, libGL, freeglut, libX11, xorgproto
|
2020-12-31 07:48:55 +00:00
|
|
|
, libXi, pkg-config }:
|
2010-12-17 13:02:17 +00:00
|
|
|
|
2015-12-29 21:47:41 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "box2d";
|
2019-01-18 03:08:41 +00:00
|
|
|
version = "2.3.1";
|
2015-12-29 21:47:41 +00:00
|
|
|
|
2021-12-27 00:04:16 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "erincatto";
|
|
|
|
repo = "box2d";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "sha256-Z2J17YMzQNZqABIa5eyJDT7BWfXveymzs+DWsrklPIs=";
|
2010-12-17 13:02:17 +00:00
|
|
|
};
|
|
|
|
|
2021-12-27 00:04:16 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
2020-12-31 07:48:55 +00:00
|
|
|
buildInputs = [ libGLU libGL freeglut libX11 xorgproto libXi ];
|
2010-12-17 13:02:17 +00:00
|
|
|
|
2019-01-04 19:33:50 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DBOX2D_INSTALL=ON"
|
|
|
|
"-DBOX2D_BUILD_SHARED=ON"
|
|
|
|
"-DBOX2D_BUILD_EXAMPLES=OFF"
|
|
|
|
];
|
2010-12-17 13:02:17 +00:00
|
|
|
|
2015-12-29 21:47:41 +00:00
|
|
|
prePatch = ''
|
2022-01-04 06:29:06 +00:00
|
|
|
cd Box2D
|
2015-12-29 21:47:41 +00:00
|
|
|
substituteInPlace Box2D/Common/b2Settings.h \
|
|
|
|
--replace 'b2_maxPolygonVertices 8' 'b2_maxPolygonVertices 15'
|
|
|
|
'';
|
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2010-12-17 13:02:17 +00:00
|
|
|
description = "2D physics engine";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://box2d.org/";
|
2015-12-29 21:47:41 +00:00
|
|
|
maintainers = [ maintainers.raskin ];
|
2021-06-12 03:58:57 +00:00
|
|
|
platforms = platforms.unix;
|
2015-12-29 21:47:41 +00:00
|
|
|
license = licenses.zlib;
|
2010-12-17 13:02:17 +00:00
|
|
|
};
|
2015-12-29 21:47:41 +00:00
|
|
|
}
|