2020-03-18 00:36:22 +01:00
|
|
|
{ mkDerivation, lib, fetchzip, buildEnv, makeDesktopItem, runCommand, writeText, pkgconfig
|
2018-08-06 14:05:49 +02:00
|
|
|
, cmake, qmake, cacert, jsoncpp, libX11, libXScrnSaver, lua, openssl, poco
|
2019-01-25 20:12:08 +01:00
|
|
|
, qtbase, qtwebengine, qtx11extras, sqlite }:
|
2018-08-06 14:05:49 +02:00
|
|
|
|
|
|
|
let
|
|
|
|
name = "toggldesktop-${version}";
|
|
|
|
version = "7.4.231";
|
|
|
|
|
|
|
|
src = fetchzip {
|
|
|
|
url = "https://github.com/toggl/toggldesktop/archive/v${version}.tar.gz";
|
|
|
|
sha256 = "01hqkx9dljnhwnyqi6mmzfp02hnbi2j50rsfiasniqrkbi99x9v1";
|
|
|
|
};
|
|
|
|
|
2020-03-18 00:36:22 +01:00
|
|
|
bugsnag-qt = mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "bugsnag-qt";
|
2018-08-06 14:05:49 +02:00
|
|
|
version = "20180522.005732";
|
|
|
|
|
|
|
|
src = fetchzip {
|
|
|
|
url = "https://github.com/yegortimoshenko/bugsnag-qt/archive/${version}.tar.gz";
|
|
|
|
sha256 = "02s6mlggh0i4a856md46dipy6mh47isap82jlwmjr7hfsk2ykgnq";
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ qmake ];
|
|
|
|
buildInputs = [ qtbase ];
|
|
|
|
};
|
|
|
|
|
2020-03-18 00:36:22 +01:00
|
|
|
qxtglobalshortcut = mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "qxtglobalshortcut";
|
2018-08-06 14:05:49 +02:00
|
|
|
version = "f584471dada2099ba06c574bdfdd8b078c2e3550";
|
|
|
|
|
|
|
|
src = fetchzip {
|
|
|
|
url = "https://github.com/hluk/qxtglobalshortcut/archive/${version}.tar.gz";
|
|
|
|
sha256 = "1iy17gypav10z8aa62s5jb6mq9y4kb9ms4l61ydmk3xwlap7igw1";
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
buildInputs = [ qtbase qtx11extras ];
|
|
|
|
};
|
|
|
|
|
2020-03-18 00:36:22 +01:00
|
|
|
qt-oauth-lib = mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "qt-oauth-lib";
|
2019-01-25 20:12:08 +01:00
|
|
|
version = "20190125.190943";
|
2018-08-06 14:05:49 +02:00
|
|
|
|
|
|
|
src = fetchzip {
|
|
|
|
url = "https://github.com/yegortimoshenko/qt-oauth-lib/archive/${version}.tar.gz";
|
2019-01-25 20:12:08 +01:00
|
|
|
sha256 = "0zmfgvdf6n79mgfvbda7lkdxxlzjmy86436gqi2r5x05vq04sfrj";
|
2018-08-06 14:05:49 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ qmake ];
|
2019-01-25 20:12:08 +01:00
|
|
|
buildInputs = [ qtbase qtwebengine ];
|
2018-08-06 14:05:49 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
poco-pc = writeText "poco.pc" ''
|
|
|
|
Name: Poco
|
|
|
|
Description: ${poco.meta.description}
|
|
|
|
Version: ${poco.version}
|
|
|
|
Libs: -L${poco}/lib -lPocoDataSQLite -lPocoData -lPocoNet -lPocoNetSSL -lPocoCrypto -lPocoUtil -lPocoXML -lPocoFoundation
|
|
|
|
Cflags: -I${poco}/include/Poco
|
|
|
|
'';
|
|
|
|
|
|
|
|
poco-pc-wrapped = runCommand "poco-pc-wrapped" {} ''
|
|
|
|
mkdir -p $out/lib/pkgconfig && ln -s ${poco-pc} $_/poco.pc
|
|
|
|
'';
|
|
|
|
|
2020-03-18 00:36:22 +01:00
|
|
|
libtoggl = mkDerivation {
|
2018-08-06 14:05:49 +02:00
|
|
|
name = "libtoggl-${version}";
|
|
|
|
inherit src version;
|
|
|
|
|
|
|
|
sourceRoot = "source/src";
|
|
|
|
|
|
|
|
nativeBuildInputs = [ qmake pkgconfig ];
|
|
|
|
buildInputs = [ jsoncpp lua openssl poco poco-pc-wrapped sqlite libX11 ];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
cat ${./libtoggl.pro} > libtoggl.pro
|
|
|
|
rm get_focused_window_{mac,windows}.cc
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2020-03-18 00:36:22 +01:00
|
|
|
toggldesktop = mkDerivation {
|
2018-08-06 14:05:49 +02:00
|
|
|
name = "${name}-unwrapped";
|
|
|
|
inherit src version;
|
|
|
|
|
|
|
|
sourceRoot = "source/src/ui/linux/TogglDesktop";
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteAll ${./TogglDesktop.pro} TogglDesktop.pro
|
|
|
|
substituteInPlace toggl.cpp \
|
|
|
|
--replace ./../../../toggl_api.h toggl_api.h
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
ln -s ${cacert}/etc/ssl/certs/ca-bundle.crt $out/cacert.pem
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [ qmake pkgconfig ];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
bugsnag-qt
|
|
|
|
libtoggl
|
|
|
|
qxtglobalshortcut
|
|
|
|
qtbase
|
2019-01-25 20:12:08 +01:00
|
|
|
qtwebengine
|
2018-08-06 14:05:49 +02:00
|
|
|
qt-oauth-lib
|
|
|
|
qtx11extras
|
|
|
|
libX11
|
|
|
|
libXScrnSaver
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2020-03-18 00:36:22 +01:00
|
|
|
toggldesktop-icons = mkDerivation {
|
2018-08-06 14:05:49 +02:00
|
|
|
name = "${name}-icons";
|
|
|
|
inherit (toggldesktop) src sourceRoot;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
for f in icons/*; do
|
|
|
|
mkdir -p $out/share/icons/hicolor/$(basename $f)/apps
|
|
|
|
mv $f/toggldesktop.png $_
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
toggldesktop-wrapped = runCommand "toggldesktop-wrapped" {} ''
|
|
|
|
mkdir -p $out/bin && ln -s ${toggldesktop}/toggldesktop $_
|
|
|
|
'';
|
|
|
|
|
|
|
|
desktopItem = makeDesktopItem rec {
|
|
|
|
categories = "Utility;";
|
|
|
|
desktopName = "Toggl";
|
|
|
|
genericName = desktopName;
|
|
|
|
name = "toggldesktop";
|
|
|
|
exec = "${toggldesktop-wrapped}/bin/toggldesktop";
|
|
|
|
icon = "toggldesktop";
|
|
|
|
};
|
|
|
|
in
|
|
|
|
|
|
|
|
buildEnv {
|
|
|
|
inherit name;
|
|
|
|
paths = [ desktopItem toggldesktop-icons toggldesktop-wrapped ];
|
|
|
|
|
2020-03-18 00:36:22 +01:00
|
|
|
meta = with lib; {
|
2018-08-06 14:05:49 +02:00
|
|
|
description = "Client for Toggl time tracking service";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://github.com/toggl/toggldesktop";
|
2018-08-06 14:05:49 +02:00
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ yegortimoshenko ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|