2008-11-30 16:05:43 +01:00
|
|
|
args :
|
|
|
|
let
|
|
|
|
lib = args.lib;
|
|
|
|
fetchurl = args.fetchurl;
|
2009-05-20 01:25:58 +02:00
|
|
|
fullDepEntry = args.fullDepEntry;
|
2008-11-30 16:05:43 +01:00
|
|
|
|
2012-01-05 12:56:32 +01:00
|
|
|
version = lib.attrByPath ["version"] "6.0.3" args;
|
|
|
|
majorVersion = lib.attrByPath ["majorVersion"] "6" args;
|
2008-11-30 16:05:43 +01:00
|
|
|
buildInputs = with args; [
|
|
|
|
cmake freeglut mesa
|
|
|
|
libX11 xproto inputproto libXi libXmu
|
|
|
|
];
|
|
|
|
in
|
|
|
|
rec {
|
|
|
|
src = fetchurl {
|
2012-01-05 12:56:32 +01:00
|
|
|
url = "http://files.slembcke.net/chipmunk/release/Chipmunk-${majorVersion}.x/Chipmunk-${version}.tgz";
|
|
|
|
sha256 = "c6f550454bc1c63a2a63e0ff8febecb4781a528ab6d6b657a17933a6f567541a";
|
2008-11-30 16:05:43 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
inherit buildInputs;
|
|
|
|
configureFlags = [];
|
|
|
|
|
|
|
|
/* doConfigure should be specified separately */
|
|
|
|
phaseNames = ["genMakefile" "doMakeInstall" "demoInstall"];
|
|
|
|
|
2009-05-20 01:25:58 +02:00
|
|
|
genMakefile = fullDepEntry ''
|
2008-11-30 16:05:43 +01:00
|
|
|
cmake -D CMAKE_INSTALL_PREFIX=$out .
|
|
|
|
'' ["minInit" "addInputs" "doUnpack"];
|
|
|
|
|
2009-05-20 01:25:58 +02:00
|
|
|
demoInstall = fullDepEntry(''
|
2008-11-30 16:05:43 +01:00
|
|
|
ensureDir $out/bin
|
2012-01-05 12:56:32 +01:00
|
|
|
cp Demo/chipmunk_demos $out/bin
|
2008-11-30 16:05:43 +01:00
|
|
|
'') ["doMakeInstall" "defEnsureDir"];
|
|
|
|
|
|
|
|
name = "chipmunk-" + version;
|
|
|
|
meta = {
|
|
|
|
description = "Chipmunk 2D physics engine";
|
|
|
|
};
|
|
|
|
}
|