2022-01-03 16:56:52 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, libGLU, libGL, freeglut, libX11, xorgproto
|
2021-01-15 22:18:51 +00:00
|
|
|
, libXi, pkg-config }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "box2d";
|
|
|
|
version = "2.3.1";
|
|
|
|
|
2022-01-03 16:56:52 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "erincatto";
|
|
|
|
repo = "box2d";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "sha256-Z2J17YMzQNZqABIa5eyJDT7BWfXveymzs+DWsrklPIs=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-01-03 16:56:52 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
2021-01-15 22:18:51 +00:00
|
|
|
buildInputs = [ libGLU libGL freeglut libX11 xorgproto libXi ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DBOX2D_INSTALL=ON"
|
|
|
|
"-DBOX2D_BUILD_SHARED=ON"
|
|
|
|
"-DBOX2D_BUILD_EXAMPLES=OFF"
|
|
|
|
];
|
|
|
|
|
|
|
|
prePatch = ''
|
2022-01-07 04:07:37 +00:00
|
|
|
cd Box2D
|
2020-04-24 23:36:52 +00:00
|
|
|
substituteInPlace Box2D/Common/b2Settings.h \
|
|
|
|
--replace 'b2_maxPolygonVertices 8' 'b2_maxPolygonVertices 15'
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "2D physics engine";
|
|
|
|
homepage = "https://box2d.org/";
|
|
|
|
maintainers = [ maintainers.raskin ];
|
2021-06-28 23:13:55 +00:00
|
|
|
platforms = platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.zlib;
|
|
|
|
};
|
|
|
|
}
|