1 { lib, stdenv, fetchurl, gtk2-x11, glib, pango, cairo, atk, gdk-pixbuf, libX11 }:
3 # Arena is free software in the sense of "free beer" but not as in "free
4 # speech". We can install it as we please, but we cannot re-distribute it in
5 # any way other than the original release tarball, so we cannot include its NAR
6 # into the Nixpkgs channel.
10 inherit (lib) makeLibraryPath;
14 stdenv.mkDerivation rec {
16 version = "3.10-beta";
19 url = "http://www.playwitharena.de/downloads/arenalinux_64bit_${lib.replaceStrings ["-"] [""] version}.tar.gz";
20 sha256 = "1pzb9sg4lzbbi4gbldvlb85p8xyl9xnplxwyb9pkk2mwzvvxkf0d";
23 # stdenv.cc.cc.lib is in that list to pick up libstdc++.so. Is there a better way?
24 buildInputs = [gtk2-x11 glib pango cairo atk gdk-pixbuf libX11 stdenv.cc.cc.lib];
27 # This is is a tar bomb, i.e. it extract a dozen files and directories to
28 # the top-level, so we must create a sub-directory first.
29 mkdir -p $out/lib/${pname}-${version}
30 tar -C $out/lib/${pname}-${version} -xf ${src}
32 # Remove executable bits from data files. This matters for the find command
33 # we'll use below to find all bundled engines.
34 chmod -x $out/lib/${pname}-${version}/Engines/*/*.{txt,bin,bmp,zip}
38 # Arena has (at least) two executables plus a couple of bundled chess
39 # engines that we need to patch.
40 exes=( $(find $out -name '*x86_64_linux')
41 $(find $out/lib/${pname}-${version}/Engines -type f -perm /u+x)
43 for i in "''${exes[@]}"; do
44 # Arminius is statically linked.
45 if [[ $i =~ "Arminius_2017-01-01" ]]; then echo yo $i; continue; fi
46 echo Fixing interpreter and rpath paths in $i ...
48 --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
49 --set-rpath ${makeLibraryPath buildInputs}:$(cat $NIX_CC/nix-support/orig-cc)/${libDir} \
56 ln -s $out/lib/${pname}-${version}/Arena_x86_64_linux $out/bin/arena
62 description = "Chess GUI for analyzing with and playing against various engines";
64 A free Graphical User Interface (GUI) for chess. Arena assists you in
65 analyzing and playing games as well as in testing chess engines. It runs
66 on Linux or Windows. Arena is compatible to Winboard protocol I, II and
67 UCI protocol I, II. Furthermore, compatible to Chess960, DGT electronic
68 chess board & DGT clocks and much more.
70 license = lib.licenses.unfree;
71 sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
72 homepage = "http://www.playwitharena.de";
73 platforms = ["x86_64-linux"];