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, lib,
stdenv, stdenv,
nodejs,
pnpm_9,
fetchFromGitHub,
buildGoModule, buildGoModule,
wails, fetchFromGitHub,
webkitgtk_4_0,
pkg-config,
libsoup_3,
autoPatchelfHook, autoPatchelfHook,
makeDesktopItem,
copyDesktopItems, copyDesktopItems,
nodejs,
pkg-config,
pnpm_10,
wails,
webkitgtk_4_1,
makeDesktopItem,
nix-update-script, nix-update-script,
}: }:
let let
pname = "gui-for-singbox"; pname = "gui-for-singbox";
version = "1.9.7"; version = "1.9.8";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "GUI-for-Cores"; owner = "GUI-for-Cores";
repo = "GUI.for.SingBox"; repo = "GUI.for.SingBox";
tag = "v${version}"; tag = "v${version}";
hash = "sha256-2wmg0qPXFRuVd5jU1RT9QuqEaG/h2R+VSNeniVZELLk="; hash = "sha256-9Vai/C9cJgqM3n+FzFPXismR5vF6eQNJHdI7o47zinI=";
}; };
metaCommon = { metaCommon = {
description = "SingBox GUI program developed by vue3 + wails";
homepage = "https://github.com/GUI-for-Cores/GUI.for.SingBox"; homepage = "https://github.com/GUI-for-Cores/GUI.for.SingBox";
license = with lib.licenses; [ gpl3Plus ]; license = with lib.licenses; [ gpl3Plus ];
maintainers = with lib.maintainers; [ ]; maintainers = with lib.maintainers; [ ];
platforms = lib.platforms.linux;
}; };
frontend = stdenv.mkDerivation (finalAttrs: { frontend = stdenv.mkDerivation (finalAttrs: {
inherit pname version src; inherit pname version src;
sourceRoot = "${finalAttrs.src.name}/frontend";
nativeBuildInputs = [ nativeBuildInputs = [
nodejs nodejs
pnpm_9.configHook pnpm_10.configHook
]; ];
pnpmDeps = pnpm_9.fetchDeps { pnpmDeps = pnpm_10.fetchDeps {
inherit (finalAttrs) pname version src; inherit (finalAttrs)
sourceRoot = "${finalAttrs.src.name}/frontend"; pname
fetcherVersion = 1; version
hash = "sha256-5tz1FItH9AvZhJjka8i5Kz22yf/tEmRPkDhz6iswZzc="; src
sourceRoot
;
fetcherVersion = 2;
hash = "sha256-iVD/9uTK3cUzKE20pJk67uk53UCtfj/YCpgwgxmmg8k=";
}; };
sourceRoot = "${finalAttrs.src.name}/frontend";
buildPhase = '' buildPhase = ''
runHook preBuild runHook preBuild
@ -67,34 +68,34 @@ let
runHook postInstall runHook postInstall
''; '';
meta = metaCommon; meta = metaCommon // {
description = "GUI program developed by vue3";
platforms = lib.platforms.all;
};
}); });
in in
buildGoModule { buildGoModule {
inherit pname version src; inherit pname version src;
patches = [ ./bridge.patch ]; patches = [ ./xdg-path-and-restart-patch.patch ];
postPatch = ''
# As we need the $out reference, we can't use `replaceVars` here. # As we need the $out reference, we can't use `replaceVars` here.
postPatch = ''
substituteInPlace bridge/bridge.go \ substituteInPlace bridge/bridge.go \
--replace-fail '@basepath@' "$out" --subst-var out
''; '';
vendorHash = "sha256-Coq8GtaIS7ClmOTFw6PSgGDFW/CpGpKPvXgNw8qz3Hs="; vendorHash = "sha256-7pFjfUFkpXyYEVjiXbfFUC7FQSlZubKJJ5MI8WY0IVA=";
nativeBuildInputs = [ nativeBuildInputs = [
wails
pkg-config
autoPatchelfHook autoPatchelfHook
copyDesktopItems copyDesktopItems
pkg-config
wails
]; ];
buildInputs = [ buildInputs = [ webkitgtk_4_1 ];
webkitgtk_4_0
libsoup_3
];
preBuild = '' preBuild = ''
cp -r ${frontend} frontend/dist cp -r ${frontend} frontend/dist
@ -103,7 +104,7 @@ buildGoModule {
buildPhase = '' buildPhase = ''
runHook preBuild 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 runHook postBuild
''; '';
@ -124,7 +125,7 @@ buildGoModule {
runHook preInstall runHook preInstall
install -Dm 0755 build/bin/GUI.for.SingBox $out/bin/GUI.for.SingBox 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 runHook postInstall
''; '';
@ -140,6 +141,8 @@ buildGoModule {
}; };
meta = metaCommon // { meta = metaCommon // {
description = "SingBox GUI program developed by vue3 + wails";
mainProgram = "GUI.for.SingBox"; 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 --- a/bridge/bridge.go
+++ b/bridge/bridge.go 2025-05-13 07:39:01.667180229 +0000 +++ b/bridge/bridge.go
@@ -41,13 +41,13 @@ @@ -41,13 +41,13 @@
} }