git.iko.soy/typeable/nixpkgs
on master help sign in
qsyncthingtray: fix program paths

We need this for qsyncthingtray to be able to detect the processes as well.

commit29d9f0e624811cb3255302f773e61c36d1c8c03d authorPeter Hoeg <peter@speartail.com> dateFri 3 Mar 2017, 16:28 (10 years ago) parent0843ad1
1 file changed+30−11
pkgs/applications/misc/qsyncthingtray/default.nix+30−11
pkgs/applications/misc/qsyncthingtray/default.nix+30−11
@@ -1,25 +1,44 @@
1−{ stdenv, fetchFromGitHub
2−, qtbase, qtwebengine
3−, qmakeHook }:
1+{ stdenv, lib, fetchFromGitHub, procps ? null
2+, qtbase, qtwebengine, qtwebkit
3+, cmake, makeQtWrapper
4+, syncthing, syncthing-inotify ? null
5+, preferQWebView ? false }:
46
57stdenv.mkDerivation rec {
68 version = "0.5.7";
79 name = "qsyncthingtray-${version}";
810
911 src = fetchFromGitHub {
10− owner = "sieren";
11− repo = "QSyncthingTray";
12− rev = "${version}";
12+ owner = "sieren";
13+ repo = "QSyncthingTray";
14+ rev = "${version}";
1315 sha256 = "0crrdpdmlc4ahkvp5znzc4zhfwsdih655q1kfjf0g231mmynxhvq";
1416 };
1517
16− buildInputs = [ qtbase qtwebengine ];
17− nativeBuildInputs = [ qmakeHook ];
18+ buildInputs = [ qtbase qtwebengine ] ++ lib.optional preferQWebView qtwebkit;
19+ nativeBuildInputs = [ cmake makeQtWrapper ];
1820 enableParallelBuilding = true;
1921
20− postInstall = ''
22+ cmakeFlags = lib.optional preferQWebView "-DQST_BUILD_WEBKIT=1";
23+
24+ postPatch = ''
25+ ${lib.optionalString stdenv.isLinux ''
26+ substituteInPlace includes/platforms/linux/posixUtils.hpp \
27+ --replace '"/usr/local/bin/syncthing"' '"${syncthing}/bin/syncthing"' \
28+ --replace '"/usr/local/bin/syncthing-inotify"' '"${syncthing-inotify}/bin/syncthing-inotify"' \
29+ --replace '"pgrep -x' '"${procps}/bin/pgrep -x'
30+ ''}
31+
32+ ${lib.optionalString stdenv.isDarwin ''
33+ substituteInPlace includes/platforms/darwin/macUtils.hpp \
34+ --replace '"/usr/local/bin/syncthing"' '"${syncthing}/bin/syncthing"'
35+ ''}
36+ '';
37+
38+ installPhase = let qst = "qsyncthingtray"; in ''
2139 mkdir -p $out/bin
22− cp binary/QSyncthingTray $out/bin
40+ install -m755 QSyncthingTray $out/bin/${qst}
41+ ln -s $out/bin/${qst} $out/bin/QSyncthingTray
2342 '';
2443
2544 meta = with stdenv.lib; {
@@ -31,7 +50,7 @@ stdenv.mkDerivation rec {
3150 Written in C++ with Qt.
3251 '';
3352 license = licenses.lgpl3;
34− maintainers = with maintainers; [ zraexy ];
53+ maintainers = with maintainers; [ zraexy peterhoeg ];
3554 platforms = platforms.all;
3655 broken = builtins.compareVersions qtbase.version "5.7.0" >= 0;
3756 };