nixpkgs/pkgs/by-name/ch/chipmunk/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

39 lines
1.1 KiB
Nix

{ lib, stdenv, fetchurl, cmake, libglut, libGLU, libGL, glfw2, glew, libX11, xorgproto
, libXi, libXmu, fetchpatch, libXrandr
}:
stdenv.mkDerivation rec {
pname = "chipmunk";
majorVersion = "7";
version = "${majorVersion}.0.3";
src = fetchurl {
url = "https://chipmunk-physics.net/release/Chipmunk-${majorVersion}.x/Chipmunk-${version}.tgz";
sha256 = "06j9cfxsyrrnyvl7hsf55ac5mgff939mmijliampphlizyg0r2q4";
};
patches = [
(fetchpatch {
url = "https://github.com/slembcke/Chipmunk2D/commit/9a051e6fb970c7afe09ce2d564c163b81df050a8.patch";
sha256 = "0ps8bjba1k544vcdx5w0qk7gcjq94yfigxf67j50s63yf70k2n70";
})
];
nativeBuildInputs = [ cmake ];
buildInputs =
[ libglut libGLU libGL glfw2 glew libX11 xorgproto libXi libXmu libXrandr ];
postInstall = ''
mkdir -p $out/bin
cp demo/chipmunk_demos $out/bin
'';
meta = with lib; {
description = "Fast and lightweight 2D game physics library";
mainProgram = "chipmunk_demos";
homepage = "http://chipmunk2d.net/";
license = licenses.mit;
platforms = platforms.unix; # supports Windows and MacOS as well, but those require more work
};
}