1 { mkDerivation, stdenv, lib, fetchFromGitHub, fetchpatch, procps
2 , qtbase, qtwebengine, qtwebkit
5 , preferQWebView ? false
6 , preferNative ? true }:
10 pname = "qsyncthingtray";
12 src = fetchFromGitHub {
14 repo = "QSyncthingTray";
16 sha256 = "1n9g4j7qznvg9zl6x163pi9f7wsc3x6q76i33psnm7x2v1i22x5w";
19 buildInputs = [ qtbase qtwebengine ] ++ lib.optional preferQWebView qtwebkit;
21 nativeBuildInputs = [ cmake ];
24 ++ lib.optional preferQWebView "-DQST_BUILD_WEBKIT=1"
25 ++ lib.optional preferNative "-DQST_BUILD_NATIVEBROWSER=1";
27 patches = [ (fetchpatch {
28 name = "support_native_browser.patch";
29 url = "https://patch-diff.githubusercontent.com/raw/sieren/QSyncthingTray/pull/225.patch";
30 sha256 = "0w665xdlsbjxs977pdpzaclxpswf7xys1q3rxriz181lhk2y66yy";
31 }) ] ++ lib.optional (!preferQWebView && !preferNative) ./qsyncthingtray-0.5.8-qt-5.6.3.patch;
34 ${lib.optionalString stdenv.hostPlatform.isLinux ''
35 substituteInPlace includes/platforms/linux/posixUtils.hpp \
36 --replace '"/usr/local/bin/syncthing"' '"${syncthing}/bin/syncthing"' \
37 --replace '"pgrep -x' '"${procps}/bin/pgrep -x'
40 ${lib.optionalString stdenv.hostPlatform.isDarwin ''
41 substituteInPlace includes/platforms/darwin/macUtils.hpp \
42 --replace '"/usr/local/bin/syncthing"' '"${syncthing}/bin/syncthing"'
46 installPhase = let qst = "qsyncthingtray"; in ''
50 install -m755 QSyncthingTray $out/bin/${qst}
51 ln -s $out/bin/${qst} $out/bin/QSyncthingTray
57 homepage = "https://github.com/sieren/QSyncthingTray/";
58 description = "Traybar Application for Syncthing written in C++";
60 A cross-platform status bar for Syncthing.
61 Currently supports macOS, Windows and Linux.
62 Written in C++ with Qt.
64 license = licenses.lgpl3;
65 maintainers = with maintainers; [ zraexy peterhoeg ];
66 platforms = platforms.all;
67 broken = !preferNative || stdenv.hostPlatform.isDarwin;