summary refs log tree commit diff
path: root/pkgs/games/quake3/game/default.nix
blob: 2ad922834d38b37cbd5a8d6e9e0813af5adc495e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{ 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 ];
  };
}