box2d: use stdenv
This replaces use of `builderDefsPackage`. Also change to download tarball from GitHub as it is the new upstream home.
This commit is contained in:
parent
a1e0894cb4
commit
ac8e5edada
|
@ -1,51 +1,33 @@
|
||||||
x@{builderDefsPackage
|
{ stdenv, fetchurl, unzip, cmake, mesa, freeglut, libX11, xproto, inputproto
|
||||||
, unzip, cmake, mesa, freeglut, libX11, xproto
|
, libXi, pkgconfig }:
|
||||||
, inputproto, libXi, fetchsvn, pkgconfig
|
|
||||||
, ...}:
|
|
||||||
builderDefsPackage
|
|
||||||
(a :
|
|
||||||
let
|
|
||||||
helperArgNames = ["stdenv" "fetchsvn" "builderDefsPackage"] ++
|
|
||||||
[];
|
|
||||||
|
|
||||||
buildInputs = map (n: builtins.getAttr n x)
|
stdenv.mkDerivation rec {
|
||||||
(builtins.attrNames (builtins.removeAttrs x helperArgNames));
|
|
||||||
in
|
|
||||||
rec {
|
|
||||||
version = "2.3.0";
|
|
||||||
name = "box2d-${version}";
|
name = "box2d-${version}";
|
||||||
srcDrv = a.fetchsvn {
|
version = "2.3.0";
|
||||||
url = "http://box2d.googlecode.com/svn/trunk";
|
|
||||||
rev = "277";
|
src = fetchurl {
|
||||||
sha256 = "1xp93yw2zcqhmh999v7cwqaqxq1glgyg5r8kfm4yabc1ypba3in4";
|
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 ''
|
cmakeFlags = [ "-DBOX2D_INSTALL=ON" "-DBOX2D_BUILD_SHARED=ON" ];
|
||||||
sed -i Box2D/Common/b2Settings.h -e 's@b2_maxPolygonVertices .*@b2_maxPolygonVertices 15@'
|
|
||||||
'' ["minInit" "addInputs" "doUnpack"];
|
|
||||||
|
|
||||||
goSrcDir = ''cd Box2D'';
|
prePatch = ''
|
||||||
|
substituteInPlace Box2D/Common/b2Settings.h \
|
||||||
|
--replace 'b2_maxPolygonVertices 8' 'b2_maxPolygonVertices 15'
|
||||||
|
'';
|
||||||
|
|
||||||
doCmake = a.fullDepEntry ''
|
meta = with stdenv.lib; {
|
||||||
cd Build;
|
|
||||||
cmake -DBOX2D_INSTALL=ON -DBOX2D_BUILD_SHARED=ON -DCMAKE_INSTALL_PREFIX=$out ..
|
|
||||||
'' ["minInit" "addInputs" "doUnpack"];
|
|
||||||
|
|
||||||
meta = {
|
|
||||||
description = "2D physics engine";
|
description = "2D physics engine";
|
||||||
maintainers = with a.lib.maintainers;
|
homepage = http://box2d.org/;
|
||||||
[
|
maintainers = [ maintainers.raskin ];
|
||||||
raskin
|
platforms = platforms.linux;
|
||||||
];
|
license = licenses.zlib;
|
||||||
platforms = with a.lib.platforms;
|
|
||||||
linux;
|
|
||||||
license = "bsd";
|
|
||||||
inherit version;
|
|
||||||
};
|
};
|
||||||
}) x
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue