summary refs log tree commit diff
path: root/pkgs/development/libraries/chipmunk/default.nix
blob: 52990097a2305c314efff1b0af53f89cc0db97b9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{ stdenv, fetchurl, cmake, freeglut, mesa, glfw2, glew, libX11, xproto
, inputproto, libXi, libXmu
}:

stdenv.mkDerivation rec {
  name = "chipmunk-${version}";
  majorVersion = "7";
  version = "${majorVersion}.0.0";

  src = fetchurl {
    url = "https://chipmunk-physics.net/release/Chipmunk-${majorVersion}.x/Chipmunk-${version}.tgz";
    sha256 = "1kaii8wgvp0kgn2p22jm9smyqlws4p5dg8j23jaiasx9jq1kiaql";
  };

  buildInputs =
    [ cmake freeglut mesa glfw2 glew libX11 xproto inputproto libXi libXmu ];

  postInstall = ''
    mkdir -p $out/bin
    cp demo/chipmunk_demos $out/bin
  '';

  meta = with stdenv.lib; {
    description = "A fast and lightweight 2D game physics library";
    homepage = http://chipmunk2d.net/;
    license = licenses.mit;
    platforms = platforms.unix; # supports Windows and MacOS as well, but those require more work
  };
}