gui-for-singbox: 1.9.7 -> 1.9.8 (#432671)

This commit is contained in:
Weijia Wang 2025-08-14 23:42:38 +08:00 committed by GitHub
commit b33d70c81b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 39 additions and 36 deletions

View File

@ -1,56 +1,57 @@
{
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-singbox";
version = "1.9.7";
version = "1.9.8";
src = fetchFromGitHub {
owner = "GUI-for-Cores";
repo = "GUI.for.SingBox";
tag = "v${version}";
hash = "sha256-2wmg0qPXFRuVd5jU1RT9QuqEaG/h2R+VSNeniVZELLk=";
hash = "sha256-9Vai/C9cJgqM3n+FzFPXismR5vF6eQNJHdI7o47zinI=";
};
metaCommon = {
description = "SingBox GUI program developed by vue3 + wails";
homepage = "https://github.com/GUI-for-Cores/GUI.for.SingBox";
license = with lib.licenses; [ gpl3Plus ];
maintainers = with lib.maintainers; [ ];
platforms = lib.platforms.linux;
};
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
@ -67,34 +68,34 @@ let
runHook postInstall
'';
meta = metaCommon;
meta = metaCommon // {
description = "GUI program developed by vue3";
platforms = lib.platforms.all;
};
});
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 +104,7 @@ buildGoModule {
buildPhase = ''
runHook preBuild
wails build -m -s -trimpath -skipbindings -devtools -tags webkit2_40 -o GUI.for.SingBox
wails build -m -s -trimpath -skipbindings -devtools -tags webkit2_41 -o GUI.for.SingBox
runHook postBuild
'';
@ -124,7 +125,7 @@ buildGoModule {
runHook preInstall
install -Dm 0755 build/bin/GUI.for.SingBox $out/bin/GUI.for.SingBox
install -Dm 0644 build/appicon.png $out/share/pixmaps/gui-for-singbox.png
install -Dm 0644 build/appicon.png $out/share/icons/hicolor/256x256/apps/gui-for-singbox.png
runHook postInstall
'';
@ -140,6 +141,8 @@ buildGoModule {
};
meta = metaCommon // {
description = "SingBox GUI program developed by vue3 + wails";
mainProgram = "GUI.for.SingBox";
platforms = lib.platforms.linux;
};
}

View File

@ -1,5 +1,5 @@
--- a/bridge/bridge.go 2025-05-13 07:36:58.578038227 +0000
+++ b/bridge/bridge.go 2025-05-13 07:39:01.667180229 +0000
--- a/bridge/bridge.go
+++ b/bridge/bridge.go
@@ -41,13 +41,13 @@
}
@ -28,4 +28,4 @@
+ exePath := "@basepath@/bin" + "/" + Env.AppName
cmd := exec.Command(exePath)
SetCmdWindowHidden(cmd)
SetCmdWindowHidden(cmd)