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

  version = a.lib.attrByPath ["version"] "5.07" a; 
  buildInputs = with a; [
    flex
  ];
in
rec {
  src = fetchurl {
    url = "mirror://gnu/chess/gnuchess-${version}.tar.gz";
    sha256 = "0zh15m35fzbsrk1aann9pwlkv54dwb00snx99pk3xbg5bwkf125k";
  };

  inherit buildInputs;
  configureFlags = [];

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

  preBuild = a.fullDepEntry (''
    sed -i src/input.c -e 's/static pthread_t/pthread_t/'
    sed -i "s@gnuchess@$out/bin/gnuchess@" -i src/gnuchessx
  '') ["minInit" "doUnpack"];
      
  name = "gnuchess-" + version;
  meta = {
    description = "GNU Chess playing program";
  };
}