From d380eba631b11b7bc2aebabcd1a64343040b80b6 Mon Sep 17 00:00:00 2001 From: PRESFIL Date: Thu, 1 Jan 2026 16:04:59 +0000 Subject: [PATCH] throne: 1.0.8-unstable-2025-10-29 -> 1.0.13 --- .../throne/core-also-check-capabilities.patch | 10 ++++----- .../throne/nixos-disable-setuid-request.patch | 20 +++++++++--------- pkgs/by-name/th/throne/package.nix | 21 ++++++++++++------- ...arch-for-geodata-in-install-location.patch | 13 ------------ 4 files changed, 29 insertions(+), 35 deletions(-) delete mode 100644 pkgs/by-name/th/throne/search-for-geodata-in-install-location.patch diff --git a/pkgs/by-name/th/throne/core-also-check-capabilities.patch b/pkgs/by-name/th/throne/core-also-check-capabilities.patch index 4e8312f14a38..5192ddee870f 100644 --- a/pkgs/by-name/th/throne/core-also-check-capabilities.patch +++ b/pkgs/by-name/th/throne/core-also-check-capabilities.patch @@ -3,13 +3,13 @@ index e2f2ab3..f81812f 100644 --- a/server.go +++ b/server.go @@ -16,6 +16,7 @@ import ( + "github.com/sagernet/sing-box/experimental/clashapi" E "github.com/sagernet/sing/common/exceptions" - "github.com/sagernet/sing/common/metadata" - "github.com/sagernet/sing/service" + "golang.org/x/sys/unix" - "log" - "os" - "runtime" + "github.com/sagernet/sing/service" + "github.com/throneproj/clash2singbox/convert" + "github.com/throneproj/clash2singbox/model" + "github.com/throneproj/clash2singbox/model/clash" @@ -349,12 +350,25 @@ func (s *server) CompileGeoSiteToSrs(in *gen.CompileGeoSiteToSrsRequest, out *ge } diff --git a/pkgs/by-name/th/throne/nixos-disable-setuid-request.patch b/pkgs/by-name/th/throne/nixos-disable-setuid-request.patch index 2bf3dfbc411a..9febc59f65f6 100644 --- a/pkgs/by-name/th/throne/nixos-disable-setuid-request.patch +++ b/pkgs/by-name/th/throne/nixos-disable-setuid-request.patch @@ -1,25 +1,25 @@ diff --git a/src/global/Configs.cpp b/src/global/Configs.cpp -index 7943d7a..5bb20cc 100644 +index e7bec9c..f0dfe53 100644 --- a/src/global/Configs.cpp +++ b/src/global/Configs.cpp -@@ -355,6 +355,12 @@ namespace Configs { +@@ -404,6 +404,12 @@ namespace Configs { // System Utils QString FindCoreRealPath() { + // find in PATH first -+ QString path = QStandardPaths::findExecutable("throne-core"); -+ if (!path.isEmpty()) { -+ return path; ++ QString path_for_nixos = QStandardPaths::findExecutable("throne-core"); ++ if (!path_for_nixos.isEmpty()) { ++ return path_for_nixos; + } + auto fn = QApplication::applicationDirPath() + "/Core"; - auto fi = QFileInfo(fn); - if (fi.isSymLink()) return fi.symLinkTarget(); + #ifdef Q_OS_WIN + fn += ".exe"; diff --git a/src/ui/mainwindow.cpp b/src/ui/mainwindow.cpp -index 9aa46b2..ba7137a 100644 +index d31c311..ce4c357 100644 --- a/src/ui/mainwindow.cpp +++ b/src/ui/mainwindow.cpp -@@ -125,8 +125,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi +@@ -151,8 +151,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi Configs::dataStore->core_port = MkPort(); if (Configs::dataStore->core_port <= 0) Configs::dataStore->core_port = 19810; @@ -29,7 +29,7 @@ index 9aa46b2..ba7137a 100644 QStringList args; args.push_back("-port"); -@@ -844,6 +843,15 @@ bool MainWindow::get_elevated_permissions(int reason) { +@@ -1045,6 +1044,15 @@ bool MainWindow::get_elevated_permissions(int reason) { return true; } if (Configs::IsAdmin()) return true; diff --git a/pkgs/by-name/th/throne/package.nix b/pkgs/by-name/th/throne/package.nix index ae562625411c..f9ab2d669b64 100644 --- a/pkgs/by-name/th/throne/package.nix +++ b/pkgs/by-name/th/throne/package.nix @@ -19,20 +19,23 @@ # override if you want to have more up-to-date rulesets throne-srslist ? fetchurl { - url = "https://raw.githubusercontent.com/throneproj/routeprofiles/60eb41122de3aa53c701ec948cd52d7a26adafea/srslist.h"; - hash = "sha256-k9vPtcusML4GR81UVeJ7jhuDHGk5Qh0eKw/cSOxBd5g="; + url = "https://raw.githubusercontent.com/throneproj/routeprofiles/0fca735ff2759422c407ac04fac819aef2fc88f9/srslist.h"; + hash = "sha256-G2WUStxFtN0fbZm/KoD9ldUvkMWf9cDA+9fvYt8dcqo="; }, }: stdenv.mkDerivation (finalAttrs: { pname = "throne"; - version = "1.0.8-unstable-2025-10-29"; + version = "1.0.13"; src = fetchFromGitHub { owner = "throneproj"; repo = "Throne"; - rev = "54af50fc414ffaf98b3ff88e3dd8aa041c65e041"; - hash = "sha256-kfvsGw0RUYHkOUSeSA4egLl+gQqN4KkZKXX3CQQzYks="; + # the release CI job was triggered on the xhttp branch (https://github.com/throneproj/Throne/actions/runs/20588046213), + # but the 1.0.13 tag was wrongly created on the dev branch + # we'll use the revision that was used for the job as well + rev = "3b737ec8cf29e03e4b7d5a09b1f502bdb8ef52e2"; + hash = "sha256-OVgmhiKL4BaFYBeUqIX3LRNa54zq5oYyNMUYwKNvo1A="; }; strictDeps = true; @@ -49,6 +52,8 @@ stdenv.mkDerivation (finalAttrs: { qt6Packages.qttools ]; + env.INPUT_VERSION = finalAttrs.version; + cmakeFlags = [ # makes sure the app uses the user's config directory to store it's non-static content # it's essentially the same as always setting the -appdata flag when running the program @@ -103,7 +108,7 @@ stdenv.mkDerivation (finalAttrs: { ]; proxyVendor = true; - vendorHash = "sha256-thMRkbs5fS7KsUSRSeUaB2xkTjs7kJ9AKXW0+OXN3io="; + vendorHash = "sha256-cPo/2bUXEF9jomr0Pnty7ZutAaC0TFG397FSIqefrjw="; nativeBuildInputs = [ protobuf @@ -116,13 +121,15 @@ stdenv.mkDerivation (finalAttrs: { pushd gen protoc -I . --go_out=. --protorpc_out=. libcore.proto popd + + VERSION_SINGBOX=$(go list -m -f '{{.Version}}' github.com/sagernet/sing-box) + ldflags+=("-X 'github.com/sagernet/sing-box/constant.Version=$VERSION_SINGBOX'") ''; # ldflags and tags are taken from script/build_go.sh ldflags = [ "-w" "-s" - "-X github.com/sagernet/sing-box/constant.Version=${finalAttrs.version}" ]; tags = [ diff --git a/pkgs/by-name/th/throne/search-for-geodata-in-install-location.patch b/pkgs/by-name/th/throne/search-for-geodata-in-install-location.patch deleted file mode 100644 index 91e5ad16d923..000000000000 --- a/pkgs/by-name/th/throne/search-for-geodata-in-install-location.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/src/global/Configs.cpp b/src/global/Configs.cpp -index d9be515..15de64b 100644 ---- a/src/global/Configs.cpp -+++ b/src/global/Configs.cpp -@@ -426,8 +426,6 @@ namespace Configs { - }; - - QString GetBasePath() { -- if (dataStore->flag_use_appdata) return QStandardPaths::writableLocation( -- QStandardPaths::AppConfigLocation); - return qApp->applicationDirPath(); - } -