diff --git a/pkgs/development/libraries/chipmunk/default.nix b/pkgs/development/libraries/chipmunk/default.nix new file mode 100644 index 00000000000..84dff00a8b9 --- /dev/null +++ b/pkgs/development/libraries/chipmunk/default.nix @@ -0,0 +1,38 @@ +args : +let + lib = args.lib; + fetchurl = args.fetchurl; + FullDepEntry = args.FullDepEntry; + + version = lib.getAttr ["version"] "4.1.0" args; + buildInputs = with args; [ + cmake freeglut mesa + libX11 xproto inputproto libXi libXmu + ]; +in +rec { + src = fetchurl { + url = "http://files.slembcke.net/chipmunk/release/Chipmunk-${version}.tgz"; + sha256 = "0ry17lf4kdcac91bpavks2cswch3izsmmam0yhczk7rayj9cvqsh"; + }; + + inherit buildInputs; + configureFlags = []; + + /* doConfigure should be specified separately */ + phaseNames = ["genMakefile" "doMakeInstall" "demoInstall"]; + + genMakefile = FullDepEntry '' + cmake -D CMAKE_INSTALL_PREFIX=$out . + '' ["minInit" "addInputs" "doUnpack"]; + + demoInstall = FullDepEntry('' + ensureDir $out/bin + cp chipmunk_demos $out/bin + '') ["doMakeInstall" "defEnsureDir"]; + + name = "chipmunk-" + version; + meta = { + description = "Chipmunk 2D physics engine"; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a367bc4c2db..20eb73f14a7 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2674,6 +2674,11 @@ let inherit fetchurl stdenv pkgconfig cairo x11 fontconfig freetype; }; + chipmunk = builderDefsPackage (import ../development/libraries/chipmunk) { + inherit cmake freeglut mesa; + inherit (xlibs) libX11 xproto inputproto libXi libXmu; + }; + chmlib = import ../development/libraries/chmlib { inherit fetchurl stdenv; };