summary refs log tree commit diff
path: root/pkgs/games/xboard/default.nix
blob: 8571b1b1d4ee0a709bae69ec354ca4ae1dae26e8 (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
a :  
let 
  fetchurl = a.fetchurl;

  version = a.lib.getAttr ["version"] "4.2.7" a; 
  buildInputs = with a; [
    libX11 xproto libXt libXaw libSM libICE libXmu 
    libXext gnuchess
  ];
in
rec {
  src = fetchurl {
    url = "http://ftp.gnu.org/gnu/xboard/xboard-${version}.tar.gz";
    sha256 = "0fwdzcav8shvzi7djphrlav29vwxnx63spzsldlhrglr7qpg28av";
  };

  inherit buildInputs;
  configureFlags = [];

  /* doConfigure should be removed if not needed */
  phaseNames = ["doConfigure" "preBuild" "doMakeInstall"];

  preBuild = a.fullDepEntry(''
    sed -e '/FIRST_CHESS_PROGRAM/s@gnuchessx@${a.gnuchess}/bin/gnuchessx@' -i xboard.h
    sed -e '/SECOND_CHESS_PROGRAM/s@gnuchessx@${a.gnuchess}/bin/gnuchessx@' -i xboard.h
  '') ["doUnpack" "minInit"];
      
  name = "xboard-" + version;
  meta = {
    description = "XBoard - a chess board compatible with GNU Chess";
  };
}