games/urbanterror: Fixed compilation issue, but it still doesn't work.

svn path=/nixpkgs/trunk/; revision=33795
This commit is contained in:
Alexander Tsamutali 2012-04-15 22:33:36 +00:00
parent 73d98c07c2
commit a9c51d7af3
2 changed files with 32 additions and 1 deletions

View file

@ -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

View file

@ -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] == '\'')
{