1{ stdenv, fetchurl, cmake, freeglut, libGLU_combined, glfw2, glew, libX11, xproto
2, inputproto, libXi, libXmu
3}:
4
5stdenv.mkDerivation rec {
6 name = "chipmunk-${version}";
7 majorVersion = "7";
8 version = "${majorVersion}.0.1";
9
10 src = fetchurl {
11 url = "https://chipmunk-physics.net/release/Chipmunk-${majorVersion}.x/Chipmunk-${version}.tgz";
12 sha256 = "0q4jwv1icz8spcjkp0v3bnygi6hq2zmnsgcxkwm8i2bxfxjb8m7y";
13 };
14
15 nativeBuildInputs = [ cmake ];
16 buildInputs =
17 [ freeglut libGLU_combined glfw2 glew libX11 xproto inputproto libXi libXmu ];
18
19 postInstall = ''
20 mkdir -p $out/bin
21 cp demo/chipmunk_demos $out/bin
22 '';
23
24 meta = with stdenv.lib; {
25 description = "A fast and lightweight 2D game physics library";
26 homepage = http://chipmunk2d.net/;
27 license = licenses.mit;
28 platforms = platforms.unix; # supports Windows and MacOS as well, but those require more work
29 };
30}