From d105ed081f5e29ca0eab89f591b1d95653773e7f Mon Sep 17 00:00:00 2001 From: Joachim Schiele Date: Thu, 24 Jul 2014 10:12:47 +0200 Subject: [PATCH] liquidfun: added google liquidfun (a box2d fork) --- .../libraries/liquidfun/default.nix | 50 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 52 insertions(+) create mode 100644 pkgs/development/libraries/liquidfun/default.nix diff --git a/pkgs/development/libraries/liquidfun/default.nix b/pkgs/development/libraries/liquidfun/default.nix new file mode 100644 index 000000000000..02604fb94cf5 --- /dev/null +++ b/pkgs/development/libraries/liquidfun/default.nix @@ -0,0 +1,50 @@ +{ stdenv, requireFile, cmake, mesa, libX11, libXi, ... }: + +let + sourceInfo = rec { + version="1.1.0"; + name="liquidfun-${version}"; + url="http://github.com/foo/${name}.tar.gz"; + hash="5011a000eacd6202a47317c489e44aa753a833fb562d970e7b8c0da9de01df86"; + }; + +in + +stdenv.mkDerivation rec { + src = requireFile { + url = sourceInfo.url; + sha256 = sourceInfo.hash; + name = sourceInfo.name + ".tar.gz"; + }; + + inherit (sourceInfo) name version; + buildInputs = [ cmake mesa libX11 libXi ]; + + sourceRoot = "liquidfun/Box2D/"; + + preConfigurePhases = "preConfigure"; + + preConfigure = '' + sed -i Box2D/Common/b2Settings.h -e 's@b2_maxPolygonVertices .*@b2_maxPolygonVertices 15@' + substituteInPlace Box2D/CMakeLists.txt --replace "Common/b2GrowableStack.h" "Common/b2GrowableStack.h Common/b2GrowableBuffer.h" + ''; + + configurePhase = '' + mkdir Build + cd Build; + cmake -DBOX2D_INSTALL=ON -DBOX2D_BUILD_SHARED=ON -DCMAKE_INSTALL_PREFIX=$out .. + ''; + + meta = { + description = "2D physics engine based on Box2D"; + maintainers = with stdenv.lib.maintainers; + [ + qknight + ]; + platforms = with stdenv.lib.platforms; + linux; + license = "bsd"; + homepage = https://google.github.io/liquidfun/; + }; +} + diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b3ba6a64df2f..2128d2373874 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5527,6 +5527,8 @@ let lirc = callPackage ../development/libraries/lirc { }; + liquidfun = callPackage ../development/libraries/liquidfun { }; + liquidwar = builderDefsPackage ../games/liquidwar { inherit (xlibs) xproto libX11 libXrender; inherit gmp mesa libjpeg