From a9c51d7af3bd5c6b633d56afe1cb854b967e5c57 Mon Sep 17 00:00:00 2001 From: Alexander Tsamutali Date: Sun, 15 Apr 2012 22:33:36 +0000 Subject: [PATCH] games/urbanterror: Fixed compilation issue, but it still doesn't work. svn path=/nixpkgs/trunk/; revision=33795 --- pkgs/games/urbanterror/default.nix | 12 +++++++++++- pkgs/games/urbanterror/l_script.patch | 21 +++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 pkgs/games/urbanterror/l_script.patch 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] == '\'') + {