Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at fix-function-merge 38 lines 1.2 kB view raw
1{ lib, stdenv, fetchurl, cmake, libglut, libGLU, libGL, glfw2, glew, libX11, xorgproto 2, libXi, libXmu, fetchpatch, libXrandr 3}: 4 5stdenv.mkDerivation rec { 6 pname = "chipmunk"; 7 majorVersion = "7"; 8 version = "${majorVersion}.0.3"; 9 10 src = fetchurl { 11 url = "https://chipmunk-physics.net/release/Chipmunk-${majorVersion}.x/Chipmunk-${version}.tgz"; 12 sha256 = "06j9cfxsyrrnyvl7hsf55ac5mgff939mmijliampphlizyg0r2q4"; 13 }; 14 15 patches = [ 16 (fetchpatch { 17 url = "https://github.com/slembcke/Chipmunk2D/commit/9a051e6fb970c7afe09ce2d564c163b81df050a8.patch"; 18 sha256 = "0ps8bjba1k544vcdx5w0qk7gcjq94yfigxf67j50s63yf70k2n70"; 19 }) 20 ]; 21 22 nativeBuildInputs = [ cmake ]; 23 buildInputs = 24 [ libglut libGLU libGL glfw2 glew libX11 xorgproto libXi libXmu libXrandr ]; 25 26 postInstall = '' 27 mkdir -p $out/bin 28 cp demo/chipmunk_demos $out/bin 29 ''; 30 31 meta = with lib; { 32 description = "Fast and lightweight 2D game physics library"; 33 mainProgram = "chipmunk_demos"; 34 homepage = "http://chipmunk2d.net/"; 35 license = licenses.mit; 36 platforms = platforms.unix; # supports Windows and MacOS as well, but those require more work 37 }; 38}