@@ -1,83 +0,0 @@
2− , unzip, cmake, mesa, freeglut, libX11, xproto
8− helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++
11− buildInputs = map (n: builtins.getAttr n x)
12− (builtins.attrNames (builtins.removeAttrs x helperArgNames));
16− name="${baseName}-${version}";
17− url="http://box2d.googlecode.com/files/Box2D_v${version}.zip";
18− hash="62857048aa089b558561074154430883cee491eedd71247f75f488cba859e21f";
23− url = sourceInfo.url;
24− sha256 = sourceInfo.hash;
27− inherit (sourceInfo) name version;
30− phaseNames = ["fixIncludes" "setVars" "changeSettings" "doMake" "doDeploy"];
32− goSrcDir = ''cd Box2D'';
34− fixIncludes = a.fullDepEntry ''
35− sed -i Source/Dynamics/Contacts/b2PolyContact.cpp \
36− -i Source/Dynamics/Contacts/b2CircleContact.cpp \
37− -i Source/Dynamics/Contacts/b2PolyAndCircleContact.cpp \
38− -i Source/Common/b2BlockAllocator.cpp \
39− -i Source/Collision/b2BroadPhase.cpp \
40− -i Examples/TestBed/Framework/Render.cpp \
41− -i Examples/TestBed/Tests/BroadPhaseTest.cpp \
42− -i Examples/TestBed/Tests/TestEntries.cpp \
43− -e '1i#include <string.h>'
44− '' ["minInit" "addInputs" "doUnpack"];
46− setVars = a.noDepEntry ''
47− export NIX_LDFLAGS="$NIX_LDFLAGS -lX11 -lXi"
50− doDeploy = a.fullDepEntry ''
52− mkdir -p "$out"/include/Box2D
53− cp Library/* Source/Gen/float/lib*.{a,so} "$out"/lib
54− cp -r Source "$out"/include/Box2D/Source
55− find "$out"/include/Box2D/Source ! -name '*.h' -exec rm '{}' ';'
56− sed -e s@../Source@Box2D/Source@ -i Include/Box2D.h
57− cp Include/Box2D.h "$out"/include/Box2D
58− mkdir -p "$out/share"
59− cp -r Examples "$out/share"
60− '' ["minInit" "addInputs" "doMake" "defEnsureDir"];
62− changeSettings = a.fullDepEntry ''
63− sed -i Source/Common/b2Settings.h -e 's@b2_maxPolygonVertices .*@b2_maxPolygonVertices = 15;@'
64− '' ["minInit" "addInputs" "doUnpack"];
67− description = "2D physics engine";
68− maintainers = with a.lib.maintainers;
72− platforms = with a.lib.platforms;
79− downloadPage = "http://code.google.com/p/box2d/downloads/list";