Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 lib, 3 fetchurl, 4 stdenv, 5 runtimeShell, 6 SDL2, 7 freealut, 8 SDL2_image, 9 openal, 10 physfs, 11 zlib, 12 libGLU, 13 libGL, 14 glew, 15 tinyxml-2, 16 copyDesktopItems, 17 makeDesktopItem, 18}: 19 20stdenv.mkDerivation rec { 21 pname = "trigger-rally"; 22 version = "0.6.6.1"; 23 24 src = fetchurl { 25 url = "mirror://sourceforge/trigger-rally/${pname}-${version}.tar.gz"; 26 sha256 = "016bc2hczqscfmngacim870hjcsmwl8r3aq8x03vpf22s49nw23z"; 27 }; 28 29 nativeBuildInputs = [ copyDesktopItems ]; 30 31 buildInputs = [ 32 SDL2 33 freealut 34 SDL2_image 35 openal 36 physfs 37 zlib 38 libGLU 39 libGL 40 glew 41 tinyxml-2 42 ]; 43 44 preConfigure = '' 45 sed s,/usr/local,$out, -i bin/*defs 46 47 cd src 48 49 sed s,lSDL2main,lSDL2, -i GNUmakefile 50 export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${lib.getInclude SDL2}/include/SDL2" 51 ''; 52 53 makeFlags = [ 54 "prefix=${placeholder "out"}" 55 ]; 56 57 enableParallelBuilding = true; 58 59 postInstall = '' 60 mkdir -p $out/bin 61 cat <<EOF > $out/bin/trigger-rally 62 #!${runtimeShell} 63 exec $out/games/trigger-rally "$@" 64 EOF 65 chmod +x $out/bin/trigger-rally 66 67 mkdir -p $out/share/pixmaps/ 68 ln -s $out/share/games/trigger-rally/icon/trigger-rally-icons.svg $out/share/pixmaps/trigger.svg 69 ''; 70 71 desktopItems = [ 72 (makeDesktopItem { 73 name = "Trigger"; 74 exec = "trigger-rally"; 75 icon = "trigger"; 76 desktopName = "Trigger"; 77 comment = "Fast-paced 3D single-player rally racing game"; 78 categories = [ 79 "Game" 80 "ActionGame" 81 ]; 82 }) 83 ]; 84 85 meta = { 86 description = "Fast-paced single-player racing game"; 87 mainProgram = "trigger-rally"; 88 homepage = "http://trigger-rally.sourceforge.net/"; 89 license = lib.licenses.gpl2Plus; 90 maintainers = [ ]; 91 platforms = with lib.platforms; linux; 92 }; 93}