summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorTobias Geerinckx-Rice <tobias.geerinckx.rice@gmail.com>2015-07-20 01:12:52 +0200
committerTobias Geerinckx-Rice <tobias.geerinckx.rice@gmail.com>2015-07-20 01:12:52 +0200
commit584effa891a4a5c71bd4085832f269c35f022e64 (patch)
tree91e48e9e4dd814d601aff0af7eec8f59171e5365 /pkgs
parent3d031a0764771c78f48afd8c810a529596ae5afe (diff)
parentb825befbdb8cf3ec2fdd3c9ddf471b8946868245 (diff)
downloadnixpkgs-584effa891a4a5c71bd4085832f269c35f022e64.tar
nixpkgs-584effa891a4a5c71bd4085832f269c35f022e64.tar.gz
nixpkgs-584effa891a4a5c71bd4085832f269c35f022e64.tar.bz2
nixpkgs-584effa891a4a5c71bd4085832f269c35f022e64.tar.lz
nixpkgs-584effa891a4a5c71bd4085832f269c35f022e64.tar.xz
nixpkgs-584effa891a4a5c71bd4085832f269c35f022e64.tar.zst
nixpkgs-584effa891a4a5c71bd4085832f269c35f022e64.zip
Merge pull request #8809 from nckx/fix-quake3-botlib
quake3: add botlib patch for amd64
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/games/quake3/game/botlib.patch51
-rw-r--r--pkgs/games/quake3/game/default.nix3
2 files changed, 54 insertions, 0 deletions
diff --git a/pkgs/games/quake3/game/botlib.patch b/pkgs/games/quake3/game/botlib.patch
new file mode 100644
index 00000000000..82e2c781101
--- /dev/null
+++ b/pkgs/games/quake3/game/botlib.patch
@@ -0,0 +1,51 @@
+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] == '\'')
+ 	{
diff --git a/pkgs/games/quake3/game/default.nix b/pkgs/games/quake3/game/default.nix
index cbcc8c290f8..ed447004345 100644
--- a/pkgs/games/quake3/game/default.nix
+++ b/pkgs/games/quake3/game/default.nix
@@ -20,6 +20,9 @@ stdenv.mkDerivation {
     # 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 = [ x11 SDL mesa openal gcc46 ];