summary refs log tree commit diff
path: root/pkgs/by-name/fr/freecell-solver/package.nix
blob: f3aeca90068f8bfe82c3061e2c61736c7de7cec6 (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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
{ lib
, stdenv
, fetchurl
, cmake
, cmocka
, gmp
, gperf
, libtap
, ninja
, perl
, pkg-config
, python3
, rinutils
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "freecell-solver";
  version = "6.8.0";

  src = fetchurl {
    url = "https://fc-solve.shlomifish.org/downloads/fc-solve/freecell-solver-${finalAttrs.version}.tar.xz";
    hash = "sha256-lfeKSxXS+jQCcf5PzFNUBlloGRuiLbDUDoGykbjVPTI=";
  };

  outputs = [ "out" "dev" "doc" "man" ];

  pythonPath = with python3.pkgs; [
    cffi
    pysol-cards
    random2
    six
  ];

  nativeBuildInputs = [
    cmake
    cmocka
    gperf
    ninja
    perl
    pkg-config
    python3
  ]
  ++ (with perl.pkgs; TaskFreecellSolverTesting.buildInputs ++ [
    GamesSolitaireVerify
    HTMLTemplate
    Moo
    PathTiny
    StringShellQuote
    TaskFreecellSolverTesting
    TemplateToolkit
    TextTemplate
  ])
  ++ [ python3.pkgs.wrapPython ]
  ++ finalAttrs.pythonPath;

  buildInputs = [
    gmp
    libtap
    rinutils
  ];

  strictDeps = true;

  cmakeFlags = [
    (lib.cmakeBool "FCS_WITH_TEST_SUITE" false) # needs freecell-solver
    (lib.cmakeBool "BUILD_STATIC_LIBRARY" false)
  ];

  postFixup = ''
    wrapPythonProgramsIn "$out/bin" "$out $pythonPath"
  '';

  meta = {
    homepage = "https://fc-solve.shlomifish.org/";
    description = "A FreeCell automatic solver";
    longDescription = ''
      FreeCell Solver is a program that automatically solves layouts of Freecell
      and similar variants of Card Solitaire such as Eight Off, Forecell, and
      Seahaven Towers, as well as Simple Simon boards.
    '';
    license = lib.licenses.mit;
    mainProgram = "fc-solve";
    maintainers = [ lib.maintainers.AndersonTorres ];
    platforms = lib.platforms.unix;
  };
})