diff --git a/pkgs/games/quake3/game/botlib.patch b/pkgs/games/quake3/game/botlib.patch deleted file mode 100644 index 82e2c781101298..00000000000000 --- a/pkgs/games/quake3/game/botlib.patch +++ /dev/null @@ -1,51 +0,0 @@ -Retrieved from https://bugzilla.icculus.org/show_bug.cgi?id=4331, -removed path prefix. - - -- nckx - -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 deleted file mode 100644 index 2ad922834d38b3..00000000000000 --- a/pkgs/games/quake3/game/default.nix +++ /dev/null @@ -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 ]; - }; -} diff --git a/pkgs/games/quake3/game/exit.patch b/pkgs/games/quake3/game/exit.patch deleted file mode 100644 index 82785167a78247..00000000000000 --- a/pkgs/games/quake3/game/exit.patch +++ /dev/null @@ -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... diff --git a/pkgs/games/quake3/ioquake/default.nix b/pkgs/games/quake3/ioquake/default.nix new file mode 100644 index 00000000000000..f9f4b21546fa42 --- /dev/null +++ b/pkgs/games/quake3/ioquake/default.nix @@ -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 ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f009f818e9f48b..9540c0a99cc0de 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -14257,15 +14257,15 @@ let qqwing = callPackage ../games/qqwing { }; quake3demo = callPackage ../games/quake3/wrapper { - name = "quake3-demo-${quake3game.name}"; + name = "quake3-demo-${ioquake3.name}"; description = "Demo of Quake 3 Arena, a classic first-person shooter"; - game = quake3game; + game = ioquake3; paks = [quake3demodata]; }; quake3demodata = callPackage ../games/quake3/demo { }; - quake3game = callPackage ../games/quake3/game { }; + ioquake3 = callPackage ../games/quake3/ioquake { }; quantumminigolf = callPackage ../games/quantumminigolf {}; @@ -15906,6 +15906,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;