summary refs log tree commit diff
path: root/pkgs/games/trackballs/default.nix
blob: 5606be6a5943c9f491f7bc4bcc5a706beb916708 (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
{ stdenv, fetchurl, SDL, mesa, SDL_ttf, gettext, zlib, SDL_mixer, SDL_image, guile
, debug ? false }:

with stdenv.lib;

stdenv.mkDerivation rec {
  name = "trackballs-1.1.4";
  
  src = fetchurl {
    url = mirror://sourceforge/trackballs/trackballs-1.1.4.tar.gz;
    sha256 = "19ilnif59sxa8xmfisk90wngrd11pj8s86ixzypv8krm4znbm7a5";
  };

  buildInputs = [ zlib mesa SDL SDL_ttf SDL_mixer SDL_image guile gettext ];

  hardeningDisable = [ "format" ];

  CFLAGS = optionalString debug "-g -O0";
  CXXFLAGS = CFLAGS;
  dontStrip = debug;
  postUnpack = optionalString debug
    "mkdir -p $out/src; cp -R * $out/src ; cd $out/src";

  NIX_CFLAGS_COMPILE = "-iquote ${SDL.dev}/include/SDL";
  configureFlags = optionalString debug "--enable-debug";

  patchPhase = ''
    sed -i -e 's/images icons music/images music/' share/Makefile.in
  '';

  meta = {
    homepage = http://trackballs.sourceforge.net/;
    description = "3D Marble Madness clone";
    platforms = stdenv.lib.platforms.linux;
  };
}