chessx: fix build (#46359)

See https://hydra.nixos.org/build/80998335.

Upstream doesn't support QT 5.11 ATM which broke compilation:

```
src/dialogs/savedialog.cpp: In constructor ‘SaveDialog::SaveDialog(QWidget*, Qt::WindowFlags)’:
src/dialogs/savedialog.cpp:37:34: error: invalid use of incomplete type ‘class QButtonGroup’
group = new QButtonGroup(this);
```

The Arch community recommends to use an older QT version to fix
this (https://aur.archlinux.org/packages/chessx/).

Furthermore the `QT_PLUGIN_PATH` wasn't set properly which broke the
runtime since QT coudln't find the `xcb` plugin:

```
qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""
This application failed to start because no Qt platform plugin could be initialized.
Reinstalling the application may fix this problem.
```

Finally, some minor style fixes were made for consistent indentation.

Addresses #45960

authored by Maximilian Bosch and committed by xeji 37032db5 28a46c2c

+26 -14
+25 -13
pkgs/games/chessx/default.nix
··· 1 - { stdenv, pkgconfig, zlib, qtbase, qtsvg, qttools, qtmultimedia, qmake, fetchurl }: 1 + { stdenv, pkgconfig, zlib, qtbase, qtsvg, qttools, qtmultimedia, qmake, fetchurl, makeWrapper 2 + , lib 3 + }: 4 + 2 5 stdenv.mkDerivation rec { 3 6 name = "chessx-${version}"; 4 7 version = "1.4.6"; 8 + 5 9 src = fetchurl { 6 10 url = "mirror://sourceforge/chessx/chessx-${version}.tgz"; 7 11 sha256 = "1vb838byzmnyglm9mq3khh3kddb9g4g111cybxjzalxxlc81k5dd"; 8 12 }; 13 + 9 14 buildInputs = [ 10 - qtbase 11 - qtsvg 12 - qttools 13 - qtmultimedia 14 - zlib 15 + qtbase 16 + qtsvg 17 + qttools 18 + qtmultimedia 19 + zlib 15 20 ]; 16 - nativeBuildInputs = [ pkgconfig qmake ]; 21 + 22 + nativeBuildInputs = [ pkgconfig qmake makeWrapper ]; 17 23 18 24 # RCC: Error in 'resources.qrc': Cannot find file 'i18n/chessx_da.qm' 19 25 enableParallelBuilding = false; 20 26 21 27 installPhase = '' 22 - runHook preInstall 23 - mkdir -p "$out/bin" 24 - mkdir -p "$out/share/applications" 25 - cp -pr release/chessx "$out/bin" 26 - cp -pr unix/chessx.desktop "$out/share/applications" 27 - runHook postInstall 28 + runHook preInstall 29 + 30 + mkdir -p "$out/bin" 31 + mkdir -p "$out/share/applications" 32 + cp -pr release/chessx "$out/bin" 33 + cp -pr unix/chessx.desktop "$out/share/applications" 34 + 35 + wrapProgram $out/bin/chessx \ 36 + --prefix QT_PLUGIN_PATH : ${qtbase}/lib/qt-5.${lib.versions.minor qtbase.version}/plugins 37 + 38 + runHook postInstall 28 39 ''; 29 40 30 41 meta = with stdenv.lib; { ··· 32 43 description = "ChessX allows you to browse and analyse chess games"; 33 44 license = licenses.gpl2; 34 45 maintainers = [maintainers.luispedro]; 46 + platforms = platforms.linux; 35 47 }; 36 48 }
+1 -1
pkgs/top-level/all-packages.nix
··· 19730 19730 19731 19731 chessdb = callPackage ../games/chessdb { }; 19732 19732 19733 - chessx = libsForQt5.callPackage ../games/chessx { }; 19733 + chessx = libsForQt59.callPackage ../games/chessx { }; 19734 19734 19735 19735 chocolateDoom = callPackage ../games/chocolate-doom { }; 19736 19736