2021-01-17 05:49:22 +00:00
|
|
|
{ fetchFromGitHub, lib, stdenv, makeDesktopItem, openal, pkg-config, libogg,
|
2019-03-29 12:14:48 +00:00
|
|
|
libvorbis, SDL, SDL_image, makeWrapper, zlib, file,
|
2018-02-05 15:06:49 +00:00
|
|
|
client ? true, server ? true }:
|
|
|
|
|
2021-01-15 04:31:39 +00:00
|
|
|
with lib;
|
2018-02-05 15:06:49 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
|
|
|
|
# master branch has legacy (1.2.0.2) protocol 1201 and gcc 6 fix.
|
|
|
|
pname = "assaultcube";
|
2019-03-29 12:14:48 +00:00
|
|
|
version = "unstable-2018-05-20";
|
2018-02-05 15:06:49 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "assaultcube";
|
|
|
|
repo = "AC";
|
2019-03-29 12:14:48 +00:00
|
|
|
rev = "f58ea22b46b5013a520520670434b3c235212371";
|
|
|
|
sha256 = "1vfn3d55vmmipdykrcfvgk6dddi9y95vlclsliirm7jdp20f15hd";
|
2018-02-05 15:06:49 +00:00
|
|
|
};
|
|
|
|
|
2021-01-17 05:49:22 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper pkg-config ];
|
2018-02-05 15:06:49 +00:00
|
|
|
|
2019-03-29 12:14:48 +00:00
|
|
|
buildInputs = [ file zlib ] ++ optionals client [ openal SDL SDL_image libogg libvorbis ];
|
2018-02-05 15:06:49 +00:00
|
|
|
|
|
|
|
targets = (optionalString server "server") + (optionalString client " client");
|
2021-02-16 11:48:46 +00:00
|
|
|
makeFlags = [ "-C source/src" "CXX=${stdenv.cc.targetPrefix}c++" targets ];
|
2018-02-05 15:06:49 +00:00
|
|
|
|
|
|
|
desktop = makeDesktopItem {
|
|
|
|
name = "AssaultCube";
|
|
|
|
desktopName = "AssaultCube";
|
|
|
|
comment = "A multiplayer, first-person shooter game, based on the CUBE engine. Fast, arcade gameplay.";
|
|
|
|
genericName = "First-person shooter";
|
2020-06-25 03:18:37 +01:00
|
|
|
categories = "Game;ActionGame;Shooter";
|
2018-02-05 15:06:49 +00:00
|
|
|
icon = "assaultcube.png";
|
2019-09-09 00:38:31 +01:00
|
|
|
exec = pname;
|
2018-02-05 15:06:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
gamedatadir = "/share/games/${pname}";
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
|
|
|
|
bindir=$out/bin
|
|
|
|
|
|
|
|
mkdir -p $bindir $out/$gamedatadir
|
|
|
|
|
|
|
|
cp -r config packages $out/$gamedatadir
|
|
|
|
|
|
|
|
if (test -e source/src/ac_client) then
|
|
|
|
cp source/src/ac_client $bindir
|
|
|
|
mkdir -p $out/share/applications
|
|
|
|
cp ${desktop}/share/applications/* $out/share/applications
|
|
|
|
install -Dpm644 packages/misc/icon.png $out/share/icons/assaultcube.png
|
|
|
|
install -Dpm644 packages/misc/icon.png $out/share/pixmaps/assaultcube.png
|
2020-11-18 08:42:33 +00:00
|
|
|
|
2019-03-29 12:14:48 +00:00
|
|
|
makeWrapper $out/bin/ac_client $out/bin/${pname} \
|
|
|
|
--run "cd $out/$gamedatadir" --add-flags "--home=\$HOME/.assaultcube/v1.2next --init"
|
2018-02-05 15:06:49 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if (test -e source/src/ac_server) then
|
|
|
|
cp source/src/ac_server $bindir
|
2019-03-29 12:14:48 +00:00
|
|
|
makeWrapper $out/bin/ac_server $out/bin/${pname}-server \
|
|
|
|
--run "cd $out/$gamedatadir" --add-flags "-Cconfig/servercmdline.txt"
|
2018-02-05 15:06:49 +00:00
|
|
|
fi
|
|
|
|
'';
|
2019-03-29 12:14:48 +00:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Fast and fun first-person-shooter based on the Cube fps";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://assault.cubers.net";
|
2020-11-17 16:50:53 +00:00
|
|
|
maintainers = [ ];
|
2019-03-29 12:14:48 +00:00
|
|
|
platforms = platforms.linux; # should work on darwin with a little effort.
|
2021-05-09 20:30:01 +01:00
|
|
|
license = lib.licenses.unfree;
|
2019-03-29 12:14:48 +00:00
|
|
|
};
|
2018-02-05 15:06:49 +00:00
|
|
|
}
|