From e9a9a60690c116e71b8df68dcda27f3043a9cd47 Mon Sep 17 00:00:00 2001 From: Aidan Gauland Date: Sun, 5 Nov 2023 09:11:33 +1300 Subject: [PATCH] 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 { };