summary refs log tree commit diff
path: root/pkgs/games/urbanterror
diff options
context:
space:
mode:
authorAlexander Tsamutali <astsmtl@yandex.ru>2012-04-15 22:33:36 +0000
committerAlexander Tsamutali <astsmtl@yandex.ru>2012-04-15 22:33:36 +0000
commita9c51d7af3bd5c6b633d56afe1cb854b967e5c57 (patch)
tree18004854f5c1c42fa2ce073ae887b7162485a621 /pkgs/games/urbanterror
parent73d98c07c231f7bf37e7e24d351830c343beecf2 (diff)
downloadnixpkgs-a9c51d7af3bd5c6b633d56afe1cb854b967e5c57.tar
nixpkgs-a9c51d7af3bd5c6b633d56afe1cb854b967e5c57.tar.gz
nixpkgs-a9c51d7af3bd5c6b633d56afe1cb854b967e5c57.tar.bz2
nixpkgs-a9c51d7af3bd5c6b633d56afe1cb854b967e5c57.tar.lz
nixpkgs-a9c51d7af3bd5c6b633d56afe1cb854b967e5c57.tar.xz
nixpkgs-a9c51d7af3bd5c6b633d56afe1cb854b967e5c57.tar.zst
nixpkgs-a9c51d7af3bd5c6b633d56afe1cb854b967e5c57.zip
games/urbanterror: Fixed compilation issue, but it still doesn't work.
svn path=/nixpkgs/trunk/; revision=33795
Diffstat (limited to 'pkgs/games/urbanterror')
-rw-r--r--pkgs/games/urbanterror/default.nix12
-rw-r--r--pkgs/games/urbanterror/l_script.patch21
2 files changed, 32 insertions, 1 deletions
diff --git a/pkgs/games/urbanterror/default.nix b/pkgs/games/urbanterror/default.nix
index 74448cdad76..875dfc93bb1 100644
--- a/pkgs/games/urbanterror/default.nix
+++ b/pkgs/games/urbanterror/default.nix
@@ -10,21 +10,31 @@ stdenv.mkDerivation rec {
     url = "http://ftp.snt.utwente.nl/pub/games/urbanterror/iourbanterror/source/complete/ioUrbanTerrorSource_2007_12_20.zip";
     sha256 = "1s1wq9m7shhvvk7s4400yrmz7dys501i4c9ln1mglc9dhmi8dmcn";
   };
+  buildInputs = [ unzip SDL mesa openal curl ];
   unpackPhase = ''
     mkdir urbanterror
     cd urbanterror
     unzip $src1
     unzip $src2
   '';
+  patches = [ ./l_script.patch ];
+  patchPhase = ''
+    for d in ioUrbanTerrorClientSource ioUrbanTerrorServerSource
+    do
+      cd "$d"
+      patch -p 0 < "''${patches[0]}"
+      cd ..
+    done
+  '';
   configurePhase = ''
     cd ioUrbanTerrorClientSource
     echo "USE_OPENAL = 1" > Makefile.local
     echo "USE_OPENAL_DLOPEN = 0" >> Makefile.local
     echo "USE_CURL = 1" >> Makefile.local
     echo "USE_CURL_DLOPEN = 0" >> Makefile.local
+    substituteInPlace code/tools/asm/Makefile --replace -Werror ""
     cd ..
   '';
-  buildInputs = [ unzip SDL mesa openal curl ];
   buildPhase = ''
     for d in ioUrbanTerrorClientSource ioUrbanTerrorServerSource
     do
diff --git a/pkgs/games/urbanterror/l_script.patch b/pkgs/games/urbanterror/l_script.patch
new file mode 100644
index 00000000000..8aa176cca8c
--- /dev/null
+++ b/pkgs/games/urbanterror/l_script.patch
@@ -0,0 +1,21 @@
+diff -ur code/botlib/l_script.c kode/botlib/l_script.c
+--- code/botlib/l_script.c	2007-10-09 02:47:26.000000000 +0400
++++ kode/botlib/l_script.c	2012-04-16 02:02:55.170360236 +0400
+@@ -1118,7 +1118,7 @@
+ {
+ 	if (*string == '\"')
+ 	{
+-		strcpy(string, string+1);
++		memmove(string, string+1, strlen(string) - 1);
+ 	} //end if
+ 	if (string[strlen(string)-1] == '\"')
+ 	{
+@@ -1135,7 +1135,7 @@
+ {
+ 	if (*string == '\'')
+ 	{
+-		strcpy(string, string+1);
++		memmove(string, string+1, strlen(string) - 1);
+ 	} //end if
+ 	if (string[strlen(string)-1] == '\'')
+ 	{