2017-03-03 08:28:48 +00:00
|
|
|
{ stdenv, lib, fetchFromGitHub, procps ? null
|
|
|
|
, qtbase, qtwebengine, qtwebkit
|
|
|
|
, cmake, makeQtWrapper
|
|
|
|
, syncthing, syncthing-inotify ? null
|
|
|
|
, preferQWebView ? false }:
|
2016-10-31 20:06:32 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2017-02-24 17:10:12 +00:00
|
|
|
version = "0.5.7";
|
2016-10-31 20:06:32 +00:00
|
|
|
name = "qsyncthingtray-${version}";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2017-03-03 08:28:48 +00:00
|
|
|
owner = "sieren";
|
|
|
|
repo = "QSyncthingTray";
|
|
|
|
rev = "${version}";
|
2017-02-24 17:10:12 +00:00
|
|
|
sha256 = "0crrdpdmlc4ahkvp5znzc4zhfwsdih655q1kfjf0g231mmynxhvq";
|
2016-10-31 20:06:32 +00:00
|
|
|
};
|
|
|
|
|
2017-03-03 08:28:48 +00:00
|
|
|
buildInputs = [ qtbase qtwebengine ] ++ lib.optional preferQWebView qtwebkit;
|
|
|
|
nativeBuildInputs = [ cmake makeQtWrapper ];
|
2016-10-31 20:06:32 +00:00
|
|
|
enableParallelBuilding = true;
|
2017-03-13 03:46:02 +00:00
|
|
|
|
2017-03-03 08:28:48 +00:00
|
|
|
cmakeFlags = lib.optional preferQWebView "-DQST_BUILD_WEBKIT=1";
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
${lib.optionalString stdenv.isLinux ''
|
|
|
|
substituteInPlace includes/platforms/linux/posixUtils.hpp \
|
|
|
|
--replace '"/usr/local/bin/syncthing"' '"${syncthing}/bin/syncthing"' \
|
|
|
|
--replace '"/usr/local/bin/syncthing-inotify"' '"${syncthing-inotify}/bin/syncthing-inotify"' \
|
|
|
|
--replace '"pgrep -x' '"${procps}/bin/pgrep -x'
|
|
|
|
''}
|
|
|
|
|
|
|
|
${lib.optionalString stdenv.isDarwin ''
|
|
|
|
substituteInPlace includes/platforms/darwin/macUtils.hpp \
|
|
|
|
--replace '"/usr/local/bin/syncthing"' '"${syncthing}/bin/syncthing"'
|
|
|
|
''}
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = let qst = "qsyncthingtray"; in ''
|
2017-04-27 05:06:26 +01:00
|
|
|
runHook preInstall
|
|
|
|
|
2016-10-31 20:06:32 +00:00
|
|
|
mkdir -p $out/bin
|
2017-03-03 08:28:48 +00:00
|
|
|
install -m755 QSyncthingTray $out/bin/${qst}
|
|
|
|
ln -s $out/bin/${qst} $out/bin/QSyncthingTray
|
2017-04-27 05:06:26 +01:00
|
|
|
wrapQtProgram $out/bin/qsyncthingtray
|
|
|
|
|
|
|
|
runHook postInstall
|
2016-10-31 20:06:32 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
homepage = https://github.com/sieren/QSyncthingTray/;
|
|
|
|
description = "A Traybar Application for Syncthing written in C++";
|
|
|
|
longDescription = ''
|
|
|
|
A cross-platform status bar for Syncthing.
|
|
|
|
Currently supports OS X, Windows and Linux.
|
|
|
|
Written in C++ with Qt.
|
|
|
|
'';
|
|
|
|
license = licenses.lgpl3;
|
2017-03-03 08:28:48 +00:00
|
|
|
maintainers = with maintainers; [ zraexy peterhoeg ];
|
2016-10-31 20:06:32 +00:00
|
|
|
platforms = platforms.all;
|
2017-05-12 09:45:27 +01:00
|
|
|
# 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;
|
2016-10-31 20:06:32 +00:00
|
|
|
};
|
|
|
|
}
|