From 6d9dfdc86d1dda3132482a155c5eaa18e87efa2d Mon Sep 17 00:00:00 2001 From: Peter Hoeg Date: Wed, 20 Dec 2017 09:41:52 +0800 Subject: [PATCH] qsyncthingtray: build with native browser to allow for Qt > 5.6 --- .../misc/qsyncthingtray/default.nix | 20 ++++++++++++++----- pkgs/top-level/all-packages.nix | 3 +-- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/pkgs/applications/misc/qsyncthingtray/default.nix b/pkgs/applications/misc/qsyncthingtray/default.nix index bc909742c6d..763435da564 100644 --- a/pkgs/applications/misc/qsyncthingtray/default.nix +++ b/pkgs/applications/misc/qsyncthingtray/default.nix @@ -1,8 +1,9 @@ -{ mkDerivation, stdenv, lib, fetchFromGitHub, procps ? null +{ mkDerivation, stdenv, lib, fetchFromGitHub, fetchpatch, procps ? null , qtbase, qtwebengine, qtwebkit , cmake , syncthing, syncthing-inotify ? null -, preferQWebView ? false }: +, preferQWebView ? false +, preferNative ? true }: mkDerivation rec { version = "0.5.8"; @@ -16,11 +17,18 @@ mkDerivation rec { }; buildInputs = [ qtbase qtwebengine ] ++ lib.optional preferQWebView qtwebkit; + nativeBuildInputs = [ cmake ]; - cmakeFlags = lib.optional preferQWebView "-DQST_BUILD_WEBKIT=1"; + cmakeFlags = [ ] + ++ lib.optional preferQWebView "-DQST_BUILD_WEBKIT=1" + ++ lib.optional preferNative "-DQST_BUILD_NATIVEBROWSER=1"; - patches = [ ./qsyncthingtray-0.5.8-qt-5.6.3.patch ]; + patches = [ (fetchpatch { + name = "support_native_browser.patch"; + url = "https://patch-diff.githubusercontent.com/raw/sieren/QSyncthingTray/pull/225.patch"; + sha256 = "0w665xdlsbjxs977pdpzaclxpswf7xys1q3rxriz181lhk2y66yy"; + }) ] ++ lib.optional (!preferQWebView && !preferNative) ./qsyncthingtray-0.5.8-qt-5.6.3.patch; postPatch = '' ${lib.optionalString stdenv.isLinux '' @@ -60,6 +68,8 @@ mkDerivation rec { maintainers = with maintainers; [ zraexy peterhoeg ]; platforms = platforms.all; # 0.5.7 segfaults when opening the main panel with qt 5.7 and fails to compile with qt 5.8 - broken = builtins.compareVersions qtbase.version "5.7.0" >= 0; + # but qt > 5.6 works when only using the native browser + # https://github.com/sieren/QSyncthingTray/issues/223 + broken = (builtins.compareVersions qtbase.version "5.7.0" >= 0 && !preferNative); }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 547e0704d39..99f0bee0251 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16539,8 +16539,7 @@ with pkgs; qt = qt4; }; - # 0.5.7 segfaults when opening the main panel with qt 5.7 and fails to compile with qt 5.8 - qsyncthingtray = libsForQt56.callPackage ../applications/misc/qsyncthingtray { }; + qsyncthingtray = libsForQt5.callPackage ../applications/misc/qsyncthingtray { }; qstopmotion = callPackage ../applications/video/qstopmotion { };