summaryrefslogtreecommitdiff
path: root/freefilesync/ffs_el.patch
blob: 05d8dd6562062777cc5a1e3e429ef7447ef1d5cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
The cstddef discovery is from https://stackoverflow.com/questions/52567517/freefilesync-c-error-byte-is-not-a-member-of-std
Some changes just make the application work better in an installed setting (e.g., the hard-coded resouce path).
Tricking the wxWidgets ABI version comes from https://stackoverflow.com/questions/45123664/wxwidgets-runtime-error-mismatch-version/47822976#47822976
FreeFileSync 10.11 updated the default compile flags to -std=c++2a, but this fails on gcc 4.8.5 on el7. Reverting to -std=c++17 allows the application to compile.
diff -Naur 10.13-0/FreeFileSync/Source/base/ffs_paths.cpp 10.13-1/FreeFileSync/Source/base/ffs_paths.cpp
--- 10.13-0/FreeFileSync/Source/base/ffs_paths.cpp	2019-06-14 20:23:07.615661499 -0400
+++ 10.13-1/FreeFileSync/Source/base/ffs_paths.cpp	2019-06-14 20:36:28.178274292 -0400
@@ -55,7 +55,8 @@
 
 Zstring fff::getResourceDirPf()
 {
-    return getProcessParentFolderPath() + FILE_NAME_SEPARATOR + Zstr("Resources") + FILE_NAME_SEPARATOR;
+    // For Fedora, EL and Devuan, install to /usr/share/freefilesync specificly
+    return Zstr("/usr/share/freefilesync/");
 }
 
 
diff -Naur -x '*.orig' -x '*.rej' -x '*.swp' 10.11-0/FreeFileSync/Source/Makefile 10.11-1/FreeFileSync/Source/Makefile
--- 10.11-0/FreeFileSync/Source/Makefile	2019-04-12 07:59:45.042147902 -0400
+++ 10.15-1/FreeFileSync/Source/Makefile        2019-08-16 08:19:12.101271747 -0400
@@ -1,10 +1,10 @@
-EXENAME = FreeFileSync_$(shell arch)
+EXENAME = FreeFileSync

-CXXFLAGS = -std=c++2a -pipe -DWXINTL_NO_GETTEXT_MACRO -I../.. -I../../zenXml -include "zen/i18n.h" -include "zen/warn_static.h" \
+CXXFLAGS = -std=c++17 -pipe -DWXINTL_NO_GETTEXT_MACRO -I../.. -I../../zenXml -include "zen/i18n.h" -include "zen/warn_static.h" \
            -Wall -Wfatal-errors -Wmissing-include-dirs -Wswitch-enum -Wcast-align -Wshadow -Wnon-virtual-dtor \
-           -O3 -DNDEBUG `wx-config --cxxflags --debug=no` -pthread
+           -O3 -DNDEBUG -fPIC `wx-config --version=3.0 --cxxflags --debug=no` -pthread

-LINKFLAGS = -s -no-pie `wx-config --libs std, aui --debug=no` -pthread
+LINKFLAGS = -s -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,-z,relro  -no-pie `wx-config --version=3.0 --libs std, aui --debug=no | sed -r -e 's/-[^[:space:]]+web[^[:space:]]+//;'` -lz -pthread


 CXXFLAGS  += `pkg-config --cflags openssl`
@@ -17,6 +17,7 @@
 LINKFLAGS += `pkg-config --libs   libssh2`

 CXXFLAGS  += `pkg-config --cflags gtk+-2.0`
+LINKFLAGS += `pkg-config --libs   gtk+-2.0`
 #treat as system headers so that warnings are hidden:
 CXXFLAGS  += -isystem/usr/include/gtk-2.0

diff -Naur -x '*.orig' -x '*.rej' -x '*.swp' 10.11-0/FreeFileSync/Source/RealTimeSync/application.h 10.11-1/FreeFileSync/Source/RealTimeSync/application.h
--- 10.11-0/FreeFileSync/Source/RealTimeSync/application.h	2019-04-12 07:59:45.035147580 -0400
+++ 10.11-1/FreeFileSync/Source/RealTimeSync/application.h	2019-04-12 10:19:57.227913415 -0400
@@ -7,6 +7,8 @@
 #ifndef APPLICATION_H_18506781708176342677
 #define APPLICATION_H_18506781708176342677
 
+#define __GXX_ABI_VERSION 1002
+
 #include <wx/app.h>
 
 
