2021-01-21 17:00:13 +00:00
|
|
|
{ lib, stdenv, fetchurl, cmake, freeglut, libGLU, libGL, glfw2, glew, libX11, xorgproto
|
2020-08-11 11:08:34 +01:00
|
|
|
, libXi, libXmu, fetchpatch, libXrandr
|
2015-05-02 11:26:50 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "chipmunk";
|
2015-05-02 11:26:50 +01:00
|
|
|
majorVersion = "7";
|
2020-08-11 11:08:34 +01:00
|
|
|
version = "${majorVersion}.0.3";
|
2008-11-30 15:05:43 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2015-05-02 11:26:50 +01:00
|
|
|
url = "https://chipmunk-physics.net/release/Chipmunk-${majorVersion}.x/Chipmunk-${version}.tgz";
|
2020-08-11 11:08:34 +01:00
|
|
|
sha256 = "06j9cfxsyrrnyvl7hsf55ac5mgff939mmijliampphlizyg0r2q4";
|
2008-11-30 15:05:43 +00:00
|
|
|
};
|
|
|
|
|
2020-08-11 11:08:34 +01:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/slembcke/Chipmunk2D/commit/9a051e6fb970c7afe09ce2d564c163b81df050a8.patch";
|
|
|
|
sha256 = "0ps8bjba1k544vcdx5w0qk7gcjq94yfigxf67j50s63yf70k2n70";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2017-03-12 01:58:16 +00:00
|
|
|
nativeBuildInputs = [ cmake ];
|
2015-05-02 11:26:50 +01:00
|
|
|
buildInputs =
|
2020-08-11 11:08:34 +01:00
|
|
|
[ freeglut libGLU libGL glfw2 glew libX11 xorgproto libXi libXmu libXrandr ];
|
2008-11-30 15:05:43 +00:00
|
|
|
|
2015-05-02 11:26:50 +01:00
|
|
|
postInstall = ''
|
2012-01-18 20:16:00 +00:00
|
|
|
mkdir -p $out/bin
|
2015-05-02 11:26:50 +01:00
|
|
|
cp demo/chipmunk_demos $out/bin
|
|
|
|
'';
|
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2015-05-02 11:26:50 +01:00
|
|
|
description = "A fast and lightweight 2D game physics library";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://chipmunk2d.net/";
|
2015-05-02 11:26:50 +01:00
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.unix; # supports Windows and MacOS as well, but those require more work
|
2008-11-30 15:05:43 +00:00
|
|
|
};
|
|
|
|
}
|