2021-01-15 05:31:39 +01:00
|
|
|
{ lib, stdenv, fetchurl, gtk2-x11, glib, pango, cairo, atk, gdk-pixbuf, libX11 }:
|
2018-07-24 15:12:07 +02:00
|
|
|
|
|
|
|
# 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
|
|
|
|
# any way other than the original release tarball, so we cannot include its NAR
|
|
|
|
# into the Nixpkgs channel.
|
|
|
|
|
|
|
|
let
|
|
|
|
|
2021-01-15 05:31:39 +01:00
|
|
|
inherit (lib) makeLibraryPath;
|
2018-07-24 15:12:07 +02:00
|
|
|
libDir = "lib64";
|
|
|
|
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2020-08-14 15:43:34 +02:00
|
|
|
name = "arena-3.10-beta";
|
2018-07-24 15:12:07 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
2020-08-14 15:43:34 +02:00
|
|
|
url = "http://www.playwitharena.de/downloads/arenalinux_64bit_3.10beta.tar.gz";
|
|
|
|
sha256 = "1pzb9sg4lzbbi4gbldvlb85p8xyl9xnplxwyb9pkk2mwzvvxkf0d";
|
2018-07-24 15:12:07 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
# stdenv.cc.cc.lib is in that list to pick up libstdc++.so. Is there a better way?
|
2019-05-22 13:03:39 +02:00
|
|
|
buildInputs = [gtk2-x11 glib pango cairo atk gdk-pixbuf libX11 stdenv.cc.cc.lib];
|
2018-07-24 15:12:07 +02:00
|
|
|
|
|
|
|
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}
|
|
|
|
|
|
|
|
# Remove executable bits from data files. This matters for the find command
|
|
|
|
# we'll use below to find all bundled engines.
|
2020-08-14 15:43:34 +02:00
|
|
|
chmod -x $out/lib/${name}/Engines/*/*.{txt,bin,bmp,zip}
|
2018-07-24 15:12:07 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
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)
|
|
|
|
)
|
|
|
|
for i in "''${exes[@]}"; do
|
|
|
|
# Arminius is statically linked.
|
|
|
|
if [[ $i =~ "Arminius_2017-01-01" ]]; then echo yo $i; continue; fi
|
|
|
|
echo Fixing interpreter and rpath paths in $i ...
|
|
|
|
patchelf \
|
|
|
|
--interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
|
|
|
--set-rpath ${makeLibraryPath buildInputs}:$(cat $NIX_CC/nix-support/orig-cc)/${libDir} \
|
|
|
|
$i
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
ln -s $out/lib/${name}/Arena_x86_64_linux $out/bin/arena
|
|
|
|
'';
|
|
|
|
|
|
|
|
dontStrip = true;
|
|
|
|
|
|
|
|
meta = {
|
2018-07-24 19:00:12 +02:00
|
|
|
description = "Chess GUI for analyzing with and playing against various engines";
|
|
|
|
longDescription = ''
|
2018-07-24 15:12:07 +02:00
|
|
|
A free Graphical User Interface (GUI) for chess. Arena assists you in
|
|
|
|
analyzing and playing games as well as in testing chess engines. It runs
|
|
|
|
on Linux or Windows. Arena is compatible to Winboard protocol I, II and
|
|
|
|
UCI protocol I, II. Furthermore, compatible to Chess960, DGT electronic
|
|
|
|
chess board & DGT clocks and much more.
|
|
|
|
'';
|
2021-01-15 05:31:39 +01:00
|
|
|
license = lib.licenses.unfree;
|
2018-07-24 15:12:07 +02:00
|
|
|
platforms = ["x86_64-linux"];
|
2021-01-15 05:31:39 +01:00
|
|
|
hydraPlatforms = lib.platforms.none;
|
2018-07-24 15:12:07 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|