Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / games / pysolfc / default.nix
blobc543434b610d69dce097a9e42b1113254a91d3b9
1 { lib
2 , fetchzip
3 , buildPythonApplication
4 , python3Packages
5 , desktop-file-utils
6 , freecell-solver
7 }:
9 buildPythonApplication rec {
10   pname = "PySolFC";
11   version = "2.20.1";
13   src = fetchzip {
14     url = "https://versaweb.dl.sourceforge.net/project/pysolfc/PySolFC/PySolFC-${version}/PySolFC-${version}.tar.xz";
15     hash = "sha256-mEnsq8Su0ses+nqoSFC+Wr0MHY7aTDMbtDV8toYVNPY=";
16   };
18   cardsets = fetchzip {
19     url = "https://versaweb.dl.sourceforge.net/project/pysolfc/PySolFC-Cardsets/PySolFC-Cardsets-2.2/PySolFC-Cardsets-2.2.tar.bz2";
20     hash = "sha256-mWJ0l9rvn9KeZ9rCWy7VjngJzJtSQSmG8zGcYFE4yM0=";
21   };
23   music = fetchzip {
24     url = "https://versaweb.dl.sourceforge.net/project/pysolfc/PySol-Music/PySol-Music-4.50/pysol-music-4.50.tar.xz";
25     hash = "sha256-sOl5U98aIorrQHJRy34s0HHaSW8hMUE7q84FMQAj5Yg=";
26   };
28   propagatedBuildInputs = with python3Packages; [
29     tkinter
30     six
31     random2
32     configobj
33     pysol-cards
34     attrs
35     pycotap
36     # optional :
37     pygame
38     freecell-solver
39     pillow
40   ];
42   patches = [
43     ./pysolfc-datadir.patch
44   ];
46   nativeBuildInputs = [ desktop-file-utils ];
47   postPatch = ''
48     desktop-file-edit --set-key Icon --set-value ${placeholder "out"}/share/icons/pysol01.png data/pysol.desktop
49     desktop-file-edit --set-key Comment --set-value "${meta.description}" data/pysol.desktop
50   '';
52   postInstall = ''
53     mkdir $out/share/PySolFC/cardsets
54     cp -r $cardsets/* $out/share/PySolFC/cardsets
55     cp -r $music/data/music $out/share/PySolFC
56   '';
58   # No tests in archive
59   doCheck = false;
61   meta = with lib; {
62     description = "A collection of more than 1000 solitaire card games";
63     homepage = "https://pysolfc.sourceforge.io";
64     license = licenses.gpl3;
65     maintainers = with maintainers; [ kierdavis ];
66   };