Merge pull request #12137 from abbradar/quake3

Updates and fixes for Quake 3
This commit is contained in:
Nikolay Amiantov 2016-01-14 14:42:01 +03:00
commit 31b5070cce
11 changed files with 117 additions and 150 deletions

View File

@ -0,0 +1,28 @@
{ stdenv, fetchurl }:
let
version = "1.11-6";
in stdenv.mkDerivation {
name = "quake3-demodata-${version}";
src = fetchurl {
url = "http://ftp.gwdg.de/pub/misc/ftp.idsoftware.com/idstuff/quake3/linux/linuxq3ademo-${version}.x86.gz.sh";
sha256 = "1v54a1hx1bczk9hgn9qhx8vixsy7xn7wj2pylhfjsybfkgvf7pk4";
};
buildCommand = ''
tail -n +165 $src | tar xfz -
mkdir -p $out/baseq3
cp demoq3/*.pk3 $out/baseq3
'';
preferLocalBuild = true;
meta = with stdenv.lib; {
description = "Quake 3 Arena demo content";
license = licenses.unfreeRedistributable;
platforms = platforms.all;
maintainers = with maintainers; [ abbradar ];
};
}

View File

@ -0,0 +1,28 @@
{ stdenv, fetchurl }:
let
version = "1.32b-3";
in stdenv.mkDerivation {
name = "quake3-pointrelease-${version}";
src = fetchurl {
url = "http://ftp.gwdg.de/pub/misc/ftp.idsoftware.com/idstuff/quake3/linux/linuxq3apoint-${version}.x86.run";
sha256 = "11piyksfqyxwl9mpgbc71w9sacsh4d3cdsgia0cy0dbbap2k4qf3";
};
buildCommand = ''
sh $src --tar xf
mkdir -p $out/baseq3
cp baseq3/*.pk3 $out/baseq3
'';
preferLocalBuild = true;
meta = with stdenv.lib; {
description = "Quake 3 Arena point release";
license = licenses.unfreeRedistributable;
platforms = platforms.all;
maintainers = with maintainers; [ abbradar ];
};
}

View File

@ -1,9 +0,0 @@
source $stdenv/setup
tail -n +165 $demo | tar xvfz -
chmod -R +w .
tail -n +175 $update | tar xvfz -
chmod -R +w .
mkdir -p $out/baseq3
cp demoq3/*.pk3 baseq3/*.pk3 $out/baseq3

View File

@ -1,24 +0,0 @@
{stdenv, fetchurl}:
stdenv.mkDerivation {
name = "quake3demo-1.11-6";
builder = ./builder.sh;
# This is needed for pak0.pk3.
demo = fetchurl {
url = http://tarballs.nixos.org/linuxq3ademo-1.11-6.x86.gz.sh;
sha256 = "1v54a1hx1bczk9hgn9qhx8vixsy7xn7wj2pylhfjsybfkgvf7pk4";
};
# This is needed for the additional pak?.pk3 files.
update = fetchurl {
url = http://tarballs.nixos.org/linuxq3apoint-1.31.x86.run;
sha256 = "1kp689452zb8jhd67ghisz2055pqxy9awz4vi0hq5qmp7xrp1x58";
};
# Don't rebuild if the inputs change, since the output is guaranteed
# to be this value.
outputHashMode = "recursive";
outputHashAlgo = "sha256";
outputHash = "00453c43a4jnlbm9w9ws1hdi28hkl63xnxbnbqml25h35ckhzs90";
}

View File

@ -1,51 +0,0 @@
Retrieved from https://bugzilla.icculus.org/show_bug.cgi?id=4331,
removed path prefix.
-- nckx <tobias.geerinckx.rice@gmail.com>
PATCH: Bots don't work on 64 bit Intel CPU's
botlib abuses strcpy (source and dest overlap), and the strcpy function for 64
bit intel CPU's in the latest glibc, does not like this causing the bots to not
load.
The attached patch fixes this.
Note this patch should be credited to: Andreas Bierfert (andreas.bierfert at
lowlatency.de)
See: http://bugzilla.redhat.com/show_bug.cgi?id=526338
diff -up quake3-1.36/code/botlib/l_precomp.c~ quake3-1.36/code/botlib/l_precomp.c
--- code/botlib/l_precomp.c~ 2009-04-27 08:42:37.000000000 +0200
+++ code/botlib/l_precomp.c 2009-11-03 21:03:08.000000000 +0100
@@ -948,7 +948,7 @@ void PC_ConvertPath(char *path)
if ((*ptr == '\\' || *ptr == '/') &&
(*(ptr+1) == '\\' || *(ptr+1) == '/'))
{
- strcpy(ptr, ptr+1);
+ memmove(ptr, ptr+1, strlen(ptr));
} //end if
else
{
diff -up quake3-1.36/code/botlib/l_script.c~ quake3-1.36/code/botlib/l_script.c
--- code/botlib/l_script.c~ 2009-04-27 08:42:37.000000000 +0200
+++ code/botlib/l_script.c 2009-11-03 21:06:11.000000000 +0100
@@ -1118,7 +1118,7 @@ void StripDoubleQuotes(char *string)
{
if (*string == '\"')
{
- strcpy(string, string+1);
+ memmove(string, string+1, strlen(string));
} //end if
if (string[strlen(string)-1] == '\"')
{
@@ -1135,7 +1135,7 @@ void StripSingleQuotes(char *string)
{
if (*string == '\'')
{
- strcpy(string, string+1);
+ memmove(string, string+1, strlen(string));
} //end if
if (string[strlen(string)-1] == '\'')
{

View File

@ -1,43 +0,0 @@
{ lib, stdenv, fetchurl, xlibsWrapper, SDL, mesa, openal, gcc46 }:
stdenv.mkDerivation {
name = "ioquake3-1.36";
src = fetchurl {
url = http://ioquake3.org/files/1.36/ioquake3-1.36.tar.bz2; # calls itself "1.34-rc3"
sha256 = "008vah60z0n9h1qp373xbqvhwfbyywbbhd1np0h0yw66g0qzchzv";
};
patchFlags = "-p0";
patches = [
# Fix for compiling on gcc 4.2.
(fetchurl {
url = "http://sources.gentoo.org/viewcvs.py/*checkout*/gentoo-x86/games-fps/quake3/files/quake3-1.34_rc3-gcc42.patch?rev=1.1";
sha256 = "06c9lxfczcby5q29pim231mr2wdkvbv36xp9zbxp9vk0dfs8rv9x";
})
# Do an exit() instead of _exit(). This is nice for gcov.
# Upstream also seems to do this.
./exit.patch
# No bots on amd64 without this patch.
./botlib.patch
];
buildInputs = [ xlibsWrapper SDL mesa openal gcc46 ];
# Fix building on GCC 4.6.
NIX_CFLAGS_COMPILE = "-Wno-error";
preInstall = ''
mkdir -p $out/baseq3
installTargets=copyfiles
installFlags="COPYDIR=$out"
'';
meta = {
platforms = lib.platforms.linux;
maintainers = [ lib.maintainers.eelco ];
};
}

