diff options
author | Robert Helgesson <robert@rycee.net> | 2015-12-29 22:47:41 +0100 |
---|---|---|
committer | Robert Helgesson <robert@rycee.net> | 2015-12-30 21:15:15 +0100 |
commit | ac8e5edada14629bac7abd7a19b987fa13ec8950 (patch) | |
tree | f83ba5106ca420c0d9f060b61a71e04636b4d649 /pkgs/development/libraries/box2d | |
parent | a1e0894cb45f6c4ed3fc08df814a71081fd58228 (diff) |
box2d: use stdenv
This replaces use of `builderDefsPackage`. Also change to download tarball from GitHub as it is the new upstream home.
Diffstat (limited to 'pkgs/development/libraries/box2d')
-rw-r--r-- | pkgs/development/libraries/box2d/default.nix | 66 |
1 files changed, 24 insertions, 42 deletions
diff --git a/pkgs/development/libraries/box2d/default.nix b/pkgs/development/libraries/box2d/default.nix index 10a7ca5495214..25d291da33271 100644 --- a/pkgs/development/libraries/box2d/default.nix +++ b/pkgs/development/libraries/box2d/default.nix @@ -1,51 +1,33 @@ -x@{builderDefsPackage - , unzip, cmake, mesa, freeglut, libX11, xproto - , inputproto, libXi, fetchsvn, pkgconfig - , ...}: -builderDefsPackage -(a : -let - helperArgNames = ["stdenv" "fetchsvn" "builderDefsPackage"] ++ - []; +{ stdenv, fetchurl, unzip, cmake, mesa, freeglut, libX11, xproto, inputproto +, libXi, pkgconfig }: - buildInputs = map (n: builtins.getAttr n x) - (builtins.attrNames (builtins.removeAttrs x helperArgNames)); -in -rec { - version = "2.3.0"; +stdenv.mkDerivation rec { name = "box2d-${version}"; - srcDrv = a.fetchsvn { - url = "http://box2d.googlecode.com/svn/trunk"; - rev = "277"; - sha256 = "1xp93yw2zcqhmh999v7cwqaqxq1glgyg5r8kfm4yabc1ypba3in4"; + version = "2.3.0"; + + src = fetchurl { + url = "https://github.com/erincatto/Box2D/archive/v${version}.tar.gz"; + sha256 = "1dmbswh4x2n5l3c9h0k72m0z4rdpzfy1xl8m8p3rf5rwkvk3bkg2"; }; - src = srcDrv + "/"; - inherit buildInputs; + sourceRoot = "Box2D-${version}/Box2D"; - phaseNames = ["changeSettings" "doCmake" "doMakeInstall"]; + buildInputs = [ + unzip cmake mesa freeglut libX11 xproto inputproto libXi pkgconfig + ]; - changeSettings = a.fullDepEntry '' - sed -i Box2D/Common/b2Settings.h -e 's@b2_maxPolygonVertices .*@b2_maxPolygonVertices 15@' - '' ["minInit" "addInputs" "doUnpack"]; - - goSrcDir = ''cd Box2D''; + cmakeFlags = [ "-DBOX2D_INSTALL=ON" "-DBOX2D_BUILD_SHARED=ON" ]; - doCmake = a.fullDepEntry '' - cd Build; - cmake -DBOX2D_INSTALL=ON -DBOX2D_BUILD_SHARED=ON -DCMAKE_INSTALL_PREFIX=$out .. - '' ["minInit" "addInputs" "doUnpack"]; - - meta = { + prePatch = '' + substituteInPlace Box2D/Common/b2Settings.h \ + --replace 'b2_maxPolygonVertices 8' 'b2_maxPolygonVertices 15' + ''; + + meta = with stdenv.lib; { description = "2D physics engine"; - maintainers = with a.lib.maintainers; - [ - raskin - ]; - platforms = with a.lib.platforms; - linux; - license = "bsd"; - inherit version; + homepage = http://box2d.org/; + maintainers = [ maintainers.raskin ]; + platforms = platforms.linux; + license = licenses.zlib; }; -}) x - +} |