2021-01-21 17:00:13 +00:00
|
|
|
{ lib, stdenv, requireFile, cmake, libGLU, libGL, libX11, libXi }:
|
2014-07-24 09:12:47 +01:00
|
|
|
|
2020-12-31 07:48:55 +00:00
|
|
|
let
|
2014-07-24 09:12:47 +01:00
|
|
|
sourceInfo = rec {
|
|
|
|
version="1.1.0";
|
|
|
|
name="liquidfun-${version}";
|
2014-07-27 21:02:38 +01:00
|
|
|
url="https://github.com/google/liquidfun/releases/download/v${version}/${name}";
|
2014-07-24 09:12:47 +01:00
|
|
|
hash="5011a000eacd6202a47317c489e44aa753a833fb562d970e7b8c0da9de01df86";
|
|
|
|
};
|
|
|
|
in
|
2019-08-13 22:52:01 +01:00
|
|
|
stdenv.mkDerivation {
|
2014-07-24 09:12:47 +01:00
|
|
|
src = requireFile {
|
|
|
|
url = sourceInfo.url;
|
|
|
|
sha256 = sourceInfo.hash;
|
|
|
|
name = sourceInfo.name + ".tar.gz";
|
|
|
|
};
|
|
|
|
|
|
|
|
inherit (sourceInfo) name version;
|
2020-12-31 07:48:55 +00:00
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
buildInputs = [ libGLU libGL libX11 libXi ];
|
2014-07-24 09:12:47 +01:00
|
|
|
|
|
|
|
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"
|
|
|
|
'';
|
2020-12-31 07:48:55 +00:00
|
|
|
|
2014-07-24 09:12:47 +01:00
|
|
|
configurePhase = ''
|
|
|
|
mkdir Build
|
2020-12-31 07:48:55 +00:00
|
|
|
cd Build;
|
2014-07-24 09:12:47 +01:00
|
|
|
cmake -DBOX2D_INSTALL=ON -DBOX2D_BUILD_SHARED=ON -DCMAKE_INSTALL_PREFIX=$out ..
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "2D physics engine based on Box2D";
|
2021-01-21 17:00:13 +00:00
|
|
|
maintainers = with lib.maintainers;
|
2014-07-24 09:12:47 +01:00
|
|
|
[
|
|
|
|
qknight
|
|
|
|
];
|
2021-01-21 17:00:13 +00:00
|
|
|
platforms = lib.platforms.linux;
|
2014-09-03 10:05:21 +01:00
|
|
|
hydraPlatforms = [];
|
2021-01-21 17:00:13 +00:00
|
|
|
license = lib.licenses.bsd2;
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://google.github.io/liquidfun/";
|
2014-07-24 09:12:47 +01:00
|
|
|
};
|
|
|
|
}
|