From 80701428e9e7819c5dc3cb2be40afc670386e769 Mon Sep 17 00:00:00 2001 From: Aidan Gauland Date: Tue, 1 Aug 2023 16:31:19 +1200 Subject: [PATCH] heroic: patch out DRM support DRM support added in 2.9.0 prevent Heroic from running at all under mainline Electron, instead requiring running against a non-free fork with DRM support compiled in. --- pkgs/games/heroic/default.nix | 6 ++++++ pkgs/games/heroic/remove-drm-support.patch | 24 ++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 pkgs/games/heroic/remove-drm-support.patch diff --git a/pkgs/games/heroic/default.nix b/pkgs/games/heroic/default.nix index 94ca8329ffd..6ebd911ccdc 100644 --- a/pkgs/games/heroic/default.nix +++ b/pkgs/games/heroic/default.nix @@ -38,6 +38,12 @@ in stdenv.mkDerivation rec { makeWrapper ]; + patches = [ + # Reverts part of upstream PR 2761 so that we don't have to use a non-free Electron fork. + # https://github.com/Heroic-Games-Launcher/HeroicGamesLauncher/pull/2761 + ./remove-drm-support.patch + ]; + configurePhase = '' runHook preConfigure diff --git a/pkgs/games/heroic/remove-drm-support.patch b/pkgs/games/heroic/remove-drm-support.patch new file mode 100644 index 00000000000..f3cd80f003f --- /dev/null +++ b/pkgs/games/heroic/remove-drm-support.patch @@ -0,0 +1,24 @@ +diff --git a/src/backend/main.ts b/src/backend/main.ts +index 2cd1a28f..a60e04d0 100644 +--- a/src/backend/main.ts ++++ b/src/backend/main.ts +@@ -19,8 +19,7 @@ import { + powerSaveBlocker, + protocol, + screen, +- clipboard, +- components ++ clipboard + } from 'electron' + import 'backend/updater' + import { autoUpdater } from 'electron-updater' +@@ -286,8 +285,7 @@ if (!gotTheLock) { + initImagesCache() + + if (!process.env.CI) { +- await components.whenReady() +- logInfo(['DRM module staus', components.status()]) ++ logInfo('DRM modules disabled for nixpkgs') + } + + // try to fix notification app name on windows