From 2513ca1dbc3127fd66252d396308921e73f1725c Mon Sep 17 00:00:00 2001 From: Aidan Gauland Date: Sun, 5 Nov 2023 08:56:09 +1300 Subject: [PATCH 1/5] heroic: add unzip to FHS env Fixes #262299. --- pkgs/games/heroic/fhsenv.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/games/heroic/fhsenv.nix b/pkgs/games/heroic/fhsenv.nix index 19b44b280f85..3bf6e9301f28 100644 --- a/pkgs/games/heroic/fhsenv.nix +++ b/pkgs/games/heroic/fhsenv.nix @@ -29,6 +29,7 @@ buildFHSEnv { perl psmisc python3 + unzip which xorg.xrandr zstd From 029da501017ebd0c3902ec8fc8758b20e81788a1 Mon Sep 17 00:00:00 2001 From: Aidan Gauland Date: Sun, 5 Nov 2023 09:14:37 +1300 Subject: [PATCH 2/5] nile: 1.0.0 -> unstable-2023-10-03 Upstream isn't putting out releases, so we need to track the main branch. --- pkgs/games/nile/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/games/nile/default.nix b/pkgs/games/nile/default.nix index beb444ae11ec..e3bf056fc3cf 100644 --- a/pkgs/games/nile/default.nix +++ b/pkgs/games/nile/default.nix @@ -15,14 +15,14 @@ buildPythonApplication rec { pname = "nile"; - version = "1.0.0"; + version = "unstable-2023-10-03"; format = "pyproject"; src = fetchFromGitHub { owner = "imLinguin"; repo = "nile"; - rev = "f5f3b96f6483c59cfc646afbda6e97cb0bd94778"; - hash = "sha256-HibY3U9/MibEDwHY+YiErW/pz6qwtps8wwjhznTISgA="; + rev = "8f7ab2650fc730efc8960b5fcd71421d724a4108"; + hash = "sha256-Vhjp9JX8VX0PWsvEh5eOhz7vsIEaiCyPNPOjibE8GXo="; }; disabled = pythonOlder "3.8"; From e9a9a60690c116e71b8df68dcda27f3043a9cd47 Mon Sep 17 00:00:00 2001 From: Aidan Gauland Date: Sun, 5 Nov 2023 09:11:33 +1300 Subject: [PATCH 3/5] heroic: 2.9.2 -> 2.10.0 Fixes #264156. --- pkgs/games/heroic/default.nix | 13 +++++++++--- pkgs/games/heroic/remove-drm-support.patch | 24 +++++++++++++--------- pkgs/top-level/all-packages.nix | 2 +- 3 files changed, 25 insertions(+), 14 deletions(-) diff --git a/pkgs/games/heroic/default.nix b/pkgs/games/heroic/default.nix index eca086020709..079ec4976604 100644 --- a/pkgs/games/heroic/default.nix +++ b/pkgs/games/heroic/default.nix @@ -17,18 +17,18 @@ let appName = "heroic"; in stdenv.mkDerivation rec { pname = "heroic-unwrapped"; - version = "2.9.2"; + version = "2.10.0"; src = fetchFromGitHub { owner = "Heroic-Games-Launcher"; repo = "HeroicGamesLauncher"; rev = "v${version}"; - hash = "sha256-kCvMUhN1kjGb5rV+lkKm1FFYBJUSQGOKTY1DQdiAWLU="; + hash = "sha256-umPQIxwIahjbO4QbkKEoeSSeYT2UatsTGRPrLgw5KW8="; }; offlineCache = fetchYarnDeps { yarnLock = "${src}/yarn.lock"; - hash = "sha256-kHZL7TENVK58dvr8PBFtWYZ2PSKEYESX4e1xYmMA5+Y="; + hash = "sha256-o5ztk4okH21Op1jqHZfranR12M8B1Y/K95aWb10tf5o="; }; nativeBuildInputs = [ @@ -47,6 +47,13 @@ in stdenv.mkDerivation rec { ./fix-non-steam-shortcuts.patch ]; + postPatch = '' + # We are not packaging this as an Electron application bundle, so Electron + # reports to the application that is is not "packaged", which causes Heroic + # to take some incorrect codepaths meant for development environments. + substituteInPlace src/**/*.ts --replace 'app.isPackaged' 'true' + ''; + configurePhase = '' runHook preConfigure diff --git a/pkgs/games/heroic/remove-drm-support.patch b/pkgs/games/heroic/remove-drm-support.patch index f3cd80f003f3..44045bef2bf6 100644 --- a/pkgs/games/heroic/remove-drm-support.patch +++ b/pkgs/games/heroic/remove-drm-support.patch @@ -1,22 +1,26 @@ diff --git a/src/backend/main.ts b/src/backend/main.ts -index 2cd1a28f..a60e04d0 100644 +index 83b58bb2..f61656fa 100644 --- a/src/backend/main.ts +++ b/src/backend/main.ts -@@ -19,8 +19,7 @@ import { - powerSaveBlocker, +@@ -19,7 +19,6 @@ import { protocol, screen, -- clipboard, -- components -+ clipboard + clipboard, +- components, + session } from 'electron' import 'backend/updater' - import { autoUpdater } from 'electron-updater' -@@ -286,8 +285,7 @@ if (!gotTheLock) { - initImagesCache() +@@ -310,14 +309,7 @@ if (!gotTheLock) { + } if (!process.env.CI) { -- await components.whenReady() +- await components.whenReady().catch((e) => { +- logError([ +- 'Failed to download / update DRM components.', +- 'Make sure you do not block update.googleapis.com domain if you want to use WideVine in Browser sideloaded apps', +- e +- ]) +- }) - logInfo(['DRM module staus', components.status()]) + logInfo('DRM modules disabled for nixpkgs') } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 53d021424469..c47e39c68d72 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -37341,7 +37341,7 @@ with pkgs; heroic-unwrapped = callPackage ../games/heroic { # Match the version used by the upstream package. - electron = electron_24; + electron = electron_27; }; heroic = callPackage ../games/heroic/fhsenv.nix { }; From c240d63ceda632c22ea6787ab771f4e798c22a54 Mon Sep 17 00:00:00 2001 From: K900 Date: Sun, 5 Nov 2023 22:28:39 +0300 Subject: [PATCH 4/5] heroic: fix infinite loop when starting some games --- pkgs/games/heroic/default.nix | 3 +++ pkgs/games/heroic/fix-infinite-loop.patch | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 pkgs/games/heroic/fix-infinite-loop.patch diff --git a/pkgs/games/heroic/default.nix b/pkgs/games/heroic/default.nix index 079ec4976604..65ff3b90403f 100644 --- a/pkgs/games/heroic/default.nix +++ b/pkgs/games/heroic/default.nix @@ -45,6 +45,9 @@ in stdenv.mkDerivation rec { ./remove-drm-support.patch # Make Heroic create Steam shortcuts (to non-steam games) with the correct path to heroic. ./fix-non-steam-shortcuts.patch + # Fix reg add infinite loop + # Submitted upstream: https://github.com/Heroic-Games-Launcher/HeroicGamesLauncher/pull/3210 + ./fix-infinite-loop.patch ]; postPatch = '' diff --git a/pkgs/games/heroic/fix-infinite-loop.patch b/pkgs/games/heroic/fix-infinite-loop.patch new file mode 100644 index 000000000000..99aae02c3a1a --- /dev/null +++ b/pkgs/games/heroic/fix-infinite-loop.patch @@ -0,0 +1,23 @@ +From b698779053b7ba31bd8e69b230e86515e3019bf6 Mon Sep 17 00:00:00 2001 +From: K900 +Date: Sun, 5 Nov 2023 22:04:32 +0300 +Subject: [PATCH] Force add the registry entry + +Otherwise, newer Wine versions will prompt to overwrite it and loop there forever. +--- + src/backend/storeManagers/legendary/setup.ts | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/backend/storeManagers/legendary/setup.ts b/src/backend/storeManagers/legendary/setup.ts +index 1837106621..b5c2432435 100644 +--- a/src/backend/storeManagers/legendary/setup.ts ++++ b/src/backend/storeManagers/legendary/setup.ts +@@ -20,7 +20,7 @@ export const legendarySetup = async (appName: string) => { + + // Fixes games like Fallout New Vegas and Dishonored: Death of the Outsider + await runWineCommandOnGame(appName, { +- commandParts: ['reg', 'add', 'HKEY_CLASSES_ROOT\\com.epicgames.launcher'], ++ commandParts: ['reg', 'add', 'HKEY_CLASSES_ROOT\\com.epicgames.launcher', '/f'], + wait: true, + protonVerb: 'waitforexitandrun' + }) From 127a01401bcb39b4a906feedb186116d71e7b1d9 Mon Sep 17 00:00:00 2001 From: K900 Date: Sun, 5 Nov 2023 22:27:16 +0300 Subject: [PATCH 5/5] legendary-gl: 0.20.33 -> unstable-2023-10-14 Required for latest Heroic to work properly. --- pkgs/games/legendary-gl/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/games/legendary-gl/default.nix b/pkgs/games/legendary-gl/default.nix index 569148f2cf50..5fce31eaa837 100644 --- a/pkgs/games/legendary-gl/default.nix +++ b/pkgs/games/legendary-gl/default.nix @@ -9,13 +9,13 @@ buildPythonApplication rec { pname = "legendary-gl"; # Name in pypi - version = "0.20.33"; + version = "unstable-2023-10-14"; src = fetchFromGitHub { owner = "derrod"; repo = "legendary"; - rev = "refs/tags/${version}"; - sha256 = "sha256-fEQUChkxrKV2IkFGORUolZE2qTzA10Xxogjl5Va4TcE="; + rev = "450784283dd49152dda6322db2fb2ef33e7c382e"; + sha256 = "sha256-iwIaxD35tkOX6NX1SVNmN2OQACwaX/C4xnfgT5YcUvg="; }; propagatedBuildInputs = [