summary refs log tree commit diff
path: root/pkgs/games/trackballs/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/games/trackballs/default.nix')
-rw-r--r--pkgs/games/trackballs/default.nix21
1 files changed, 11 insertions, 10 deletions
diff --git a/pkgs/games/trackballs/default.nix b/pkgs/games/trackballs/default.nix
index bdac6cddf2d2b..22d8c944fa8bf 100644
--- a/pkgs/games/trackballs/default.nix
+++ b/pkgs/games/trackballs/default.nix
@@ -1,8 +1,11 @@
-{stdenv, fetchurl, SDL, mesa, SDL_ttf, gettext, zlib, SDL_mixer, SDL_image, guile,
-  debug ? false } :
+{ 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";
@@ -10,16 +13,14 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ zlib mesa SDL SDL_ttf SDL_mixer SDL_image guile gettext ];
 
-  CFLAGS = if debug then "-g -O0" else null;
+  CFLAGS = optionalString debug "-g -O0";
   CXXFLAGS = CFLAGS;
-  NIX_STRIP_DEBUG = if debug then "0" else "1";
-  dontStrip = if debug then true else false;
-  postUnpack = if debug then
-    "ensureDir $out/src; cp -R * $out/src ; cd $out/src"
-    else null;
+  dontStrip = debug;
+  postUnpack = optionalString debug
+    "mkdir -p $out/src; cp -R * $out/src ; cd $out/src";
 
-  NIX_CFLAGS_COMPILE="-iquote ${SDL}/include/SDL";
-  configureFlags = if debug then "--enable-debug" else null;
+  NIX_CFLAGS_COMPILE = "-iquote ${SDL}/include/SDL";
+  configureFlags = optionalString debug "--enable-debug";
 
   patchPhase = ''
     sed -i -e 's/images icons music/images music/' share/Makefile.in