From aa744f88a1a51aabb42e6569ef6551c28ece2c8d Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Fri, 17 Dec 2010 13:02:17 +0000 Subject: [PATCH] Adding Box2D library svn path=/nixpkgs/trunk/; revision=25172 --- pkgs/development/libraries/box2d/default.nix | 55 ++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 57 insertions(+) create mode 100644 pkgs/development/libraries/box2d/default.nix diff --git a/pkgs/development/libraries/box2d/default.nix b/pkgs/development/libraries/box2d/default.nix new file mode 100644 index 000000000000..d73d24af2ff2 --- /dev/null +++ b/pkgs/development/libraries/box2d/default.nix @@ -0,0 +1,55 @@ +x@{builderDefsPackage + , unzip, cmake, mesa, freeglut, libX11, xproto + , inputproto, libXi + , ...}: +builderDefsPackage +(a : +let + helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++ + []; + + buildInputs = map (n: builtins.getAttr n x) + (builtins.attrNames (builtins.removeAttrs x helperArgNames)); + sourceInfo = rec { + baseName="box2d"; + version="2.1.2"; + name="${baseName}-${version}"; + url="http://box2d.googlecode.com/files/Box2D_v${version}.zip"; + hash="0m5szd74ig8yqazwk2g3zl4z7wwp08k52awawk1pigy6a4z1qd9v"; + }; +in +rec { + src = a.fetchurl { + url = sourceInfo.url; + sha256 = sourceInfo.hash; + }; + + inherit (sourceInfo) name version; + inherit buildInputs; + + phaseNames = ["doCmake" "doMakeInstall"]; + + goSrcDir = ''cd Box2D''; + + doCmake = a.fullDepEntry '' + cd Build; + cmake -DBOX2D_INSTALL=ON -DBOX2D_BUILD_SHARED=ON -DCMAKE_INSTALL_PREFIX=$out .. + '' ["minInit" "addInputs" "doUnpack"]; + + meta = { + description = "2D physics engine"; + maintainers = with a.lib.maintainers; + [ + raskin + ]; + platforms = with a.lib.platforms; + linux; + license = "bsd"; + }; + passthru = { + updateInfo = { + downloadPage = "http://code.google.com/p/box2d/downloads/list"; + }; + }; +}) x + diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 7dfdb18a6376..c344af3750c4 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2701,6 +2701,8 @@ let botan = callPackage ../development/libraries/botan { }; + box2d = callPackage ../development/libraries/box2d { }; + buddy = callPackage ../development/libraries/buddy { }; cairo = callPackage ../development/libraries/cairo { };