From 53581f30bb93391bad4a6d9e1e4e6acb9bbd9c4e Mon Sep 17 00:00:00 2001 From: Nicolas Porcel Date: Wed, 17 Mar 2021 01:09:40 +0000 Subject: [PATCH] new package: FreeFileSync --- .../FreeFileSync/files/FreeFileSync.desktop | 11 +++++ .../FreeFileSync/files/RealTimeSync.desktop | 11 +++++ .../patches/allow_wxUSE_EXCEPTIONS.patch | 30 ++++++++++++ .../remove_namespace_prefix_for_gobject.patch | 13 +++++ srcpkgs/FreeFileSync/patches/use_gtk3.patch | 32 +++++++++++++ srcpkgs/FreeFileSync/template | 48 +++++++++++++++++++ 6 files changed, 145 insertions(+) create mode 100644 srcpkgs/FreeFileSync/files/FreeFileSync.desktop create mode 100644 srcpkgs/FreeFileSync/files/RealTimeSync.desktop create mode 100644 srcpkgs/FreeFileSync/patches/allow_wxUSE_EXCEPTIONS.patch create mode 100644 srcpkgs/FreeFileSync/patches/remove_namespace_prefix_for_gobject.patch create mode 100644 srcpkgs/FreeFileSync/patches/use_gtk3.patch create mode 100644 srcpkgs/FreeFileSync/template diff --git a/srcpkgs/FreeFileSync/files/FreeFileSync.desktop b/srcpkgs/FreeFileSync/files/FreeFileSync.desktop new file mode 100644 index 00000000000000..b94e4799d12316 --- /dev/null +++ b/srcpkgs/FreeFileSync/files/FreeFileSync.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Type=Application +Name=FreeFileSync +GenericName=Folder Comparison and Synchronization +GenericName[de_DE]=Ordnervergleich und Synchronisation +Exec=FreeFileSync %F +Icon=/usr/share/pixmaps/FreeFileSync.png +NoDisplay=false +Terminal=false +Categories=Utility;FileTools; +StartupNotify=true diff --git a/srcpkgs/FreeFileSync/files/RealTimeSync.desktop b/srcpkgs/FreeFileSync/files/RealTimeSync.desktop new file mode 100644 index 00000000000000..dfd533ffd88a71 --- /dev/null +++ b/srcpkgs/FreeFileSync/files/RealTimeSync.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Type=Application +Name=RealTimeSync +GenericName=Automated Synchronization +GenericName[de_DE]=Automatisierte Synchronisation +Exec=RealTimeSync %f +Icon=/usr/share/pixmaps/RealTimeSync.png +NoDisplay=false +Terminal=false +Categories=Utility;FileTools; +StartupNotify=true diff --git a/srcpkgs/FreeFileSync/patches/allow_wxUSE_EXCEPTIONS.patch b/srcpkgs/FreeFileSync/patches/allow_wxUSE_EXCEPTIONS.patch new file mode 100644 index 00000000000000..51f011d89faf00 --- /dev/null +++ b/srcpkgs/FreeFileSync/patches/allow_wxUSE_EXCEPTIONS.patch @@ -0,0 +1,30 @@ +Index: FreeFileSync-13.5/FreeFileSync/Source/RealTimeSync/application.cpp +=================================================================== +--- FreeFileSync-13.5.orig/FreeFileSync/Source/RealTimeSync/application.cpp ++++ FreeFileSync-13.5/FreeFileSync/Source/RealTimeSync/application.cpp +@@ -209,10 +209,6 @@ wxLayoutDirection Application::GetLayout + + int Application::OnRun() + { +-#if wxUSE_EXCEPTIONS +-#error why is wxWidgets uncaught exception handling enabled!? +-#endif +- + //exception => Windows: let it crash and create mini dump!!! Linux/macOS: std::exception::what() logged to console + [[maybe_unused]] const int rc = wxApp::OnRun(); + return static_cast(FfsExitCode::success); //process exit code +Index: FreeFileSync-13.5/FreeFileSync/Source/application.cpp +=================================================================== +--- FreeFileSync-13.5.orig/FreeFileSync/Source/application.cpp ++++ FreeFileSync-13.5/FreeFileSync/Source/application.cpp +@@ -243,10 +243,6 @@ wxLayoutDirection Application::GetLayout + + int Application::OnRun() + { +-#if wxUSE_EXCEPTIONS +-#error why is wxWidgets uncaught exception handling enabled!? +-#endif +- + //exception => Windows: let it crash and create mini dump!!! Linux/macOS: std::exception::what() logged to console + [[maybe_unused]] const int rc = wxApp::OnRun(); + return static_cast(exitCode_); diff --git a/srcpkgs/FreeFileSync/patches/remove_namespace_prefix_for_gobject.patch b/srcpkgs/FreeFileSync/patches/remove_namespace_prefix_for_gobject.patch new file mode 100644 index 00000000000000..a8ebacfcf8a47a --- /dev/null +++ b/srcpkgs/FreeFileSync/patches/remove_namespace_prefix_for_gobject.patch @@ -0,0 +1,13 @@ +Index: FreeFileSync-13.5/FreeFileSync/Source/base/icon_loader.cpp +=================================================================== +--- FreeFileSync-13.5.orig/FreeFileSync/Source/base/icon_loader.cpp ++++ FreeFileSync-13.5/FreeFileSync/Source/base/icon_loader.cpp +@@ -227,7 +227,7 @@ FileIconHolder fff::getFileIcon(const Zs + //the remaining icon types won't block! + assert(GDK_IS_PIXBUF(gicon) || G_IS_THEMED_ICON(gicon) || G_IS_EMBLEMED_ICON(gicon)); + +- ::g_object_ref(gicon); //pass ownership ++ g_object_ref(gicon); //pass ownership + return FileIconHolder(gicon, maxSize); // + + } diff --git a/srcpkgs/FreeFileSync/patches/use_gtk3.patch b/srcpkgs/FreeFileSync/patches/use_gtk3.patch new file mode 100644 index 00000000000000..9d622ab7133d66 --- /dev/null +++ b/srcpkgs/FreeFileSync/patches/use_gtk3.patch @@ -0,0 +1,32 @@ +Index: FreeFileSync-13.5/FreeFileSync/Source/Makefile +=================================================================== +--- FreeFileSync-13.5.orig/FreeFileSync/Source/Makefile ++++ FreeFileSync-13.5/FreeFileSync/Source/Makefile +@@ -17,9 +17,8 @@ LDFLAGS += `pkg-config --libs libcurl` + CXXFLAGS += `pkg-config --cflags libssh2` + LDFLAGS += `pkg-config --libs libssh2` + +-CXXFLAGS += `pkg-config --cflags gtk+-2.0` +-#treat as system headers so that warnings are hidden: +-CXXFLAGS += -isystem/usr/include/gtk-2.0 ++CXXFLAGS += `pkg-config --cflags gtk+-3.0` ++LDFLAGS += `pkg-config --libs gtk+-3.0` + + #support for SELinux (optional) + SELINUX_EXISTING=$(shell pkg-config --exists libselinux && echo YES) +Index: FreeFileSync-13.5/FreeFileSync/Source/RealTimeSync/Makefile +=================================================================== +--- FreeFileSync-13.5.orig/FreeFileSync/Source/RealTimeSync/Makefile ++++ FreeFileSync-13.5/FreeFileSync/Source/RealTimeSync/Makefile +@@ -8,9 +8,8 @@ CXXFLAGS += -std=c++23 -pipe -DWXINTL_NO + LDFLAGS += -s -no-pie `wx-config --libs std, aui, richtext --debug=no` -pthread + + #Gtk - support "no button border" +-CXXFLAGS += `pkg-config --cflags gtk+-2.0` +-#treat as system headers so that warnings are hidden: +-CXXFLAGS += -isystem/usr/include/gtk-2.0 ++CXXFLAGS += `pkg-config --cflags gtk+-3.0` ++LDFLAGS += `pkg-config --libs gtk+-3.0` + + cppFiles= + cppFiles+=application.cpp diff --git a/srcpkgs/FreeFileSync/template b/srcpkgs/FreeFileSync/template new file mode 100644 index 00000000000000..c8865f1c8f8055 --- /dev/null +++ b/srcpkgs/FreeFileSync/template @@ -0,0 +1,48 @@ +# Template file for 'FreeFileSync' +pkgname=FreeFileSync +version=13.5 +revision=1 +archs="i686 x86_64" +create_wrksrc=yes +build_style=gnu-makefile +hostmakedepends="unzip wget" +makedepends="pkg-config libglib-devel wxWidgets-gtk3-devel libcurl-devel openssl-devel libssh2-devel" +depends="wxWidgets-gtk3 libcurl libssh2 openssl" +short_desc="Backup software to synchronize files and folders" +maintainer="Nicolas Porcel " +license="GPL-3.0-or-later" +homepage="https://freefilesync.org" +distfiles="${homepage}/download/${pkgname}_${version}_Source.zip" +checksum=@264c9ce29cdbce601707b4514661e0c2c5fe45b67185f9ba0599a95c7c6fab92 +fetch_cmd="wget" + +CXXFLAGS="-DMAX_SFTP_READ_SIZE=30000 -DMAX_SFTP_OUTGOING_SIZE=30000" + +nopie_files="/opt/${pkgname}/Bin/FreeFileSync /opt/${pkgname}/Bin/RealTimeSync" + +post_patch() { + sed -i 's/wx-config/wx-config-gtk3/' FreeFileSync/Source/{,RealTimeSync/}Makefile +} + +do_build() { + make ${makejobs} exeName=FreeFileSync -C FreeFileSync/Source + make ${makejobs} exeName=RealTimeSync -C FreeFileSync/Source/RealTimeSync + unzip FreeFileSync/Build/Resources/Icons.zip FreeFileSync.png RealTimeSync.png -d FreeFileSync/Build +} + +do_install() { + vmkdir opt/${pkgname} + vcopy FreeFileSync/Build/Bin opt/${pkgname} + vcopy FreeFileSync/Build/Resources opt/${pkgname} + + vmkdir usr/share/pixmaps + vinstall FreeFileSync/Build/FreeFileSync.png 0644 usr/share/pixmaps + vinstall FreeFileSync/Build/RealTimeSync.png 0644 usr/share/pixmaps + + vmkdir usr/share/applications + vinstall ${FILESDIR}/FreeFileSync.desktop 0644 usr/share/applications + vinstall ${FILESDIR}/RealTimeSync.desktop 0644 usr/share/applications + + vmkdir usr/bin + ln -s /opt/FreeFileSync/Bin/{FreeFileSync,RealTimeSync} ${DESTDIR}/usr/bin +}