git.iko.soy/typeable/nixpkgs
on master help sign in
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

commit37032db5835aec5b04a0c1201e504a878a5aabb7 authorMaximilian Bosch <maximilian@mbosch.me> dateSat 8 Sep 2018, 14:19 (8 years ago) parent28a46c2
2 files changed+26−14
pkgs/games/chessx/default.nix+25−13 pkgs/top-level/all-packages.nix+1−1
pkgs/games/chessx/default.nix+25−13
@@ -1,30 +1,41 @@
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+
25stdenv.mkDerivation rec {
36 name = "chessx-${version}";
47 version = "1.4.6";
8+
59 src = fetchurl {
610 url = "mirror://sourceforge/chessx/chessx-${version}.tgz";
711 sha256 = "1vb838byzmnyglm9mq3khh3kddb9g4g111cybxjzalxxlc81k5dd";
812 };
13+
914 buildInputs = [
10− qtbase
11− qtsvg
12− qttools
13− qtmultimedia
14− zlib
15+ qtbase
16+ qtsvg
17+ qttools
18+ qtmultimedia
19+ zlib
1520 ];
16− nativeBuildInputs = [ pkgconfig qmake ];
21+
22+ nativeBuildInputs = [ pkgconfig qmake makeWrapper ];
1723
1824 # RCC: Error in 'resources.qrc': Cannot find file 'i18n/chessx_da.qm'
1925 enableParallelBuilding = false;
2026
2127 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
2839 '';
2940
3041 meta = with stdenv.lib; {
@@ -32,5 +43,6 @@ stdenv.mkDerivation rec {
3243 description = "ChessX allows you to browse and analyse chess games";
3344 license = licenses.gpl2;
3445 maintainers = [maintainers.luispedro];
46+ platforms = platforms.linux;
3547 };
3648}
pkgs/top-level/all-packages.nix+1−1
@@ -19730,7 +19730,7 @@ with pkgs;
1973019730
1973119731 chessdb = callPackage ../games/chessdb { };
1973219732
19733− chessx = libsForQt5.callPackage ../games/chessx { };
19733+ chessx = libsForQt59.callPackage ../games/chessx { };
1973419734
1973519735 chocolateDoom = callPackage ../games/chocolate-doom { };
1973619736