nixpkgs/pkgs/applications/misc/qsyncthingtray/default.nix

66 lines
2.1 KiB
Nix
Raw Normal View History

2017-05-17 19:26:11 +00:00
{ mkDerivation, stdenv, lib, fetchFromGitHub, procps ? null
, qtbase, qtwebengine, qtwebkit
2017-05-17 19:26:11 +00:00
, cmake
, syncthing, syncthing-inotify ? null
, preferQWebView ? false }:
2016-10-31 20:06:32 +00:00
2017-05-17 19:26:11 +00:00
mkDerivation rec {
2017-07-07 19:20:19 +00:00
version = "0.5.8";
2016-10-31 20:06:32 +00:00
name = "qsyncthingtray-${version}";
src = fetchFromGitHub {
owner = "sieren";
repo = "QSyncthingTray";
rev = "${version}";
2017-07-07 19:20:19 +00:00
sha256 = "1n9g4j7qznvg9zl6x163pi9f7wsc3x6q76i33psnm7x2v1i22x5w";
2016-10-31 20:06:32 +00:00
};
buildInputs = [ qtbase qtwebengine ] ++ lib.optional preferQWebView qtwebkit;
2017-05-17 19:26:11 +00:00
nativeBuildInputs = [ cmake ];
2017-03-13 03:46:02 +00:00
cmakeFlags = lib.optional preferQWebView "-DQST_BUILD_WEBKIT=1";
2017-11-17 03:05:30 +00:00
patches = [ ./qsyncthingtray-0.5.8-qt-5.6.3.patch ];
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 ''
runHook preInstall
2016-10-31 20:06:32 +00:00
mkdir -p $out/bin
install -m755 QSyncthingTray $out/bin/${qst}
ln -s $out/bin/${qst} $out/bin/QSyncthingTray
runHook postInstall
2016-10-31 20:06:32 +00:00
'';
2017-11-17 03:05:30 +00:00
enableParallelBuilding = true;
2017-05-17 19:26:11 +00:00
meta = with lib; {
2016-10-31 20:06:32 +00:00
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 macOS, Windows and Linux.
2016-10-31 20:06:32 +00:00
Written in C++ with Qt.
'';
license = licenses.lgpl3;
maintainers = with maintainers; [ zraexy peterhoeg ];
2016-10-31 20:06:32 +00:00
platforms = platforms.all;
2017-05-12 08:45:27 +00: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
};
}