diff -Naur -x '*.orig' -x '*.rej' -x '*.swp' 10.11-0/FreeFileSync/Source/RealTimeSync/Makefile 10.11-1/FreeFileSync/Source/RealTimeSync/Makefile
--- 10.11-0/FreeFileSync/Source/RealTimeSync/Makefile	2019-04-12 07:59:45.008146336 -0400
+++ 10.15-1/FreeFileSync/Source/RealTimeSync/Makefile   2019-08-16 08:19:21.959638104 -0400
@@ -1,13 +1,14 @@
-EXENAME = RealTimeSync_$(shell arch)
+EXENAME = RealTimeSync

-CXXFLAGS = -std=c++2a -pipe -DWXINTL_NO_GETTEXT_MACRO -I../../.. -I../../../zenXml -include "zen/i18n.h" -include "zen/warn_static.h" \
+CXXFLAGS = -std=c++17 -pipe -DWXINTL_NO_GETTEXT_MACRO -I../../.. -I../../../zenXml -include "zen/i18n.h" -include "zen/warn_static.h" \
            -Wall -Wfatal-errors -Wmissing-include-dirs -Wswitch-enum -Wcast-align -Wshadow -Wnon-virtual-dtor \
-           -O3 -DNDEBUG `wx-config --cxxflags --debug=no` -pthread
+           -O3 -DNDEBUG -fPIC `wx-config --version=3.0 --cxxflags --debug=no` -pthread

-LINKFLAGS = -s -no-pie `wx-config --libs std, aui --debug=no` -pthread
+LINKFLAGS = -s -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -no-pie `wx-config --version=3.0 --cxxflags --libs std, aui --debug=no | sed -r -e 's/-[^[:space:]]+web[^[:space:]]+//;'` -lz -pthread

 #Gtk - support "no button border"
 CXXFLAGS  += `pkg-config --cflags gtk+-2.0`
+LINKFLAGS += `pkg-config --libs   gtk+-2.0`
 #treat as system headers so that warnings are hidden:
 CXXFLAGS  += -isystem/usr/include/gtk-2.0

@@ -56,7 +56,6 @@
 CPP_FILES+=afs/init_curl_libssh2.cpp
 CPP_FILES+=afs/native.cpp
 CPP_FILES+=afs/sftp.cpp
-CPP_FILES+=afs/libssh2/init_libssh2.cpp
 CPP_FILES+=ui/batch_config.cpp
 CPP_FILES+=ui/abstract_folder_picker.cpp
 CPP_FILES+=ui/batch_status_handler.cpp
diff -Naur -x '*.orig' -x '*.rej' -x '*.swp' 10.11-0/FreeFileSync/Source/ui/small_dlgs.cpp 10.11-1/FreeFileSync/Source/ui/small_dlgs.cpp
--- 10.11-0/FreeFileSync/Source/ui/small_dlgs.cpp	2019-04-12 07:59:45.318160616 -0400
+++ 10.11-1/FreeFileSync/Source/ui/small_dlgs.cpp	2019-04-12 10:19:57.228913439 -0400
@@ -115,6 +115,8 @@
         L" x64";
 #endif
 
+    build +=
+        L" for CentOS 7";
 
     GetSizer()->SetSizeHints(this); //~=Fit() + SetMinSize()
 
diff -Naur -x '*.orig' -x '*.rej' -x '*.swp' 10.11-0/wx+/app_main.h 10.11-1/wx+/app_main.h
--- 10.11-0/wx+/app_main.h	2019-04-12 07:59:44.936143019 -0400
+++ 10.11-1/wx+/app_main.h	2019-04-12 10:19:57.228913439 -0400
@@ -7,6 +7,8 @@
 #ifndef APP_MAIN_H_08215601837818347575856
 #define APP_MAIN_H_08215601837818347575856
 
+#define __GXX_ABI_VERSION 1002
+
 #include <wx/window.h>
 #include <wx/app.h>
 
diff -Naur -x '*.orig' -x '*.rej' -x '*.swp' 10.11-0/zen/ring_buffer.h 10.11-1/zen/ring_buffer.h
--- 10.11-0/zen/ring_buffer.h	2019-04-12 07:59:46.098196548 -0400
+++ 10.11-1/zen/ring_buffer.h	2019-04-12 10:19:57.228913439 -0400
@@ -9,6 +9,7 @@
 
 #include <cassert>
 #include "scope_guard.h"
+#include <cstddef>
 
 
 namespace zen
diff -Naur -x '*.orig' -x '*.rej' -x '*.swp' 10.11-0/zen/serialize.h 10.11-1/zen/serialize.h
--- 10.11-0/zen/serialize.h	2019-04-12 07:59:46.080195719 -0400
+++ 10.11-1/zen/serialize.h	2019-04-12 10:19:57.229913463 -0400
@@ -9,6 +9,7 @@
 
 #include <functional>
 #include <cstdint>
+#include <cstddef>
 #include "string_base.h"
 //keep header clean from specific stream implementations! (e.g.file_io.h)! used by abstract.h!
 
bgstack15