From fb3a809479bed991e35fc4a05d932d261e9434de Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Sat, 1 Feb 2025 18:15:40 +0100 Subject: [PATCH] freefilesync: 13.9 -> 14.0 --- pkgs/by-name/fr/freefilesync/package.nix | 28 +++++++++-- .../by-name/fr/freefilesync/wxcolorhook.patch | 50 +++++++++++++++++++ 2 files changed, 75 insertions(+), 3 deletions(-) create mode 100644 pkgs/by-name/fr/freefilesync/wxcolorhook.patch diff --git a/pkgs/by-name/fr/freefilesync/package.nix b/pkgs/by-name/fr/freefilesync/package.nix index 0eb7a56ce9ea..d44beae80ccc 100644 --- a/pkgs/by-name/fr/freefilesync/package.nix +++ b/pkgs/by-name/fr/freefilesync/package.nix @@ -4,6 +4,7 @@ fetchurl, fetchpatch, fetchDebianPatch, + fetchFromGitHub, copyDesktopItems, pkg-config, wrapGAppsHook3, @@ -17,9 +18,30 @@ makeDesktopItem, }: +let + wxwidgets_3_3 = wxGTK32.overrideAttrs ( + finalAttrs: previousAttrs: { + version = "3.3.0-unstable-2025-02-02"; + src = fetchFromGitHub { + owner = "wxWidgets"; + repo = "wxWidgets"; + rev = "969c5a46b5c1da57836f721a4ce5df9feaa437f9"; + fetchSubmodules = true; + hash = "sha256-ODPE896xc5RxdyfIzdPB5fsTeBm3O+asYJd99fuW6AY="; + }; + patches = [ + ./wxcolorhook.patch + ]; + configureFlags = lib.subtractLists [ + "--disable-compat28" + "--enable-unicode" + ] previousAttrs.configureFlags; + } + ); +in stdenv.mkDerivation (finalAttrs: { pname = "freefilesync"; - version = "13.9"; + version = "14.0"; src = fetchurl { url = "https://freefilesync.org/download/FreeFileSync_${finalAttrs.version}_Source.zip"; @@ -28,7 +50,7 @@ stdenv.mkDerivation (finalAttrs: { rm -f $out tryDownload "$url" ''; - hash = "sha256-53UPGg02JZr15r99ntkpZKqB/DgPjkGTQyuMt703t6s="; + hash = "sha256-qxt6fpJT0jKcSYJ+WVneks6PI18/wwSc5H84qICegag="; }; sourceRoot = "."; @@ -72,7 +94,7 @@ stdenv.mkDerivation (finalAttrs: { gtk3 libssh2 openssl - wxGTK32 + wxwidgets_3_3 ]; env.NIX_CFLAGS_COMPILE = toString [ diff --git a/pkgs/by-name/fr/freefilesync/wxcolorhook.patch b/pkgs/by-name/fr/freefilesync/wxcolorhook.patch new file mode 100644 index 000000000000..9c93bf1209cb --- /dev/null +++ b/pkgs/by-name/fr/freefilesync/wxcolorhook.patch @@ -0,0 +1,50 @@ +diff --git a/include/wx/settings.h b/include/wx/settings.h +index 3967b98b46..8d7f3d2870 100644 +--- a/include/wx/settings.h ++++ b/include/wx/settings.h +@@ -13,6 +13,8 @@ + #include "wx/colour.h" + #include "wx/font.h" + ++#include ++ + class WXDLLIMPEXP_FWD_CORE wxWindow; + + // possible values for wxSystemSettings::GetFont() parameter +@@ -241,9 +243,28 @@ public: + // include the declaration of the real platform-dependent class + // ---------------------------------------------------------------------------- + ++struct wxColorHook ++{ ++ virtual ~wxColorHook() {} ++ virtual wxColor getColor(wxSystemColour index) const = 0; ++}; ++WXDLLIMPEXP_CORE inline std::unique_ptr& refGlobalColorHook() ++{ ++ static std::unique_ptr globalColorHook; ++ return globalColorHook; ++} ++ + class WXDLLIMPEXP_CORE wxSystemSettings : public wxSystemSettingsNative + { + public: ++ static wxColour GetColour(wxSystemColour index) ++ { ++ if (refGlobalColorHook()) ++ return refGlobalColorHook()->getColor(index); ++ ++ return wxSystemSettingsNative::GetColour(index); ++ } ++ + #ifdef __WXUNIVERSAL__ + // in wxUniversal we want to use the theme standard colours instead of the + // system ones, otherwise wxSystemSettings is just the same as +@@ -264,7 +285,6 @@ public: + + // Value + static wxSystemScreenType ms_screen; +- + }; + + #endif