k3s: format with nixfmt-rfc-style
[NixPkgs.git] / pkgs / games / chessx / default.nix
blobb49fb2c8947342491b00882662d2dd752b7710b8
1 { stdenv
2 , lib
3 , pkg-config
4 , zlib
5 , qtbase
6 , qtsvg
7 , qttools
8 , qtmultimedia
9 , qmake
10 , fetchpatch
11 , fetchurl
12 , wrapQtAppsHook
15 stdenv.mkDerivation (finalAttrs: {
16   pname = "chessx";
17   version = "1.6.0";
19   src = fetchurl {
20     url = "mirror://sourceforge/chessx/chessx-${finalAttrs.version}.tgz";
21     hash = "sha256-76YOe1WpB+vdEoEKGTHeaWJLpCVE4RoyYu1WLy3Dxhg=";
22   };
24   nativeBuildInputs = [
25     pkg-config
26     qmake
27     wrapQtAppsHook
28   ];
30   buildInputs = [
31     qtbase
32     qtmultimedia
33     qtsvg
34     qttools
35     zlib
36   ];
38   patches =
39     # needed to backport patches to successfully build, due to broken release
40     let
41       repo = "https://github.com/Isarhamster/chessx/";
42     in
43     [
44       (fetchpatch {
45         url = "${repo}/commit/9797d46aa28804282bd58ce139b22492ab6881e6.diff";
46         hash = "sha256-RnIf6bixvAvyp1CKuri5LhgYFqhDNiAVYWUmSUDMgVw=";
47       })
48       (fetchpatch {
49         url = "${repo}/commit/4fab4d2f649d1cae2b54464c4e28337d1f20c214.diff";
50         hash = "sha256-EJVHricN+6uabKLfn77t8c7JjO7tMmZGsj7ZyQUGcXA=";
51       })
52     ];
54   enableParallelBuilding = true;
56   installPhase = ''
57     runHook preInstall
59     install -Dm555 release/chessx -t "$out/bin"
60     install -Dm444 unix/chessx.desktop -t "$out/share/applications"
62     runHook postInstall
63   '';
65   meta = with lib; {
66     homepage = "https://chessx.sourceforge.io/";
67     description = "Browse and analyse chess games";
68     license = licenses.gpl2Plus;
69     maintainers = with maintainers; [ eclairevoyant luispedro ];
70     platforms = platforms.linux;
71     mainProgram = "chessx";
72   };