lol

Merge pull request #169975 from DarkOnion0/aussault-cube

authored by

Sandro and committed by
GitHub
a65b7ef4 0fe250c8

+53 -27
+53 -27
pkgs/games/assaultcube/default.nix
··· 1 - { fetchFromGitHub, lib, stdenv, makeDesktopItem, openal, pkg-config, libogg, 2 - libvorbis, SDL, SDL_image, makeWrapper, zlib, file, 3 - client ? true, server ? true }: 4 - 5 - with lib; 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , makeDesktopItem 5 + , copyDesktopItems 6 + , openal 7 + , pkg-config 8 + , libogg 9 + , libvorbis 10 + , SDL2 11 + , SDL2_image 12 + , makeWrapper 13 + , zlib 14 + , file 15 + , client ? true, server ? true 16 + }: 6 17 7 18 stdenv.mkDerivation rec { 8 - 9 - # master branch has legacy (1.2.0.2) protocol 1201 and gcc 6 fix. 10 19 pname = "assaultcube"; 11 - version = "unstable-2018-05-20"; 20 + version = "1.3.0.2"; 12 21 13 22 src = fetchFromGitHub { 14 23 owner = "assaultcube"; 15 24 repo = "AC"; 16 - rev = "f58ea22b46b5013a520520670434b3c235212371"; 17 - sha256 = "1vfn3d55vmmipdykrcfvgk6dddi9y95vlclsliirm7jdp20f15hd"; 25 + rev = "v${version}"; 26 + sha256 = "0qv339zw9q5q1y7bghca03gw7z4v89sl4lbr6h3b7siy08mcwiz9"; 18 27 }; 19 28 20 - nativeBuildInputs = [ makeWrapper pkg-config ]; 29 + nativeBuildInputs = [ 30 + makeWrapper 31 + pkg-config 32 + copyDesktopItems 33 + ]; 21 34 22 - buildInputs = [ file zlib ] ++ optionals client [ openal SDL SDL_image libogg libvorbis ]; 35 + buildInputs = [ 36 + file 37 + zlib 38 + ] ++ lib.optionals client [ 39 + openal 40 + SDL2 41 + SDL2_image 42 + libogg 43 + libvorbis 44 + ]; 23 45 24 - targets = (optionalString server "server") + (optionalString client " client"); 46 + targets = (lib.optionalString server "server") + (lib.optionalString client " client"); 25 47 makeFlags = [ "-C source/src" "CXX=${stdenv.cc.targetPrefix}c++" targets ]; 26 48 27 - desktop = makeDesktopItem { 28 - name = "AssaultCube"; 29 - desktopName = "AssaultCube"; 30 - comment = "A multiplayer, first-person shooter game, based on the CUBE engine. Fast, arcade gameplay."; 31 - genericName = "First-person shooter"; 32 - categories = [ "Game" "ActionGame" "Shooter" ]; 33 - icon = "assaultcube.png"; 34 - exec = pname; 35 - }; 49 + desktopItems = [ 50 + (makeDesktopItem { 51 + name = pname; 52 + desktopName = "AssaultCube"; 53 + comment = "A multiplayer, first-person shooter game, based on the CUBE engine. Fast, arcade gameplay."; 54 + genericName = "First-person shooter"; 55 + categories = [ "Game" "ActionGame" "Shooter" ]; 56 + icon = "assaultcube"; 57 + exec = pname; 58 + }) 59 + ]; 36 60 37 61 gamedatadir = "/share/games/${pname}"; 38 62 39 63 installPhase = '' 64 + runHook preInstall 40 65 41 66 bindir=$out/bin 42 67 ··· 47 72 if (test -e source/src/ac_client) then 48 73 cp source/src/ac_client $bindir 49 74 mkdir -p $out/share/applications 50 - cp ${desktop}/share/applications/* $out/share/applications 51 75 install -Dpm644 packages/misc/icon.png $out/share/icons/assaultcube.png 52 76 install -Dpm644 packages/misc/icon.png $out/share/pixmaps/assaultcube.png 53 77 ··· 60 84 makeWrapper $out/bin/ac_server $out/bin/${pname}-server \ 61 85 --chdir "$out/$gamedatadir" --add-flags "-Cconfig/servercmdline.txt" 62 86 fi 63 - ''; 87 + 88 + runHook postInstall 89 + ''; 64 90 65 - meta = { 91 + meta = with lib; { 66 92 description = "Fast and fun first-person-shooter based on the Cube fps"; 67 93 homepage = "https://assault.cubers.net"; 68 - maintainers = [ ]; 69 94 platforms = platforms.linux; # should work on darwin with a little effort. 70 - license = lib.licenses.unfree; 95 + license = licenses.unfree; 96 + maintainers = with maintainers; [ darkonion0 ]; 71 97 }; 72 98 }