From 3d6298f1db7948a292932ab363fea0d65ccbe16a Mon Sep 17 00:00:00 2001 From: ilys <185637611+ilyist@users.noreply.github.com> Date: Fri, 14 Mar 2025 22:19:26 +0100 Subject: [PATCH] moonlight: 1.3.9 -> 1.3.12; moonlight: improved stuff and fixed updating --- .../mo/moonlight/disable_updates.patch | 78 +++++++++++++++++++ pkgs/by-name/mo/moonlight/package.nix | 31 +++++--- 2 files changed, 100 insertions(+), 9 deletions(-) create mode 100644 pkgs/by-name/mo/moonlight/disable_updates.patch diff --git a/pkgs/by-name/mo/moonlight/disable_updates.patch b/pkgs/by-name/mo/moonlight/disable_updates.patch new file mode 100644 index 000000000000..10a76daad274 --- /dev/null +++ b/pkgs/by-name/mo/moonlight/disable_updates.patch @@ -0,0 +1,78 @@ +diff --git a/packages/core-extensions/src/moonbase/host.ts b/packages/core-extensions/src/moonbase/host.ts +index 8903f41..e5c8709 100644 +--- a/packages/core-extensions/src/moonbase/host.ts ++++ b/packages/core-extensions/src/moonbase/host.ts +@@ -79,22 +79,9 @@ electron.app.whenReady().then(() => { + + if (!entries.find((e) => e.label === "moonlight")) { + const options: Electron.MenuItemConstructorOptions[] = [ +- { label: "Update and restart", click: updateAndRestart }, + { label: "Reset config", click: resetConfig } + ]; + +- if (moonlightHost.branch !== MoonlightBranch.DEV) { +- options.push({ +- label: "Switch branch", +- submenu: [MoonlightBranch.STABLE, MoonlightBranch.NIGHTLY].map((branch) => ({ +- label: branch, +- type: "radio", +- checked: moonlightHost.branch === branch, +- click: () => changeBranch(branch) +- })) +- }); +- } +- + options.push({ label: "About", click: showAbout }); + + entries.splice(i + 1, 0, { +diff --git a/packages/core-extensions/src/moonbase/native.ts b/packages/core-extensions/src/moonbase/native.ts +index c6e068f..0adc765 100644 +--- a/packages/core-extensions/src/moonbase/native.ts ++++ b/packages/core-extensions/src/moonbase/native.ts +@@ -39,24 +39,7 @@ export default function getNatives(): MoonbaseNatives { + + return { + async checkForMoonlightUpdate() { +- try { +- if (moonlightGlobal.branch === MoonlightBranch.STABLE) { +- const json = await getStableRelease(); +- return json.name !== moonlightGlobal.version ? json.name : null; +- } else if (moonlightGlobal.branch === MoonlightBranch.NIGHTLY) { +- const req = await fetch(nightlyRefUrl, { +- cache: "no-store", +- headers: sharedHeaders +- }); +- const ref = (await req.text()).split("\n")[0]; +- return ref !== moonlightGlobal.version ? ref : null; +- } +- +- return null; +- } catch (e) { +- logger.error("Error checking for moonlight update", e); +- return null; +- } ++ return null; + }, + + async updateMoonlight(overrideBranch?: MoonlightBranch) { +diff --git a/packages/core-extensions/src/moonbase/webpackModules/ui/config/index.tsx b/packages/core-extensions/src/moonbase/webpackModules/ui/config/index.tsx +index 302c610..2db7ecd 100644 +--- a/packages/core-extensions/src/moonbase/webpackModules/ui/config/index.tsx ++++ b/packages/core-extensions/src/moonbase/webpackModules/ui/config/index.tsx +@@ -108,16 +108,6 @@ function ArrayFormItem({ config }: { config: "repositories" | "devSearchPaths" } + export default function ConfigPage() { + return ( + <> +- ("moonbase", "updateChecking", true) ?? true} +- onChange={(value: boolean) => { +- MoonbaseSettingsStore.setExtensionConfig("moonbase", "updateChecking", value); +- }} +- note="Checks for updates to moonlight" +- > +- Automatic update checking +- + + A list of remote repositories to display extensions from + diff --git a/pkgs/by-name/mo/moonlight/package.nix b/pkgs/by-name/mo/moonlight/package.nix index 1a08a488d80d..290b5baba453 100644 --- a/pkgs/by-name/mo/moonlight/package.nix +++ b/pkgs/by-name/mo/moonlight/package.nix @@ -1,34 +1,46 @@ { lib, stdenv, - nodejs, - pnpm_9, + pnpm_10, + nodejs_22, fetchFromGitHub, nix-update-script, }: stdenv.mkDerivation (finalAttrs: { pname = "moonlight"; - version = "1.3.9"; + version = "1.3.14"; src = fetchFromGitHub { owner = "moonlight-mod"; repo = "moonlight"; tag = "v${finalAttrs.version}"; - hash = "sha256-WhPQ7JYfE8RBhDknBunKdW1VBxrklb3UGnMgk5LFVFA="; + hash = "sha256-FmQS8DqjgOyfEth8tpUlJoduo6rAv28PwLGv90J3rcM="; }; nativeBuildInputs = [ - nodejs - pnpm_9.configHook + nodejs_22 + pnpm_10.configHook ]; - pnpmDeps = pnpm_9.fetchDeps { + pnpmDeps = pnpm_10.fetchDeps { inherit (finalAttrs) pname version src; - hash = "sha256-KZFHcW/OVjTDXZltxPYGuO+NWjuD5o6HE/E9JQZmrG8="; + buildInputs = [ nodejs_22 ]; + + hash = "sha256-I+zRCUqJabpGJRFBGW0NrM9xzyzeCjioF54zlCpynBU="; }; + env = { + NODE_ENV = "production"; + MOONLIGHT_BRANCH = "stable"; + MOONLIGHT_VERSION = "v${finalAttrs.version}"; + }; + + patches = [ + ./disable_updates.patch + ]; + buildPhase = '' runHook preBuild @@ -55,7 +67,8 @@ stdenv.mkDerivation (finalAttrs: { All core code is original or used with permission from their respective authors where not copyleft. ''; homepage = "https://moonlight-mod.github.io"; - changelog = "https://github.com/moonlight-mod/moonlight/blob/main/CHANGELOG.md"; + downloadPage = "https://moonlight-mod.github.io/using/install/#nix"; + changelog = "https://raw.githubusercontent.com/moonlight-mod/moonlight/refs/tags/v${finalAttrs.version}/CHANGELOG.md"; license = licenses.lgpl3; maintainers = with maintainers; [