summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/cu/cutechess/package.nix
blob: 01156db18db47917a34554611f45debcbf21b5b3 (plain)
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
33
34
35
36
37
38
39
40
41
42
43
44
45
{
  stdenv,
  fetchFromGitHub,
  cmake,
  pkg-config,
  qt5,
  lib,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "cutechess";
  version = "1.4.0";

  src = fetchFromGitHub {
    owner = "cutechess";
    repo = "cutechess";
    tag = "v${finalAttrs.version}";
    hash = "sha256-vhS3Eenxcq7D8E5WVON5C5hCTytcEVbYUeuCkfB0apA=";
  };

  nativeBuildInputs = [
    cmake
    pkg-config
    qt5.wrapQtAppsHook
  ];
  buildInputs = [
    qt5.qtbase
  ];

  postInstall = ''
    install -Dm555 cutechess{,-cli} -t $out/bin/
    install -Dm444 libcutechess.a -t $out/lib/
    install -Dm444 $src/docs/cutechess-cli.6 -t $out/share/man/man6/
    install -Dm444 $src/docs/cutechess-engines.json.5 -t $out/share/man/man5/
  '';

  meta = {
    description = "GUI, CLI, and library for playing chess";
    homepage = "https://cutechess.com/";
    license = lib.licenses.gpl3Plus;
    maintainers = [ ];
    platforms = with lib.platforms; (linux ++ windows);
    mainProgram = "cutechess";
  };
})