From 0a6d780f76af3a06f1f70fc9b512a790bfb0b583 Mon Sep 17 00:00:00 2001 From: qzylinra Date: Mon, 11 Aug 2025 10:10:50 +0800 Subject: [PATCH] gui-for-clash: 1.9.7 -> 1.9.8 --- pkgs/by-name/gu/gui-for-clash/package.nix | 60 +++++++++---------- ...patch => xdg-path-and-restart-patch.patch} | 8 +-- 2 files changed, 34 insertions(+), 34 deletions(-) rename pkgs/by-name/gu/gui-for-clash/{bridge.patch => xdg-path-and-restart-patch.patch} (77%) diff --git a/pkgs/by-name/gu/gui-for-clash/package.nix b/pkgs/by-name/gu/gui-for-clash/package.nix index a62b2a436281..ffa7591ef6d5 100644 --- a/pkgs/by-name/gu/gui-for-clash/package.nix +++ b/pkgs/by-name/gu/gui-for-clash/package.nix @@ -1,29 +1,28 @@ { lib, stdenv, - nodejs, - pnpm_9, - fetchFromGitHub, buildGoModule, - wails, - webkitgtk_4_0, - pkg-config, - libsoup_3, + fetchFromGitHub, autoPatchelfHook, - makeDesktopItem, copyDesktopItems, + nodejs, + pkg-config, + pnpm_10, + wails, + webkitgtk_4_1, + makeDesktopItem, nix-update-script, }: let pname = "gui-for-clash"; - version = "1.9.7"; + version = "1.9.8"; src = fetchFromGitHub { owner = "GUI-for-Cores"; repo = "GUI.for.Clash"; tag = "v${version}"; - hash = "sha256-Ij9zyBzYpAfDEjJXqOiPxun+5e1T5j3juYudpvraBcQ="; + hash = "sha256-YwolOIN4pQ9ykXruKAetUDMFkNnQppkzioDNlrPefL8="; }; metaCommon = { @@ -35,20 +34,24 @@ let frontend = stdenv.mkDerivation (finalAttrs: { inherit pname version src; + sourceRoot = "${finalAttrs.src.name}/frontend"; + nativeBuildInputs = [ nodejs - pnpm_9.configHook + pnpm_10.configHook ]; - pnpmDeps = pnpm_9.fetchDeps { - inherit (finalAttrs) pname version src; - sourceRoot = "${finalAttrs.src.name}/frontend"; - fetcherVersion = 1; - hash = "sha256-5tz1FItH9AvZhJjka8i5Kz22yf/tEmRPkDhz6iswZzc="; + pnpmDeps = pnpm_10.fetchDeps { + inherit (finalAttrs) + pname + version + src + sourceRoot + ; + fetcherVersion = 2; + hash = "sha256-iVD/9uTK3cUzKE20pJk67uk53UCtfj/YCpgwgxmmg8k="; }; - sourceRoot = "${finalAttrs.src.name}/frontend"; - buildPhase = '' runHook preBuild @@ -74,27 +77,24 @@ in buildGoModule { inherit pname version src; - patches = [ ./bridge.patch ]; + patches = [ ./xdg-path-and-restart-patch.patch ]; + # As we need the $out reference, we can't use `replaceVars` here. postPatch = '' - # As we need the $out reference, we can't use `replaceVars` here. substituteInPlace bridge/bridge.go \ - --replace-fail '@basepath@' "$out" + --subst-var out ''; - vendorHash = "sha256-Coq8GtaIS7ClmOTFw6PSgGDFW/CpGpKPvXgNw8qz3Hs="; + vendorHash = "sha256-7pFjfUFkpXyYEVjiXbfFUC7FQSlZubKJJ5MI8WY0IVA="; nativeBuildInputs = [ - wails - pkg-config autoPatchelfHook copyDesktopItems + pkg-config + wails ]; - buildInputs = [ - webkitgtk_4_0 - libsoup_3 - ]; + buildInputs = [ webkitgtk_4_1 ]; preBuild = '' cp -r ${frontend} frontend/dist @@ -103,7 +103,7 @@ buildGoModule { buildPhase = '' runHook preBuild - wails build -m -s -trimpath -skipbindings -devtools -tags webkit2_40 -o GUI.for.Clash + wails build -m -s -trimpath -skipbindings -devtools -tags webkit2_41 -o GUI.for.Clash runHook postBuild ''; @@ -124,7 +124,7 @@ buildGoModule { runHook preInstall install -Dm 0755 build/bin/GUI.for.Clash $out/bin/GUI.for.Clash - install -Dm 0644 build/appicon.png $out/share/pixmaps/gui-for-clash.png + install -Dm 0644 build/appicon.png $out/share/icons/hicolor/256x256/apps/gui-for-clash.png runHook postInstall ''; diff --git a/pkgs/by-name/gu/gui-for-clash/bridge.patch b/pkgs/by-name/gu/gui-for-clash/xdg-path-and-restart-patch.patch similarity index 77% rename from pkgs/by-name/gu/gui-for-clash/bridge.patch rename to pkgs/by-name/gu/gui-for-clash/xdg-path-and-restart-patch.patch index 47ca878a594f..bc37666aaf5c 100644 --- a/pkgs/by-name/gu/gui-for-clash/bridge.patch +++ b/pkgs/by-name/gu/gui-for-clash/xdg-path-and-restart-patch.patch @@ -1,5 +1,5 @@ ---- a/bridge/bridge.go 2024-12-25 20:53:45.504021585 +0000 -+++ b/bridge/bridge.go 2024-12-25 21:02:20.318422528 +0000 +--- a/bridge/bridge.go ++++ b/bridge/bridge.go @@ -41,13 +41,13 @@ } @@ -25,7 +25,7 @@ func (a *App) RestartApp() FlagResult { - exePath := Env.BasePath + "/" + Env.AppName -+ exePath := "@basepath@/bin" + "/" + Env.AppName ++ exePath := "@out@/bin" + "/" + Env.AppName cmd := exec.Command(exePath) - SetCmdWindowHidden(cmd) \ No newline at end of file + SetCmdWindowHidden(cmd)