summary refs log tree commit diff
path: root/pkgs/games/arena/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/games/arena/default.nix')
-rw-r--r--pkgs/games/arena/default.nix23
1 files changed, 12 insertions, 11 deletions
diff --git a/pkgs/games/arena/default.nix b/pkgs/games/arena/default.nix
index beba98b6316..16553a5f8ea 100644
--- a/pkgs/games/arena/default.nix
+++ b/pkgs/games/arena/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, gtk2-x11, glib, pango, cairo, atk, gdk-pixbuf, libX11 }:
+{ lib, stdenv, fetchurl, gtk2-x11, glib, pango, cairo, atk, gdk-pixbuf, libX11 }:
 
 # Arena is free software in the sense of "free beer" but not as in "free
 # speech". We can install it as we please, but we cannot re-distribute it in
@@ -7,15 +7,16 @@
 
 let
 
-  inherit (stdenv.lib) makeLibraryPath;
+  inherit (lib) makeLibraryPath;
   libDir = "lib64";
 
 in
 stdenv.mkDerivation rec {
-  name = "arena-3.10-beta";
+  pname = "arena";
+  version = "3.10-beta";
 
   src = fetchurl {
-    url = "http://www.playwitharena.de/downloads/arenalinux_64bit_3.10beta.tar.gz";
+    url = "http://www.playwitharena.de/downloads/arenalinux_64bit_${lib.replaceStrings ["-"] [""] version}.tar.gz";
     sha256 = "1pzb9sg4lzbbi4gbldvlb85p8xyl9xnplxwyb9pkk2mwzvvxkf0d";
   };
 
@@ -25,19 +26,19 @@ stdenv.mkDerivation rec {
   unpackPhase = ''
     # This is is a tar bomb, i.e. it extract a dozen files and directories to
     # the top-level, so we must create a sub-directory first.
-    mkdir -p $out/lib/${name}
-    tar -C $out/lib/${name} -xf ${src}
+    mkdir -p $out/lib/${pname}-${version}
+    tar -C $out/lib/${pname}-${version} -xf ${src}
 
     # Remove executable bits from data files. This matters for the find command
     # we'll use below to find all bundled engines.
-    chmod -x $out/lib/${name}/Engines/*/*.{txt,bin,bmp,zip}
+    chmod -x $out/lib/${pname}-${version}/Engines/*/*.{txt,bin,bmp,zip}
   '';
 
   buildPhase = ''
     # Arena has (at least) two executables plus a couple of bundled chess
     # engines that we need to patch.
     exes=( $(find $out -name '*x86_64_linux')
-           $(find $out/lib/${name}/Engines -type f -perm /u+x)
+           $(find $out/lib/${pname}-${version}/Engines -type f -perm /u+x)
          )
     for i in "''${exes[@]}"; do
       # Arminius is statically linked.
@@ -52,7 +53,7 @@ stdenv.mkDerivation rec {
 
   installPhase = ''
     mkdir -p $out/bin
-    ln -s $out/lib/${name}/Arena_x86_64_linux $out/bin/arena
+    ln -s $out/lib/${pname}-${version}/Arena_x86_64_linux $out/bin/arena
   '';
 
   dontStrip = true;
@@ -66,9 +67,9 @@ stdenv.mkDerivation rec {
       UCI protocol I, II. Furthermore, compatible to Chess960, DGT electronic
       chess board & DGT clocks and much more.
     '';
-    license = stdenv.lib.licenses.unfree;
+    license = lib.licenses.unfree;
     platforms = ["x86_64-linux"];
-    hydraPlatforms = stdenv.lib.platforms.none;
+    hydraPlatforms = lib.platforms.none;
   };
 
 }