Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 57 lines 1.3 kB view raw
1{ 2 lib, 3 stdenv, 4 requireFile, 5 cmake, 6 libGLU, 7 libGL, 8 libX11, 9 libXi, 10}: 11 12stdenv.mkDerivation rec { 13 pname = "liquidfun"; 14 version = "1.1.0"; 15 16 src = requireFile { 17 url = "https://github.com/google/liquidfun/releases/download/v${version}/liquidfun-${version}"; 18 sha256 = "5011a000eacd6202a47317c489e44aa753a833fb562d970e7b8c0da9de01df86"; 19 name = "liquidfun-${version}.tar.gz"; 20 }; 21 22 nativeBuildInputs = [ cmake ]; 23 buildInputs = [ 24 libGLU 25 libGL 26 libX11 27 libXi 28 ]; 29 30 sourceRoot = "liquidfun/Box2D"; 31 32 preConfigurePhases = [ "preConfigure" ]; 33 34 preConfigure = '' 35 sed -i Box2D/Common/b2Settings.h -e 's@b2_maxPolygonVertices .*@b2_maxPolygonVertices 15@' 36 substituteInPlace Box2D/CMakeLists.txt --replace "Common/b2GrowableStack.h" "Common/b2GrowableStack.h Common/b2GrowableBuffer.h" 37 ''; 38 39 configurePhase = '' 40 runHook preConfigure 41 42 mkdir Build 43 cd Build; 44 cmake -DBOX2D_INSTALL=ON -DBOX2D_BUILD_SHARED=ON -DCMAKE_INSTALL_PREFIX=$out .. 45 46 runHook postConfigure 47 ''; 48 49 meta = with lib; { 50 description = "2D physics engine based on Box2D"; 51 maintainers = with maintainers; [ qknight ]; 52 platforms = platforms.linux; 53 hydraPlatforms = [ ]; 54 license = licenses.bsd2; 55 homepage = "https://google.github.io/liquidfun/"; 56 }; 57}