summaryrefslogtreecommitdiff
path: root/freefilesync/debian/patches
diff options
context:
space:
mode:
Diffstat (limited to 'freefilesync/debian/patches')
-rw-r--r--freefilesync/debian/patches/ffs_desktop_notifications.patch53
-rw-r--r--freefilesync/debian/patches/ffs_no_check_updates.patch8
-rw-r--r--freefilesync/debian/patches/revert_zenju_aggressive_upstreamisms.patch95
-rw-r--r--freefilesync/debian/patches/series1
4 files changed, 133 insertions, 24 deletions
diff --git a/freefilesync/debian/patches/ffs_desktop_notifications.patch b/freefilesync/debian/patches/ffs_desktop_notifications.patch
new file mode 100644
index 0000000..5610fd1
--- /dev/null
+++ b/freefilesync/debian/patches/ffs_desktop_notifications.patch
@@ -0,0 +1,53 @@
+diff -aur 11.9-1/FreeFileSync/Source/Makefile 11.9-2/FreeFileSync/Source/Makefile
+--- 11.9-1/FreeFileSync/Source/Makefile 2021-05-06 16:24:53.987902373 -0400
++++ 11.9-2/FreeFileSync/Source/Makefile 2021-05-06 17:09:31.512474440 -0400
+@@ -21,6 +22,13 @@
+ #treat as system headers so that warnings are hidden:
+ cxxFlags += -isystem/usr/include/gtk-3.0
+
++with_notifications ?= NO
++ifeq ($(with_notifications),YES)
++# package libglibmm-2.4-dev or glibmm24-devel
++cxxFlags += `pkg-config --cflags giomm-2.4` -Dwith_notifications
++linkFlags += `pkg-config --libs giomm-2.4`
++endif
++
+ #support for SELinux (optional)
+ SELINUX_EXISTING=$(shell pkg-config --exists libselinux && echo YES)
+ ifeq ($(SELINUX_EXISTING),YES)
+diff -aur 11.9-1/FreeFileSync/Source/ui/progress_indicator.cpp 11.9-2/FreeFileSync/Source/ui/progress_indicator.cpp
+--- 11.9-1/FreeFileSync/Source/ui/progress_indicator.cpp 2021-05-06 15:20:34.286831934 -0400
++++ 11.9-2/FreeFileSync/Source/ui/progress_indicator.cpp 2021-05-06 17:11:45.486004158 -0400
+@@ -32,6 +32,9 @@
+ #include "../perf_check.h"
+ #include "../icon_buffer.h"
+
++#ifdef with_notifications
++#include<giomm-2.4/giomm.h>
++#endif
+
+ using namespace zen;
+ using namespace fff;
+@@ -1359,6 +1362,22 @@
+ pnl_.m_staticTextPhase->SetLabel(getSyncResultLabel(syncResult));
+ //pnl_.m_bitmapStatus->SetToolTip(); -> redundant
+
++#ifdef with_notifications
++ // Desktop notification for Linux
++ char title[] = "FreeFileSync";
++ // from https://stackoverflow.com/a/12097772
++ std::wstring ssR {getSyncResultLabel(syncResult)};
++ std::string body;
++ std::transform(ssR.begin(), ssR.end(), std::back_inserter(body), [] (wchar_t c){ return (char)c;});
++ char icon[] = "freefilesync";
++ auto Application = Gio::Application::create("org.zenju.freefilesync", Gio::APPLICATION_FLAGS_NONE);
++ Application->register_application();
++ auto Notification = Gio::Notification::create(title);
++ Notification->set_body(body);
++ auto Icon = Gio::ThemedIcon::create(icon);
++ Notification->set_icon (Icon);
++ Application->send_notification(Notification);
++#endif
+ //show status on Windows 7 taskbar
+ if (taskbar_.get())
+ switch (syncResult)
diff --git a/freefilesync/debian/patches/ffs_no_check_updates.patch b/freefilesync/debian/patches/ffs_no_check_updates.patch
index d90bf7d..00cfb2b 100644
--- a/freefilesync/debian/patches/ffs_no_check_updates.patch
+++ b/freefilesync/debian/patches/ffs_no_check_updates.patch
@@ -1,3 +1,4 @@
+Version: 11.10
diff -Naur -x '*.orig' -x '*.rej' -x '*.git*' 11.4-0/FreeFileSync/Source/ui/main_dlg.cpp 11.4-1/FreeFileSync/Source/ui/main_dlg.cpp
--- 11.4-0/FreeFileSync/Source/ui/main_dlg.cpp 2020-12-08 08:15:29.432156507 -0500
+++ 11.4-1/FreeFileSync/Source/ui/main_dlg.cpp 2020-12-08 18:29:47.210277596 -0500
@@ -57,16 +58,17 @@ diff -aur 11.7-0/FreeFileSync/Source/ui/version_check.cpp 11.7-1/FreeFileSync/So
}
catch (const SysError& e) { updateDetailsMsg = _("Failed to retrieve update information.") + + L"\n\n" + e.toString(); }
-@@ -178,8 +179,7 @@
+@@ -182,8 +183,8 @@
std::string getOnlineVersion(const std::vector<std::pair<std::string, std::string>>& postParams) //throw SysError
{
- const std::string response = sendHttpPost(Zstr("https://api.freefilesync.org/latest_version"), postParams,
- ffsUpdateCheckUserAgent, nullptr /*caCertFilePath*/, nullptr /*notifyUnbufferedIO*/).readAll(); //throw SysError
+ const std::string response = "";
- return trimCpy(response);
- }
++ return trimCpy(response);
+ if (response.empty() ||
+ !std::all_of(response.begin(), response.end(), [](char c) { return isDigit(c) || c == FFS_VERSION_SEPARATOR; }) ||
@@ -226,13 +226,13 @@
const std::string onlineVersion = getOnlineVersion(geHttpPostParameters(parent)); //throw SysError
lastOnlineVersion = onlineVersion;
diff --git a/freefilesync/debian/patches/revert_zenju_aggressive_upstreamisms.patch b/freefilesync/debian/patches/revert_zenju_aggressive_upstreamisms.patch
index 6cae409..de8d5e9 100644
--- a/freefilesync/debian/patches/revert_zenju_aggressive_upstreamisms.patch
+++ b/freefilesync/debian/patches/revert_zenju_aggressive_upstreamisms.patch
@@ -1,3 +1,6 @@
+Message: Some of these can be traced back to version 10.23 which was the last to not use <unordered_map>
+Date: 2021-05-10
+Version: 11.10
diff -x '*.rej' -x '*.orig' -x '*.git*' -Naur 10.24-0/wx+/choice_enum.h 10.24-1/wx+/choice_enum.h
--- 10.24-0/wx+/choice_enum.h 2020-05-17 18:30:59.441499418 -0400
+++ 10.24-1/wx+/choice_enum.h 2020-05-17 18:53:59.893685507 -0400
@@ -9,37 +12,32 @@ diff -x '*.rej' -x '*.orig' -x '*.git*' -Naur 10.24-0/wx+/choice_enum.h 10.24-1/
#include <vector>
#include <wx/choice.h>
-@@ -44,11 +43,8 @@
- descrList.push_back({value, {text, tooltip}});
- return *this;
- }
--
+@@ -47,8 +46,6 @@
+
using DescrList = std::vector<std::pair<Enum, std::pair<wxString, wxString>>>;
DescrList descrList;
-
-- std::unordered_map<const wxChoice*, std::vector<wxString>> itemsSetLast;
+- std::unordered_map<const wxChoice*, std::vector<wxString>> labelsSetLast;
};
template <class Enum> void setEnumVal(const EnumDescrList<Enum>& mapping, wxChoice& ctrl, Enum value);
template <class Enum> Enum getEnumVal(const EnumDescrList<Enum>& mapping, const wxChoice& ctrl);
-@@ -69,34 +65,26 @@
-
- //--------------- impelementation -------------------------------------------
+@@ -71,32 +68,24 @@
template <class Enum>
--void setEnumVal(EnumDescrList<Enum>& mapping, wxChoice& ctrl, Enum value)
-+void setEnumVal(const EnumDescrList<Enum>& mapping, wxChoice& ctrl, Enum value)
+ void setEnumVal(EnumDescrList<Enum>& mapping, wxChoice& ctrl, Enum value)
{
-- auto& itemsSetLast = mapping.itemsSetLast[&ctrl];
+- auto& labelsSetLast = mapping.labelsSetLast[&ctrl];
+-
+- std::vector<wxString> labels;
+- for (const auto& [val, texts] : mapping.descrList)
+- labels.push_back(texts.first);
+ ctrl.Clear();
-- std::vector<wxString> items;
+- if (labels != labelsSetLast)
+ int selectedPos = 0;
- for (auto it = mapping.descrList.begin(); it != mapping.descrList.end(); ++it)
-- items.push_back(it->second.first);
--
-- if (items != itemsSetLast)
++ for (auto it = mapping.descrList.begin(); it != mapping.descrList.end(); ++it)
{
-- ctrl.Set(items); //expensive as fuck! => only call when absolutely needed!
-- itemsSetLast = std::move(items);
+- ctrl.Set(labels); //expensive as fuck! => only call when absolutely needed!
+- labelsSetLast = std::move(labels);
+ ctrl.Append(it->second.first);
+ if (it->first == value)
+ {
@@ -52,7 +50,7 @@ diff -x '*.rej' -x '*.orig' -x '*.git*' -Naur 10.24-0/wx+/choice_enum.h 10.24-1/
+ }
}
- //-----------------------------------------------------------------
--
+
- const auto it = std::find_if(mapping.descrList.begin(), mapping.descrList.end(), [&](const auto& mapItem) { return mapItem.first == value; });
- if (it != mapping.descrList.end())
- {
@@ -61,7 +59,7 @@ diff -x '*.rej' -x '*.orig' -x '*.git*' -Naur 10.24-0/wx+/choice_enum.h 10.24-1/
- ctrl.SetToolTip(tooltip);
- else
- ctrl.UnsetToolTip();
-
+-
- const int selectedPos = it - mapping.descrList.begin();
- ctrl.SetSelection(selectedPos);
- }
@@ -305,3 +303,58 @@ diff -Naur -x '*.orig' -x '*.rej' -x '*.git*' 11.4-1/wx+/no_flicker.h 11.4-2/wx+
//get rid of margins and space between text blocks/"paragraphs"
richCtrl.SetMargins({0, 0});
+Message: Revert __cpp_lib_atomic_wait which is not yet implemented in g++-10 or clang++-11 on Debian
+How does Zenju compile this?!
+Date: 2021-05-10
+--- 11.9-0/zen/globals.h 2021-05-10 08:10:14.755776667 -0400
++++ 11.9-1/zen/globals.h 2021-05-10 09:17:25.122241641 -0400
+@@ -223,7 +223,11 @@
+ void PodSpinMutex::lock()
+ {
+ while (!tryLock())
++#ifdef __cpp_lib_atomic_wait
+ flag_.wait(true, std::memory_order_relaxed);
++#else
++ ;
++#endif
+ }
+
+
+@@ -231,7 +235,9 @@
+ void PodSpinMutex::unlock()
+ {
+ flag_.clear(std::memory_order_release);
++#ifdef __cpp_lib_atomic_wait
+ flag_.notify_one();
++#endif
+ }
+
+
+Message: This one should work; it's a c++17 specification, but it doesn't work.
+Date: 2021-05-10
+diff -aur 11.10-0/zen/legacy_compiler.cpp 11.10-1/zen/legacy_compiler.cpp
+--- 11.10-0/zen/legacy_compiler.cpp 2021-05-10 08:10:14.755776667 -0400
++++ 11.10-1/zen/legacy_compiler.cpp 2021-05-10 10:06:01.998079701 -0400
+@@ -14,15 +14,17 @@
+
+ double zen::fromChars(const char* first, const char* last)
+ {
+- double num = 0;
+- [[maybe_unused]] const std::from_chars_result rv = std::from_chars(first, last, num);
+- return num;
++ return std::strtod(std::string(first, last).c_str(), nullptr);
+ }
+
+
+ const char* zen::toChars(char* first, char* last, double num)
+ {
+- const std::to_chars_result rv = std::to_chars(first, last, num);
+- return rv.ec == std::errc{} ? rv.ptr : first;
++ const size_t bufSize = last - first;
++ const int charsWritten = std::snprintf(first, bufSize, "%g", num);
++ //C99: returns number of chars written if successful, < 0 or >= bufferSize on failure
++
++ return 0 <= charsWritten && charsWritten < static_cast<int>(bufSize) ?
++ first + charsWritten : first;
+ }
+
diff --git a/freefilesync/debian/patches/series b/freefilesync/debian/patches/series
index 7896b6e..7a709ef 100644
--- a/freefilesync/debian/patches/series
+++ b/freefilesync/debian/patches/series
@@ -9,3 +9,4 @@ ffs_curl.patch
revert_zenju_aggressive_upstreamisms.patch
ffs_gcc.patch
ffs_traditional_view.patch
+ffs_desktop_notifications.patch
bgstack15