Unverified Commit b33d70c8 authored by Weijia Wang's avatar Weijia Wang Committed by GitHub
Browse files

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

parents 280accc6 ab68c43c
Loading
Loading
Loading
Loading
+36 −33
Original line number Diff line number Diff line
{
  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 ];

  postPatch = ''
  # As we need the $out reference, we can't use `replaceVars` here.
  postPatch = ''
    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;
  };
}
+3 −3
Original line number Diff line number Diff line
--- 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 @@
 }