@@ -0,0 +1,57 @@
1+{ mkDerivation
2+, stdenv
3+, lib
4+, fetchFromGitHub
5+, qtbase
6+, qtwebengine
7+, qtdeclarative
8+, extra-cmake-modules
9+, cpp-utilities
10+, qtutilities
11+, cmake
12+, kio
13+, plasma-framework
14+, qttools
15+, webviewSupport ? true
16+, jsSupport ? true
17+, kioPluginSupport ? true
18+, plasmoidSupport ? true
19+, systemdSupport ? true
20+}:
21+
22+mkDerivation rec {
23+ version = "0.9.1";
24+ pname = "syncthingtray";
25+
26+ src = fetchFromGitHub {
27+ owner = "Martchus";
28+ repo = "syncthingtray";
29+ rev = "v${version}";
30+ sha256 = "0ijwpwlwwbfh9fdfbwz6dgi6hpmaav2jm56mzxm6as50iwnb59fx";
31+ };
32+
33+ buildInputs = [ qtbase cpp-utilities qtutilities ]
34+ ++ lib.optionals webviewSupport [ qtwebengine ]
35+ ++ lib.optionals jsSupport [ qtdeclarative ]
36+ ++ lib.optionals kioPluginSupport [ kio ]
37+ ++ lib.optionals plasmoidSupport [ extra-cmake-modules plasma-framework ]
38+ ;
39+
40+ nativeBuildInputs = [ cmake qttools ];
41+
42+ cmakeFlags = [
43+ # See https://github.com/Martchus/syncthingtray/issues/42
44+ "-DQT_PLUGIN_DIR:STRING=${placeholder "out"}/lib/qt-5"
45+ ] ++ lib.optionals (!plasmoidSupport) ["-DNO_PLASMOID=ON"]
46+ ++ lib.optionals (!kioPluginSupport) ["-DNO_FILE_ITEM_ACTION_PLUGIN=ON"]
47+ ++ lib.optionals systemdSupport ["-DSYSTEMD_SUPPORT=ON"]
48+ ;
49+
50+ meta = with lib; {
51+ homepage = "https://github.com/Martchus/syncthingtray";
52+ description = "Tray application and Dolphin/Plasma integration for Syncthing";
53+ license = licenses.gpl2;
54+ maintainers = with maintainers; [ doronbehar ];
55+ platforms = platforms.linux;
56+ };
57+}