2021-11-11 01:56:17 +01:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchzip
|
|
|
|
, SDL2
|
|
|
|
, SDL2_image
|
|
|
|
, SDL2_mixer
|
|
|
|
, zlib
|
|
|
|
, makeWrapper
|
|
|
|
, copyDesktopItems
|
|
|
|
, makeDesktopItem
|
2015-12-29 17:02:16 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2020-12-06 02:46:01 +01:00
|
|
|
pname = "sauerbraten";
|
2021-01-08 17:51:18 +01:00
|
|
|
version = "2020-12-27";
|
2015-12-29 17:02:16 +01:00
|
|
|
|
2020-12-06 02:46:01 +01:00
|
|
|
src = fetchzip {
|
|
|
|
url = "mirror://sourceforge/sauerbraten/sauerbraten_${builtins.replaceStrings [ "-" ] [ "_" ] version}_linux.tar.bz2";
|
2021-01-08 17:51:18 +01:00
|
|
|
sha256 = "0llknzj23vx6f3y452by9c7wlhzclyq4bqi22qd52m3l916z2mn5";
|
2010-12-26 14:14:15 +01:00
|
|
|
};
|
|
|
|
|
2020-12-06 02:46:01 +01:00
|
|
|
nativeBuildInputs = [
|
|
|
|
makeWrapper
|
2021-11-11 01:56:17 +01:00
|
|
|
copyDesktopItems
|
2020-12-06 02:46:01 +01:00
|
|
|
];
|
|
|
|
|
2015-12-29 17:02:16 +01:00
|
|
|
buildInputs = [
|
2021-11-11 01:56:17 +01:00
|
|
|
SDL2
|
|
|
|
SDL2_mixer
|
|
|
|
SDL2_image
|
2019-10-12 14:45:28 +02:00
|
|
|
zlib
|
2015-12-29 17:02:16 +01:00
|
|
|
];
|
2010-12-26 14:14:15 +01:00
|
|
|
|
2023-07-25 15:27:31 +02:00
|
|
|
sourceRoot = "${src.name}/src";
|
2010-12-26 14:14:15 +01:00
|
|
|
|
2021-11-11 01:56:17 +01:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
desktopItems = [
|
|
|
|
(makeDesktopItem {
|
|
|
|
name = "sauerbraten";
|
|
|
|
exec = "sauerbraten_client %u";
|
|
|
|
icon = "sauerbraten";
|
|
|
|
desktopName = "Sauerbraten";
|
|
|
|
comment = "FPS that uses an improved version of the Cube engine";
|
2022-02-22 15:56:15 +01:00
|
|
|
categories = [ "Application" "Game" "ActionGame" ];
|
2021-11-11 01:56:17 +01:00
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2015-12-29 17:02:16 +01:00
|
|
|
installPhase = ''
|
2021-11-11 01:56:17 +01:00
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p $out/bin $out/share/icon/ $out/share/sauerbraten $out/share/doc/sauerbraten
|
|
|
|
cp -r "../docs/"* $out/share/doc/sauerbraten/
|
|
|
|
cp sauer_client sauer_server $out/share/sauerbraten/
|
|
|
|
cp -r ../packages ../data $out/share/sauerbraten/
|
|
|
|
ln -s $out/share/sauerbraten/cube.png $out/share/icon/sauerbraten.png
|
2020-12-06 02:46:01 +01:00
|
|
|
|
|
|
|
makeWrapper $out/share/sauerbraten/sauer_server $out/bin/sauerbraten_server \
|
2022-03-14 19:06:00 +01:00
|
|
|
--chdir "$out/share/sauerbraten"
|
2020-12-06 02:46:01 +01:00
|
|
|
makeWrapper $out/share/sauerbraten/sauer_client $out/bin/sauerbraten_client \
|
2022-03-14 19:06:00 +01:00
|
|
|
--chdir "$out/share/sauerbraten" \
|
2021-11-11 01:56:17 +01:00
|
|
|
--add-flags "-q\''${HOME}/.config/sauerbraten"
|
|
|
|
|
|
|
|
runHook postInstall
|
2015-12-29 17:02:16 +01:00
|
|
|
'';
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2020-12-06 02:46:01 +01:00
|
|
|
description = "A free multiplayer & singleplayer first person shooter, the successor of the Cube FPS";
|
2023-10-26 06:10:22 +02:00
|
|
|
homepage = "http://sauerbraten.org";
|
2020-12-06 02:46:01 +01:00
|
|
|
maintainers = with maintainers; [ raskin ajs124 ];
|
2021-06-13 00:49:02 +02:00
|
|
|
mainProgram = "sauerbraten_client";
|
2013-11-05 00:04:36 +01:00
|
|
|
hydraPlatforms =
|
2010-12-26 14:14:15 +01:00
|
|
|
# raskin: tested amd64-linux;
|
|
|
|
# not setting platforms because it is 0.5+ GiB of game data
|
2021-11-11 01:56:17 +01:00
|
|
|
[ ];
|
|
|
|
license = "freeware"; # as an aggregate - data files have different licenses code is under zlib license
|
2015-12-29 17:02:16 +01:00
|
|
|
platforms = platforms.linux;
|
2010-12-26 14:14:15 +01:00
|
|
|
};
|
2015-12-29 17:02:16 +01:00
|
|
|
}
|