nixpkgs/pkgs/games/pysolfc/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

49 lines
1.4 KiB
Nix

{ lib, stdenv, fetchzip, buildPythonApplication, python3Packages
, desktop-file-utils, freecell-solver }:
buildPythonApplication rec {
pname = "PySolFC";
version = "2.6.4";
src = fetchzip {
url = "https://versaweb.dl.sourceforge.net/project/pysolfc/PySolFC/PySolFC-${version}/PySolFC-${version}.tar.xz";
sha256 = "1bd84law5b1yga3pryggdvlfvm0l62gci2q8y3q79cysdk3z4w3z";
};
cardsets = fetchzip {
url = "https://versaweb.dl.sourceforge.net/project/pysolfc/PySolFC-Cardsets/PySolFC-Cardsets-2.0/PySolFC-Cardsets-2.0.tar.bz2";
sha256 = "0h0fibjv47j8lkc1bwnlbbvrx2nr3l2hzv717kcgagwhc7v2mrqh";
};
propagatedBuildInputs = with python3Packages; [
tkinter six random2
# optional :
pygame freecell-solver pillow
];
patches = [
./pysolfc-datadir.patch
];
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 = ''
mkdir $out/share/PySolFC/cardsets
cp -r $cardsets/* $out/share/PySolFC/cardsets
'';
# No tests in archive
doCheck = false;
meta = with lib; {
description = "A collection of more than 1000 solitaire card games";
homepage = "https://pysolfc.sourceforge.io";
license = licenses.gpl3;
maintainers = with maintainers; [ kierdavis ];
};
}