nixpkgs/pkgs/games/pysolfc/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

112 lines
2.7 KiB
Nix
Raw Normal View History

2024-06-29 04:44:21 +00:00
{
lib,
stdenv,
fetchzip,
python311Packages,
desktop-file-utils,
freecell-solver,
black-hole-solver,
_experimental-update-script-combinators,
gitUpdater,
2023-06-29 00:45:59 +00:00
}:
2024-06-29 04:44:21 +00:00
python311Packages.buildPythonApplication rec {
pname = "pysolfc";
2024-06-29 04:44:21 +00:00
version = "3.0.0";
2018-08-19 18:43:29 +00:00
src = fetchzip {
url = "mirror://sourceforge/pysolfc/PySolFC-${version}.tar.xz";
2024-06-29 04:44:21 +00:00
hash = "sha256-LPOm83K4bdzmmQskmAnSyYpz+5y9ktQAhYCkXpODYKI=";
};
2024-06-29 04:44:21 +00:00
cardsets = stdenv.mkDerivation rec {
pname = "pysol-cardsets";
version = "3.0";
src = fetchzip {
url = "mirror://sourceforge/pysolfc/PySolFC-Cardsets-${version}.tar.bz2";
hash = "sha256-UP0dQjoZJg+iSKVOrWbkLj1KCzMWws8ZBVSBLly1a/Y=";
};
installPhase = ''
runHook preInstall
cp -r $src $out
runHook postInstall
'';
2023-06-29 00:45:59 +00:00
};
2024-06-29 04:44:21 +00:00
music = stdenv.mkDerivation rec {
pname = "pysol-music";
version = "4.50";
src = fetchzip {
url = "mirror://sourceforge/pysolfc/pysol-music-${version}.tar.xz";
hash = "sha256-sOl5U98aIorrQHJRy34s0HHaSW8hMUE7q84FMQAj5Yg=";
};
installPhase = ''
runHook preInstall
cp -r $src $out
runHook postInstall
'';
2018-08-19 18:43:29 +00:00
};
2024-06-29 04:44:21 +00:00
propagatedBuildInputs = with python311Packages; [
2023-06-29 00:45:59 +00:00
tkinter
six
random2
configobj
pysol-cards
attrs
pycotap
2018-08-19 18:43:29 +00:00
# optional :
2023-06-29 00:45:59 +00:00
pygame
freecell-solver
2024-06-29 04:44:21 +00:00
black-hole-solver
2023-06-29 00:45:59 +00:00
pillow
];
2024-06-29 04:44:21 +00:00
patches = [ ./pysolfc-datadir.patch ];
2018-08-19 18:43:29 +00:00
nativeBuildInputs = [ desktop-file-utils ];
postPatch = ''
desktop-file-edit --set-key Icon --set-value ${placeholder "out"}/share/icons/pysol01.png data/pysol.desktop
desktop-file-edit --set-key Comment --set-value "${meta.description}" data/pysol.desktop
'';
postInstall = ''
2018-08-19 18:43:29 +00:00
mkdir $out/share/PySolFC/cardsets
cp -r $cardsets/* $out/share/PySolFC/cardsets
2023-06-29 00:45:59 +00:00
cp -r $music/data/music $out/share/PySolFC
'';
2018-08-19 18:43:29 +00:00
# No tests in archive
doCheck = false;
2024-06-29 04:44:21 +00:00
passthru.updateScript = _experimental-update-script-combinators.sequence (
# Needed in order to work around requirement that only one updater with features enabled is in sequence
map (updater: updater.command) [
(gitUpdater {
url = "https://github.com/shlomif/PySolFC.git";
rev-prefix = "pysolfc-";
})
(gitUpdater {
url = "https://github.com/shlomif/PySolFC-CardSets.git";
attrPath = "pysolfc.cardsets";
})
(gitUpdater {
url = "https://github.com/shlomif/pysol-music.git";
attrPath = "pysolfc.music";
})
]
);
meta = with lib; {
description = "A collection of more than 1000 solitaire card games";
mainProgram = "pysol.py";
homepage = "https://pysolfc.sourceforge.io";
license = licenses.gpl3;
2024-09-06 05:48:24 +00:00
maintainers = with maintainers; [ ];
};
}