Skip to content

Instantly share code, notes, and snippets.

@x-yuri x-yuri/0000-apply.sh Secret
Last active Feb 9, 2019

Embed
What would you like to do?
toggldesktop changes
mkdir patches
curl https://gist.githubusercontent.com/x-yuri/060ff15dd7af7afeaddf6bc0c1f0f6c9/raw/b3629d915e37f9735f07fd6a3ba5cf9f75af7bcc/0001-Update-to-7.4.347.patch -o patches/0001-Update-to-7.4.347.patch
curl https://gist.githubusercontent.com/x-yuri/060ff15dd7af7afeaddf6bc0c1f0f6c9/raw/b3629d915e37f9735f07fd6a3ba5cf9f75af7bcc/0002-Switch-to-cmake.patch -o patches/0002-Switch-to-cmake.patch
git am patches/*
From 03f81e2c0c0dce2f26dfb855ffc047e89be2cc7d Mon Sep 17 00:00:00 2001
From: Yuri Kanivetsky <yuri.kanivetsky@gmail.com>
Date: Sat, 9 Feb 2019 20:53:22 +0200
Subject: [PATCH 1/2] Update to 7.4.347
---
.SRCINFO | 10 +++++-----
PKGBUILD | 26 +++++++++++++-------------
production.patch | 26 ++++++++++++++++++++++++--
3 files changed, 42 insertions(+), 20 deletions(-)
diff --git a/.SRCINFO b/.SRCINFO
index 1309f47..f27d326 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = toggldesktop
pkgdesc = Toggl time tracking software
- pkgver = 7.4.144
- pkgrel = 3
+ pkgver = 7.4.347
+ pkgrel = 1
url = https://github.com/toggl/toggldesktop
arch = x86_64
license = BSD
@@ -19,10 +19,10 @@ pkgbase = toggldesktop
depends = qt5-x11extras
conflicts = toggldesktop-bin
conflicts = toggl-bin
- source = toggldesktop-7.4.144.tar.gz::https://github.com/toggl/toggldesktop/archive/v7.4.144.tar.gz
+ source = toggldesktop-7.4.347.tar.gz::https://github.com/toggl/toggldesktop/archive/v7.4.347.tar.gz
source = production.patch
- sha512sums = 08bf840dc84bf16689bebcd21f25de493d6d245b65229fb01ddad67c3c878dbdda9e66952ae86e24f5d52a30edd08576f8e1755702956223dfd6c29000365359
- sha512sums = 484c6e3ba73e2f2ccbe9737424bee68624bd8d46a06735937b3ca134aa34ad9e335b260f7d22bcd3e351ae9d8b989ef048e78cf7ed52bac363bb651a7d229428
+ sha512sums = d6dbbef0039f9f4b0e5a560d716cb1dcfb9e4d7bb2b590b89269e3cc1625a0e58ab73bbc5a8df852e420f6422aa031b47df5b6a3bf12e01fb07d5a4aca92a09e
+ sha512sums = de9e603f87e72a766d49efa18b13f4b2e5bdf8e72916c71b96770610a7203eb767e069c63ab40dd7b753fb33fbdb3ee587460875cc7a08cf4a91364aac415150
pkgname = toggldesktop
diff --git a/PKGBUILD b/PKGBUILD
index c6573ed..2b89063 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,8 +4,8 @@
# Contributor: phi-mah
pkgname=toggldesktop
-pkgver=7.4.144
-pkgrel=3
+pkgver=7.4.347
+pkgrel=1
pkgdesc="Toggl time tracking software"
arch=('x86_64')
url="https://github.com/toggl/toggldesktop"
@@ -24,8 +24,8 @@ makedepends=('readline' 'gendesk')
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/toggl/toggldesktop/archive/v${pkgver}.tar.gz"
"production.patch")
-sha512sums=('08bf840dc84bf16689bebcd21f25de493d6d245b65229fb01ddad67c3c878dbdda9e66952ae86e24f5d52a30edd08576f8e1755702956223dfd6c29000365359'
- '484c6e3ba73e2f2ccbe9737424bee68624bd8d46a06735937b3ca134aa34ad9e335b260f7d22bcd3e351ae9d8b989ef048e78cf7ed52bac363bb651a7d229428')
+sha512sums=('d6dbbef0039f9f4b0e5a560d716cb1dcfb9e4d7bb2b590b89269e3cc1625a0e58ab73bbc5a8df852e420f6422aa031b47df5b6a3bf12e01fb07d5a4aca92a09e'
+ 'de9e603f87e72a766d49efa18b13f4b2e5bdf8e72916c71b96770610a7203eb767e069c63ab40dd7b753fb33fbdb3ee587460875cc7a08cf4a91364aac415150')
conflicts=('toggldesktop-bin' 'toggl-bin')
@@ -73,15 +73,15 @@ package() {
install -Dm644 src/lib/linux/TogglDesktopLibrary/build/release/libTogglDesktopLibrary.so.1 ${out}/lib/libTogglDesktopLibrary.so.1
# Copy Poco shared library
- install -Dm644 src/lib/linux/TogglDesktopLibrary/build/release/libPocoCrypto.so.50 ${out}/lib/libPocoCrypto.so.50
- install -Dm644 src/lib/linux/TogglDesktopLibrary/build/release/libPocoData.so.50 ${out}/lib/libPocoData.so.50
- install -Dm644 src/lib/linux/TogglDesktopLibrary/build/release/libPocoDataSQLite.so.50 ${out}/lib/libPocoDataSQLite.so.50
- install -Dm644 src/lib/linux/TogglDesktopLibrary/build/release/libPocoFoundation.so.50 ${out}/lib/libPocoFoundation.so.50
- install -Dm644 src/lib/linux/TogglDesktopLibrary/build/release/libPocoJSON.so.50 ${out}/lib/libPocoJSON.so.50
- install -Dm644 src/lib/linux/TogglDesktopLibrary/build/release/libPocoNet.so.50 ${out}/lib/libPocoNet.so.50
- install -Dm644 src/lib/linux/TogglDesktopLibrary/build/release/libPocoNetSSL.so.50 ${out}/lib/libPocoNetSSL.so.50
- install -Dm644 src/lib/linux/TogglDesktopLibrary/build/release/libPocoUtil.so.50 ${out}/lib/libPocoUtil.so.50
- install -Dm644 src/lib/linux/TogglDesktopLibrary/build/release/libPocoXML.so.50 ${out}/lib/libPocoXML.so.50
+ install -Dm644 src/lib/linux/TogglDesktopLibrary/build/release/libPocoCrypto.so.60 ${out}/lib/libPocoCrypto.so.60
+ install -Dm644 src/lib/linux/TogglDesktopLibrary/build/release/libPocoData.so.60 ${out}/lib/libPocoData.so.60
+ install -Dm644 src/lib/linux/TogglDesktopLibrary/build/release/libPocoDataSQLite.so.60 ${out}/lib/libPocoDataSQLite.so.60
+ install -Dm644 src/lib/linux/TogglDesktopLibrary/build/release/libPocoFoundation.so.60 ${out}/lib/libPocoFoundation.so.60
+ install -Dm644 src/lib/linux/TogglDesktopLibrary/build/release/libPocoJSON.so.60 ${out}/lib/libPocoJSON.so.60
+ install -Dm644 src/lib/linux/TogglDesktopLibrary/build/release/libPocoNet.so.60 ${out}/lib/libPocoNet.so.60
+ install -Dm644 src/lib/linux/TogglDesktopLibrary/build/release/libPocoNetSSL.so.60 ${out}/lib/libPocoNetSSL.so.60
+ install -Dm644 src/lib/linux/TogglDesktopLibrary/build/release/libPocoUtil.so.60 ${out}/lib/libPocoUtil.so.60
+ install -Dm644 src/lib/linux/TogglDesktopLibrary/build/release/libPocoXML.so.60 ${out}/lib/libPocoXML.so.60
# Copy openssl shared library
install -Dm644 src/lib/linux/TogglDesktopLibrary/build/release/libcrypto.so.1.1 ${out}/lib/libcrypto.so.1.1
diff --git a/production.patch b/production.patch
index 561787d..7679104 100644
--- a/production.patch
+++ b/production.patch
@@ -8,9 +8,9 @@ index cecc136b0..df6f43288 100644
, sync_interval_seconds_(0)
-, update_check_disabled_(false)
+, update_check_disabled_(true)
- , had_something_to_push_(false)
+ , trigger_sync_(false)
+ , trigger_push_(false)
, quit_(false)
- , ui_updater_(this, &Context::uiUpdaterActivity)
@@ -90,8 +90,6 @@ Context::Context(const std::string app_name, const std::string app_version)
Poco::Net::HTTPSStreamFactory::registerFactory();
}
@@ -33,3 +33,25 @@ index bf49aaa41..cc6b6a4ef 100644
DEFINES += APP_ENVIRONMENT=\\\"$$ENVIRONMENT\\\"
+--- a/src/ui/linux/TogglDesktop/TogglDesktop.pro 2019-02-08 14:28:17.536768387 +0200
++++ b/src/ui/linux/TogglDesktop/TogglDesktop.pro 2019-02-08 14:28:22.936768504 +0200
+@@ -50,7 +50,8 @@
+ idlenotificationwidget.cpp \
+ autocompletelistmodel.cpp \
+ autocompletecombobox.cpp \
+- autocompletelistview.cpp
++ autocompletelistview.cpp \
++ powermanagement.cpp
+
+ HEADERS += \
+ timeentryview.h \
+@@ -79,7 +80,8 @@
+ idlenotificationwidget.h \
+ autocompletelistmodel.h \
+ autocompletecombobox.h \
+- autocompletelistview.h
++ autocompletelistview.h \
++ powermanagement.h
+
+ FORMS += \
+ mainwindowcontroller.ui \
--
2.20.1
From e96ca8568a9bc9c74ec430c430e7550a3fe91d43 Mon Sep 17 00:00:00 2001
From: Yuri Kanivetsky <yuri.kanivetsky@gmail.com>
Date: Sat, 9 Feb 2019 20:59:23 +0200
Subject: [PATCH 2/2] Switch to cmake
---
.SRCINFO | 19 +++++-----
PKGBUILD | 97 ++++++++++++------------------------------------
jsoncpp.patch | 14 +++++++
production.patch | 31 +++-------------
4 files changed, 51 insertions(+), 110 deletions(-)
create mode 100644 jsoncpp.patch
diff --git a/.SRCINFO b/.SRCINFO
index f27d326..90621c9 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -5,24 +5,23 @@ pkgbase = toggldesktop
url = https://github.com/toggl/toggldesktop
arch = x86_64
license = BSD
- makedepends = readline
- makedepends = gendesk
+ makedepends = cmake
depends = libxss
- depends = gcc-libs
depends = qt5-base
- depends = qt5-declarative
- depends = qt5-location
- depends = qt5-sensors
- depends = qt5-svg
- depends = qt5-webchannel
- depends = qt5-webkit
+ depends = qt5-webengine
depends = qt5-x11extras
+ depends = openssl
+ depends = poco
+ depends = lua
+ depends = jsoncpp
conflicts = toggldesktop-bin
conflicts = toggl-bin
source = toggldesktop-7.4.347.tar.gz::https://github.com/toggl/toggldesktop/archive/v7.4.347.tar.gz
source = production.patch
+ source = jsoncpp.patch
sha512sums = d6dbbef0039f9f4b0e5a560d716cb1dcfb9e4d7bb2b590b89269e3cc1625a0e58ab73bbc5a8df852e420f6422aa031b47df5b6a3bf12e01fb07d5a4aca92a09e
- sha512sums = de9e603f87e72a766d49efa18b13f4b2e5bdf8e72916c71b96770610a7203eb767e069c63ab40dd7b753fb33fbdb3ee587460875cc7a08cf4a91364aac415150
+ sha512sums = 90ed77b0c2b6708c256e5f8fd74d37275cd85ccb81b6eeffa96f6adb22441b853386d6b16a157522d77820a032daf044917d2fb885a15502d218e3e48458e75a
+ sha512sums = 1b340bf5df760c47b0a8c7ba46c783ed2821ef4336d350a346782e74f0308ec96d350a6fe7acee59441f24b42ee55904095beba1162ac49de6418a7cfd139e63
pkgname = toggldesktop
diff --git a/PKGBUILD b/PKGBUILD
index 2b89063..efca02d 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -11,106 +11,55 @@ arch=('x86_64')
url="https://github.com/toggl/toggldesktop"
license=('BSD')
depends=('libxss'
- 'gcc-libs'
'qt5-base'
- 'qt5-declarative'
- 'qt5-location'
- 'qt5-sensors'
- 'qt5-svg'
- 'qt5-webchannel'
- 'qt5-webkit'
- 'qt5-x11extras')
-makedepends=('readline' 'gendesk')
+ 'qt5-webengine'
+ 'qt5-x11extras'
+ 'openssl'
+ 'poco'
+ 'lua'
+ 'jsoncpp'
+ )
+makedepends=('cmake')
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/toggl/toggldesktop/archive/v${pkgver}.tar.gz"
- "production.patch")
+ "production.patch"
+ 'jsoncpp.patch')
sha512sums=('d6dbbef0039f9f4b0e5a560d716cb1dcfb9e4d7bb2b590b89269e3cc1625a0e58ab73bbc5a8df852e420f6422aa031b47df5b6a3bf12e01fb07d5a4aca92a09e'
- 'de9e603f87e72a766d49efa18b13f4b2e5bdf8e72916c71b96770610a7203eb767e069c63ab40dd7b753fb33fbdb3ee587460875cc7a08cf4a91364aac415150')
+ '90ed77b0c2b6708c256e5f8fd74d37275cd85ccb81b6eeffa96f6adb22441b853386d6b16a157522d77820a032daf044917d2fb885a15502d218e3e48458e75a'
+ '1b340bf5df760c47b0a8c7ba46c783ed2821ef4336d350a346782e74f0308ec96d350a6fe7acee59441f24b42ee55904095beba1162ac49de6418a7cfd139e63')
conflicts=('toggldesktop-bin' 'toggl-bin')
prepare() {
- cd "${srcdir}"
-
- (
cd "${pkgname}-${pkgver}"
# patch to build for production
# https://github.com/toggl/toggldesktop/wiki/Building-Toggl-Desktop-from-source-for-usage-with-live-servers
- msg2 "production patch"
+# msg2 "production patch"
patch -p1 < ../production.patch
- )
-
- # make the run script
- cat << EOF > ${pkgname}
-#!/bin/bash
-exec /opt/${pkgname}/TogglDesktop.sh "\$@"
-EOF
-
- # generate a desktop file
- gendesk -f -n --pkgname "${pkgname}" --pkgdesc "${pkgdesc}" --name "Toggl Desktop"
+ patch -p1 < ../jsoncpp.patch
}
build() {
- cd "${srcdir}/${pkgname}-${pkgver}"
- make -j1 deps
- make -j1
+ mkdir -p build
+ cd build
+ cmake ../${pkgname}-${pkgver} -DCMAKE_INSTALL_PREFIX=/usr
+ make
}
package() {
- cd "${srcdir}"
- install -Dm644 "${pkgname}.desktop" "${pkgdir}/usr/share/applications/${pkgname}.desktop"
- install -Dm755 ${pkgname} ${pkgdir}/usr/bin/${pkgname}
+ cd build
+ make DESTDIR="$pkgdir/" install
- cd "${pkgname}-${pkgver}"
+ cd "../${pkgname}-${pkgver}"
# license file in standard location
install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
- out="${pkgdir}/opt/${pkgname}"
-
- # Copy Toggl Desktop shared library
- install -Dm644 src/lib/linux/TogglDesktopLibrary/build/release/libTogglDesktopLibrary.so.1 ${out}/lib/libTogglDesktopLibrary.so.1
-
- # Copy Poco shared library
- install -Dm644 src/lib/linux/TogglDesktopLibrary/build/release/libPocoCrypto.so.60 ${out}/lib/libPocoCrypto.so.60
- install -Dm644 src/lib/linux/TogglDesktopLibrary/build/release/libPocoData.so.60 ${out}/lib/libPocoData.so.60
- install -Dm644 src/lib/linux/TogglDesktopLibrary/build/release/libPocoDataSQLite.so.60 ${out}/lib/libPocoDataSQLite.so.60
- install -Dm644 src/lib/linux/TogglDesktopLibrary/build/release/libPocoFoundation.so.60 ${out}/lib/libPocoFoundation.so.60
- install -Dm644 src/lib/linux/TogglDesktopLibrary/build/release/libPocoJSON.so.60 ${out}/lib/libPocoJSON.so.60
- install -Dm644 src/lib/linux/TogglDesktopLibrary/build/release/libPocoNet.so.60 ${out}/lib/libPocoNet.so.60
- install -Dm644 src/lib/linux/TogglDesktopLibrary/build/release/libPocoNetSSL.so.60 ${out}/lib/libPocoNetSSL.so.60
- install -Dm644 src/lib/linux/TogglDesktopLibrary/build/release/libPocoUtil.so.60 ${out}/lib/libPocoUtil.so.60
- install -Dm644 src/lib/linux/TogglDesktopLibrary/build/release/libPocoXML.so.60 ${out}/lib/libPocoXML.so.60
-
- # Copy openssl shared library
- install -Dm644 src/lib/linux/TogglDesktopLibrary/build/release/libcrypto.so.1.1 ${out}/lib/libcrypto.so.1.1
- install -Dm644 src/lib/linux/TogglDesktopLibrary/build/release/libssl.so.1.1 ${out}/lib/libssl.so.1.1
+# out="${pkgdir}/opt/${pkgname}"
# Copy README
- install -Dm644 src/ui/linux/README ${out}
-
- # Copy Bugsnag library
- install -Dm644 third_party/bugsnag-qt/build/release/libbugsnag-qt.so.1 ${out}/lib/libbugsnag-qt.so.1
-
- # Copy executable
- install -Dm755 src/ui/linux/TogglDesktop/build/release/TogglDesktop ${out}
-
- # Copy startup script
- install -Dm755 src/ui/linux/TogglDesktop.sh ${out}
-
- # Copy icons
- install -Dm644 src/ui/linux/TogglDesktop/icons/1024x1024/${pkgname}_gray.png ${out}/icons/1024x1024/${pkgname}_gray.png
- for res in 1024x1024 128x128 16x16 24x24 256x256 32x32 48x48 64x64 96x96; do
- install -Dm644 src/ui/linux/TogglDesktop/icons/${res}/${pkgname}.png ${out}/icons/${res}/${pkgname}.png
- done
-
- # Copy certificate bundle
- install -Dm644 src/ssl/cacert.pem ${out}
-
- # link icon for desktop file
- install -dm755 "${pkgdir}/usr/share/pixmaps/"
- ln -s "/opt/${pkgname}/icons/1024x1024/${pkgname}.png" "${pkgdir}/usr/share/pixmaps/${pkgname}.png"
+# install -Dm644 src/ui/linux/README ${out}
}
# vim:set ts=2 sw=2 et:
diff --git a/jsoncpp.patch b/jsoncpp.patch
new file mode 100644
index 0000000..ba3c969
--- /dev/null
+++ b/jsoncpp.patch
@@ -0,0 +1,14 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index b52dbb3..f278060 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -36,7 +36,8 @@ if(NOT USE_BUNDLED_LIBRARIES)
+ include_directories(${LUA_INCLUDE_DIRS})
+
+ # Look for JSON
+- find_package(jsoncpp CONFIG)
++ pkg_search_module(jsoncpp jsoncpp)
++ include_directories(${jsoncpp_INCLUDE_DIRS})
+
+ # Look for Qxt
+ pkg_search_module(QXT_CORE QxtCore-qt5)
diff --git a/production.patch b/production.patch
index 7679104..90a7325 100644
--- a/production.patch
+++ b/production.patch
@@ -1,5 +1,5 @@
diff --git a/src/context.cc b/src/context.cc
-index cecc136b0..df6f43288 100644
+index 7c9f0fb..8d839ab 100644
--- a/src/context.cc
+++ b/src/context.cc
@@ -76,7 +76,7 @@ Context::Context(const std::string app_name, const std::string app_version)
@@ -11,17 +11,18 @@ index cecc136b0..df6f43288 100644
, trigger_sync_(false)
, trigger_push_(false)
, quit_(false)
-@@ -90,8 +90,6 @@ Context::Context(const std::string app_name, const std::string app_version)
+@@ -92,9 +92,6 @@ Context::Context(const std::string app_name, const std::string app_version)
Poco::Net::HTTPSStreamFactory::registerFactory();
}
- urls::SetUseStagingAsBackend(
- app_version.find("7.0.0") != std::string::npos);
-
+-
Poco::ErrorHandler::set(&error_handler_);
Poco::Net::initializeSSL();
+
diff --git a/src/ui/linux/TogglDesktop/TogglDesktop.pro b/src/ui/linux/TogglDesktop/TogglDesktop.pro
-index bf49aaa41..cc6b6a4ef 100644
+index 4bbf84b..cf44f8e 100644
--- a/src/ui/linux/TogglDesktop/TogglDesktop.pro
+++ b/src/ui/linux/TogglDesktop/TogglDesktop.pro
@@ -8,7 +8,7 @@ VERSION = 7.0.0
@@ -33,25 +34,3 @@ index bf49aaa41..cc6b6a4ef 100644
DEFINES += APP_ENVIRONMENT=\\\"$$ENVIRONMENT\\\"
---- a/src/ui/linux/TogglDesktop/TogglDesktop.pro 2019-02-08 14:28:17.536768387 +0200
-+++ b/src/ui/linux/TogglDesktop/TogglDesktop.pro 2019-02-08 14:28:22.936768504 +0200
-@@ -50,7 +50,8 @@
- idlenotificationwidget.cpp \
- autocompletelistmodel.cpp \
- autocompletecombobox.cpp \
-- autocompletelistview.cpp
-+ autocompletelistview.cpp \
-+ powermanagement.cpp
-
- HEADERS += \
- timeentryview.h \
-@@ -79,7 +80,8 @@
- idlenotificationwidget.h \
- autocompletelistmodel.h \
- autocompletecombobox.h \
-- autocompletelistview.h
-+ autocompletelistview.h \
-+ powermanagement.h
-
- FORMS += \
- mainwindowcontroller.ui \
--
2.20.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.