From c634b3c4a26f374ffd1a0bb2ddb44c12d744142e Mon Sep 17 00:00:00 2001 From: kyehn <228304369+kyehn@users.noreply.github.com> Date: Thu, 26 Mar 2026 18:55:47 +0800 Subject: [PATCH] gui-for-clash: 1.18.0 -> 1.21.1 --- pkgs/by-name/gu/gui-for-clash/package.nix | 10 ++++----- .../xdg-path-and-restart-patch.patch | 22 ++----------------- 2 files changed, 7 insertions(+), 25 deletions(-) diff --git a/pkgs/by-name/gu/gui-for-clash/package.nix b/pkgs/by-name/gu/gui-for-clash/package.nix index dcad0681a444..c70cabde976a 100644 --- a/pkgs/by-name/gu/gui-for-clash/package.nix +++ b/pkgs/by-name/gu/gui-for-clash/package.nix @@ -18,13 +18,13 @@ let pname = "gui-for-clash"; - version = "1.18.0"; + version = "1.21.1"; src = fetchFromGitHub { owner = "GUI-for-Cores"; repo = "GUI.for.Clash"; tag = "v${version}"; - hash = "sha256-M5M3o7RIXszMW2KGv2UDyR002dNOL3FFj0zM4w4D+U0="; + hash = "sha256-eIJYtXa0JdP7hLvBRnWyh0KkdMWvOd2GRXPaqCvP8yE="; }; metaCommon = { @@ -53,8 +53,8 @@ let sourceRoot ; pnpm = pnpm_10; - fetcherVersion = 2; - hash = "sha256-AHGPAYw/6FRKO2FY1J84NrLcp+bZOclOF6UFY61npFI="; + fetcherVersion = 3; + hash = "sha256-gr6XIhLKWSOJ4LWiliOvMoA9QbPiohrCPmvObz49/pw="; }; buildPhase = '' @@ -84,7 +84,7 @@ buildGoModule { patches = [ ./xdg-path-and-restart-patch.patch ]; - vendorHash = "sha256-xQ6TeVoBe8906+/5X1q4e5QHVo+KHymB+yoxM+Obk18="; + vendorHash = "sha256-EeIxt0BzSaZh1F38btUXN9kAvj12nlqEerVgWVGkiuk="; nativeBuildInputs = [ autoPatchelfHook diff --git a/pkgs/by-name/gu/gui-for-clash/xdg-path-and-restart-patch.patch b/pkgs/by-name/gu/gui-for-clash/xdg-path-and-restart-patch.patch index 0d2c56ff5e9d..b5d9ed7175c1 100644 --- a/pkgs/by-name/gu/gui-for-clash/xdg-path-and-restart-patch.patch +++ b/pkgs/by-name/gu/gui-for-clash/xdg-path-and-restart-patch.patch @@ -1,27 +1,9 @@ --- a/bridge/bridge.go +++ b/bridge/bridge.go -@@ -55,9 +55,14 @@ - - app := NewApp() - -- if Env.OS == "darwin" { -- createMacOSSymlink() -- createMacOSMenus(app) -+ if Env.OS == "linux" || Env.OS == "darwin" { -+ userConfigDir, err := os.UserConfigDir() -+ if err == nil { -+ targetPath := filepath.Join(userConfigDir, Env.AppName) -+ if err := os.MkdirAll(targetPath, 0755); err == nil { -+ Env.BasePath = targetPath -+ } -+ } - } - - if Env.OS == "windows" { -@@ -80,7 +85,10 @@ - } +@@ -93,7 +93,10 @@ func (a *App) RestartApp() FlagResult { + log.Printf("RestartApp") - exePath := Env.BasePath + "/" + Env.AppName + exePath, err := os.Executable() + if err != nil {