Merge pull request #58533 from bignaux/assaultcube
assaultcube: unstable-2017-05-01 -> unstable-2018-05-20
This commit is contained in:
commit
cb4b210894
|
@ -1,11 +0,0 @@
|
|||
--- 1.1.0.4/source/src/Makefile
|
||||
+++ 1.1.0.4/source/src/Makefile
|
||||
@@ -6,7 +6,7 @@
|
||||
# found to have been caused by the g++ compiler in the past. This seems to have
|
||||
# been fixed now by relaxing the optimization that g++ does, so although we'll
|
||||
# continue using clang++ (just in case), you can use g++ if you prefer.
|
||||
-CXX=clang++
|
||||
+#CXX=clang++
|
||||
|
||||
# Changing this to ACDEBUG=yes will compile a debug version of AssaultCube.
|
||||
ACDEBUG=no
|
|
@ -1,5 +1,5 @@
|
|||
{ fetchFromGitHub, stdenv, makeDesktopItem, openal, pkgconfig, libogg,
|
||||
libvorbis, SDL, SDL_image, makeWrapper, zlib,
|
||||
libvorbis, SDL, SDL_image, makeWrapper, zlib, file,
|
||||
client ? true, server ? true }:
|
||||
|
||||
with stdenv.lib;
|
||||
|
@ -8,38 +8,21 @@ stdenv.mkDerivation rec {
|
|||
|
||||
# master branch has legacy (1.2.0.2) protocol 1201 and gcc 6 fix.
|
||||
pname = "assaultcube";
|
||||
version = "unstable-2017-05-01";
|
||||
|
||||
meta = {
|
||||
description = "Fast and fun first-person-shooter based on the Cube fps";
|
||||
homepage = https://assault.cubers.net;
|
||||
maintainers = [ maintainers.genesis ];
|
||||
platforms = platforms.linux; # should work on darwin with a little effort.
|
||||
license = stdenv.lib.licenses.zlib;
|
||||
};
|
||||
version = "unstable-2018-05-20";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "assaultcube";
|
||||
repo = "AC";
|
||||
rev = "9f537b0876a39d7686e773040469fbb1417de18b";
|
||||
sha256 = "0nvckn67mmfaa7x3j41xyxjllxqzfx1dxg8pnqsaak3kkzds34pl";
|
||||
rev = "f58ea22b46b5013a520520670434b3c235212371";
|
||||
sha256 = "1vfn3d55vmmipdykrcfvgk6dddi9y95vlclsliirm7jdp20f15hd";
|
||||
};
|
||||
|
||||
# ${branch} not accepted as a value ?
|
||||
# TODO: write a functional BUNDLED_ENET option and restore it in deps.
|
||||
patches = [ ./assaultcube-next.patch ];
|
||||
nativeBuildInputs = [ makeWrapper pkgconfig ];
|
||||
|
||||
nativeBuildInputs = [ pkgconfig ];
|
||||
|
||||
# add optional for server only ?
|
||||
buildInputs = [ makeWrapper openal SDL SDL_image libogg libvorbis zlib ];
|
||||
|
||||
#makeFlags = [ "CXX=g++" ];
|
||||
buildInputs = [ file zlib ] ++ optionals client [ openal SDL SDL_image libogg libvorbis ];
|
||||
|
||||
targets = (optionalString server "server") + (optionalString client " client");
|
||||
buildPhase = ''
|
||||
make -C source/src ${targets}
|
||||
'';
|
||||
makeFlags = [ "-C source/src" "CXX=c++" "${targets}" ];
|
||||
|
||||
desktop = makeDesktopItem {
|
||||
name = "AssaultCube";
|
||||
|
@ -61,21 +44,29 @@ stdenv.mkDerivation rec {
|
|||
|
||||
cp -r config packages $out/$gamedatadir
|
||||
|
||||
# install custom script
|
||||
substituteAll ${./launcher.sh} $bindir/assaultcube
|
||||
chmod +x $bindir/assaultcube
|
||||
|
||||
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
|
||||
|
||||
makeWrapper $out/bin/ac_client $out/bin/${pname} \
|
||||
--run "cd $out/$gamedatadir" --add-flags "--home=\$HOME/.assaultcube/v1.2next --init"
|
||||
fi
|
||||
|
||||
if (test -e source/src/ac_server) then
|
||||
cp source/src/ac_server $bindir
|
||||
ln -s $bindir/${pname} $bindir/${pname}-server
|
||||
makeWrapper $out/bin/ac_server $out/bin/${pname}-server \
|
||||
--run "cd $out/$gamedatadir" --add-flags "-Cconfig/servercmdline.txt"
|
||||
fi
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Fast and fun first-person-shooter based on the Cube fps";
|
||||
homepage = https://assault.cubers.net;
|
||||
maintainers = [ maintainers.genesis ];
|
||||
platforms = platforms.linux; # should work on darwin with a little effort.
|
||||
license = stdenv.lib.licenses.zlib;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
#!@shell@
|
||||
# original scripts are very awful
|
||||
|
||||
CUBE_DIR=@out@@gamedatadir@
|
||||
|
||||
case $(basename "$0") in
|
||||
assaultcube-server)
|
||||
CUBE_OPTIONS="-Cconfig/servercmdline.txt"
|
||||
BINARYPATH=@out@/bin/ac_server
|
||||
;;
|
||||
assaultcube)
|
||||
CUBE_OPTIONS="--home=${HOME}/.assaultcube/v1.2next --init"
|
||||
BINARYPATH=@out@/bin/ac_client
|
||||
;;
|
||||
*) echo "$0" is not supported.
|
||||
exit 1
|
||||
esac
|
||||
|
||||
cd $CUBE_DIR
|
||||
exec "${BINARYPATH}" ${CUBE_OPTIONS} "$@"
|
Loading…
Reference in a new issue