nixpkgs/pkgs/development/libraries/box2d/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

38 lines
927 B
Nix
Raw Normal View History

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