View File

@ -1,12 +0,0 @@
diff -ru -x '*~' ioquake3_1.34-rc3-orig//code/unix/unix_main.c ioquake3_1.34-rc3//code/unix/unix_main.c
--- code/unix/unix_main.c 2006-11-28 23:05:25.000000000 +0100
+++ code/unix/unix_main.c 2011-01-10 12:43:51.000000000 +0100
@@ -341,7 +341,7 @@
void Sys_Exit( int ex ) {
Sys_ConsoleInputShutdown();
-#ifdef NDEBUG // regular behavior
+#if 0
// We can't do this
// as long as GL DLL's keep installing with atexit...

View File

@ -0,0 +1,38 @@
{ lib, stdenv, fetchgit, xlibsWrapper, SDL2, mesa, openalSoft
, curl, speex, opusfile, libogg, libopus, libjpeg, mumble, freetype
}:
stdenv.mkDerivation {
name = "ioquake3-git-20151228";
src = fetchgit {
url = "https://github.com/ioquake/ioq3";
rev = "fe619680f8fa9794906fc82a9c8c6113770696e6";
sha256 = "5462441df63eebee6f8ed19a8326de5f874dad31e124d37f73d3bab1cd656a87";
};
buildInputs = [ xlibsWrapper SDL2 mesa openalSoft curl speex opusfile libogg libopus libjpeg freetype mumble ];
NIX_CFLAGS_COMPILE = [ "-I${SDL2}/include/SDL2" "-I${opusfile}/include/opus" "-I${libopus}/include/opus" ];
NIX_CFLAGS_LINK = [ "-lSDL2" ];
enableParallelBuilding = true;
makeFlags = [ "USE_INTERNAL_LIBS=0" "USE_FREETYPE=1" "USE_OPENAL_DLOPEN=0" "USE_CURL_DLOPEN=0" ];
installTargets = [ "copyfiles" ];
installFlags = [ "COPYDIR=$(out)" ];
preInstall = ''
mkdir -p $out/baseq3
'';
meta = {
homepage = http://ioquake3.org/;
description = "First person shooter engine based on the Quake 3: Arena and Quake 3: Team Arena";
license = lib.licenses.gpl2;
platforms = lib.platforms.linux;
maintainers = [ lib.maintainers.eelco lib.maintainers.abbradar ];
};
}

View File

@ -2,8 +2,8 @@ source $stdenv/setup
mkdir -p $out/baseq3
for i in $paks; do
if test -d "$paks/baseq3"; then
ln -s $paks/baseq3/* $out/baseq3/
if test -d "$i/baseq3"; then
ln -s "$i/baseq3"/* $out/baseq3/
fi
done

View File

@ -1,13 +1,21 @@
{stdenv, fetchurl, game, paks, mesa, name, description, makeWrapper}:
{ stdenv, fetchurl, mesa, ioquake3, makeWrapper }:
{ paks, name ? (stdenv.lib.head paks).name, description ? "" }:
stdenv.mkDerivation {
name = "${name}-${ioquake3.name}";
builder = ./builder.sh;
buildInputs = [makeWrapper];
nativeBuildInputs = [ makeWrapper ];
inherit game paks mesa name;
inherit paks mesa;
game = ioquake3;
gcc = stdenv.cc.cc;
preferLocalBuild = true;
meta = {
inherit description;

View File

@ -14256,16 +14256,19 @@ let
qqwing = callPackage ../games/qqwing { };
quake3demo = callPackage ../games/quake3/wrapper {
name = "quake3-demo-${quake3game.name}";
quake3wrapper = callPackage ../games/quake3/wrapper { };
quake3demo = quake3wrapper {
name = "quake3-demo-${lib.getVersion quake3demodata}";
description = "Demo of Quake 3 Arena, a classic first-person shooter";
game = quake3game;
paks = [quake3demodata];
paks = [ quake3pointrelease quake3demodata ];
};
quake3demodata = callPackage ../games/quake3/demo { };
quake3demodata = callPackage ../games/quake3/content/demo.nix { };
quake3game = callPackage ../games/quake3/game { };
quake3pointrelease = callPackage ../games/quake3/content/pointrelease.nix { };
ioquake3 = callPackage ../games/quake3/ioquake { };
quantumminigolf = callPackage ../games/quantumminigolf {};
@ -15906,6 +15909,7 @@ aliases = with self; rec {
saneFrontends = sane-frontends; # added 2016-01-02
btrfsProgs = btrfs-progs; # added 2016-01-03
aircrackng = aircrack-ng; # added 2016-01-14
quake3game = ioquake3; # added 2016-01-14
};
tweakAlias = _n: alias: with lib;