summaryrefslogtreecommitdiff
path: root/freefilesync
diff options
context:
space:
mode:
Diffstat (limited to 'freefilesync')
-rw-r--r--freefilesync/ffs_abi.patch12
-rw-r--r--freefilesync/freefilesync.spec73
2 files changed, 76 insertions, 9 deletions
diff --git a/freefilesync/ffs_abi.patch b/freefilesync/ffs_abi.patch
new file mode 100644
index 0000000..375397c
--- /dev/null
+++ b/freefilesync/ffs_abi.patch
@@ -0,0 +1,12 @@
+diff -Naur -x '*.orig' -x '*.rej' -x '*.swp' 10.9-0/wx+/app_main.h 10.9-1/wx+/app_main.h
+--- 10.9-0/wx+/app_main.h 2019-02-13 16:05:15.000000000 -0500
++++ 10.9-1/wx+/app_main.h 2019-02-16 13:51:32.437266070 -0500
+@@ -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 --git a/freefilesync/freefilesync.spec b/freefilesync/freefilesync.spec
index 591adbf..2136e86 100644
--- a/freefilesync/freefilesync.spec
+++ b/freefilesync/freefilesync.spec
@@ -1,6 +1,17 @@
+# Summary for CentOS 7 compilation of freefilesync:
+# 1. city-fan repo (http://www.city-fan.org/ftp/contrib/yum-repo/) for newer libssh2
+# 2. sclo for gcc 7.3.1
+# 3. all sorts of custom patches to code in freefilesync.spec and some standalone patch files.
+# 4. custom openssl 1.1.0-devel and -libs packages.
%global pkgname FreeFileSync
%global prog2name RealTimeSync
%global dummy_package 0
+%define scl_env %{nil}
+%define scl_buildreq coreutils
+%if 0%{?el6}%{?el7}
+ %define scl_env devtoolset-7
+ %define scl_buildreq devtoolset-7-toolchain
+%endif
Name: freefilesync
Version: 10.9
Release: 1%{?dist}
@@ -21,6 +32,7 @@ Patch3: ffs_fedora.patch
Patch4: ffs_allow_parallel_ops.patch
Patch5: ffs_old_libcurl.patch
Patch6: ffs_sftp.patch
+Patch7: ffs_abi.patch
Packager: B Stack <bgstack15@gmail.com>
# WARNING: the build will FAIL if you have wxGTK3-devel installed. Only wxGTK2-devel should be on the build system.
@@ -35,6 +47,12 @@ BuildRequires: openssl-devel
BuildRequires: pkgconfig(gtk+-2.0)
BuildRequires: pkgconfig(libselinux)
BuildRequires: pkgconfig(zlib)
+%if 0%{?el6}%{?el7}
+BuildRequires: wxGTK-devel
+%endif
+%if "%{?scl_env}" != ""
+BuildRequires: %{scl_buildreq}
+%endif
Requires: hicolor-icon-theme
%description
@@ -57,17 +75,51 @@ find . ! -type d \( -name '*.c' -o -name '*.cpp' -o -name '*.h' \) \
%patch4 -p1
%patch5 -p1
%patch6 -p1
-
+%patch7 -p1
+
+%if "%{?scl_env}" != ""
+ # everything minus the -fPIC got farther but failed asking for -fPIC
+ # another option is to use the output of "wx-config --libs std, aui --debug=no" from fc28 and find the 3.0 libs and use those here.
+ %{__sed} \
+ -e 's|-O3 -DNDEBUG|& -I/usr/include/wx-3.0-gtk2 -I/usr/lib64/wx/include/gtk2-unicode-3.0-gtk2 -fPIC|;' \
+ -e '/LINKFLAGS/s|-no-pie|& -I/usr/include/wx-3.0-gtk2 -I/usr/lib64/wx/include/gtk2-unicode-3.0-gtk2 -pthread -lwx_gtk2u_aui-3.0-gtk2 -lwx_gtk2u_xrc-3.0-gtk2 -lwx_gtk2u_html-3.0-gtk2 -lwx_gtk2u_qa-3.0-gtk2 -lwx_gtk2u_adv-3.0-gtk2 -lwx_gtk2u_core-3.0-gtk2 -lwx_baseu_xml-3.0-gtk2 -lwx_baseu_net-3.0-gtk2 -lwx_baseu-3.0-gtk2|;' \
+ -e 's|-O3 -DNDEBUG|-DNDEBUG -D"warn_static(arg)= " -DZEN_LINUX %{optflags}|g' \
+ -e '/LINKFLAGS/s|-s|-Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld %{__global_ldflags}|g' \
+ -e '/LINKFLAGS/s|LINKLAGS\s*=\s*|&--static |;' \
+ -i %{pkgname}/Source/Makefile %{pkgname}/Source/%{prog2name}/Makefile
+
+ # old libcurl problems again, perhaps solved with http://www.city-fan.org/ftp/contrib/yum-repo/rhel7/x86_64/
+ #sed -r -e '/CURLE_WEIRD_SERVER_REPLY|CURLE_HTTP2|CURLE_NO_CONNECTION_AVAILABLE|CURLE_SSL_PINNEDPUBKEYNOTMATCH|CURLE_SSL_INVALIDCERTSTATUS|CURLE_RECURSIVE_API_CALL|CURLINFO_ACTIVESOCKET/s|^|//|;' \
+ # -i %{pkgname}/Source/fs/libcurl/curl_wrap.h
+
+ # https://stackoverflow.com/questions/52567517/freefilesync-c-error-byte-is-not-a-member-of-std
+ sed -i '1s/^/#include <cstddef>\n/' zen/serialize.h zen/ring_buffer.h
+
+ # trying to use some openssl-devel from 1.1.0 to satisfy it, from city-fan?
+ ## use openssl 1.0.2 on centos7
+ #sed -r -e '/OPENSSL_VERSION_NUMBER/s|0x[0-9]+L|0x100020beL|;' \
+ # -i FreeFileSync/Source/fs/libssh2/*.cpp
+
+%else
+# only when not el6/el7
# custom build parameters for packaging application in rpm
-%{__sed} \
- -e 's|-O3 -DNDEBUG|-DNDEBUG -D"warn_static(arg)= " -DZEN_LINUX %{build_cxxflags}|g' \
- -e '/LINKFLAGS/s|-s|%{__global_ldflags}|g' \
- -i %{pkgname}/Source/Makefile %{pkgname}/Source/%{prog2name}/Makefile
+ %{__sed} \
+ -e 's|-O3 -DNDEBUG|-DNDEBUG -D"warn_static(arg)= " -DZEN_LINUX %{build_cxxflags}|g' \
+ -e '/LINKFLAGS/s|-s|%{__global_ldflags}|g' \
+ -i %{pkgname}/Source/Makefile %{pkgname}/Source/%{prog2name}/Makefile
+%endif
%build
%if !%{dummy_package}
-%make_build -C %{pkgname}/Source
-%make_build -C %{pkgname}/Source/%{prog2name}
+ %if "%{?scl_env}" != ""
+ scl enable %{scl_env} /bin/bash << EOF
+ %endif
+ %make_build -C %{pkgname}/Source
+ # turned off while building ffs for centos 7
+ #%make_build -C %{pkgname}/Source/%{prog2name}
+ %if "%{?scl_env}" != ""
+EOF
+ %endif
%endif
%install
@@ -77,7 +129,9 @@ find . ! -type d \( -name '*.c' -o -name '*.cpp' -o -name '*.h' \) \
#%%make_install -C %%{pkgname}/Source/%%{prog2name}
pushd %{pkgname}/Build
install -d %{buildroot}%{_bindir} %{buildroot}%{_datadir}/%{name}
-install -Dm 0755 -t %{buildroot}%{_bindir} Bin/%{pkgname} Bin/%{prog2name}
+# turned off while building ffs for centos 7
+#install -Dm 0755 -t %{buildroot}%{_bindir} Bin/%{pkgname} Bin/%{prog2name}
+install -Dm 0755 -t %{buildroot}%{_bindir} Bin/%{pkgname}
cp -pr Languages %{buildroot}%{_datadir}/%{name}
install -Dm 0644 ding.wav gong.wav harp.wav Resources.zip styles.gtk_rc %{buildroot}%{_datadir}/%{name}
popd
@@ -140,7 +194,8 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%license %attr(444, -, -) License.txt
%doc %attr(444, -, -) Changelog.txt
%{_bindir}/%{pkgname}
-%{_bindir}/%{prog2name}
+# turned off while building ffs for centos 7
+#%{_bindir}/%{prog2name}
%{_datadir}/applications/*.desktop
%{_datadir}/icons/hicolor/*x*/apps/*.png
%{_datadir}/%{name}
bgstack15