Merge pull request #335737 from aidalgol/heroic-2.15
Heroic Games Launcher: 2.14.1 -> 2.15.1
This commit is contained in:
commit
ab13423a41
@ -1,48 +1,40 @@
|
|||||||
{ lib
|
{ lib
|
||||||
, stdenv
|
, stdenv
|
||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
, fetchYarnDeps
|
, pnpm
|
||||||
, yarn
|
|
||||||
, fixup-yarn-lock
|
|
||||||
, nodejs
|
, nodejs
|
||||||
, python3
|
|
||||||
, makeWrapper
|
, makeWrapper
|
||||||
, electron
|
, electron
|
||||||
, vulkan-helper
|
, vulkan-helper
|
||||||
, gogdl
|
, gogdl
|
||||||
, legendary-gl
|
, legendary-gl
|
||||||
, nile
|
, nile
|
||||||
|
, comet-gog
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let appName = "heroic";
|
stdenv.mkDerivation (finalAttrs: {
|
||||||
in stdenv.mkDerivation rec {
|
|
||||||
pname = "heroic-unwrapped";
|
pname = "heroic-unwrapped";
|
||||||
version = "2.14.1";
|
version = "2.15.1";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "Heroic-Games-Launcher";
|
owner = "Heroic-Games-Launcher";
|
||||||
repo = "HeroicGamesLauncher";
|
repo = "HeroicGamesLauncher";
|
||||||
rev = "v${version}";
|
rev = "v${finalAttrs.version}";
|
||||||
hash = "sha256-AnyltqNP+XyVzgCobM3g6DIXntD3spKecYtCRx+8oic=";
|
hash = "sha256-+OQRcBOf9Y34DD7FOp/3SO05mREG6or/HPiOkasHWPM=";
|
||||||
};
|
};
|
||||||
|
|
||||||
offlineCache = fetchYarnDeps {
|
pnpmDeps = pnpm.fetchDeps {
|
||||||
yarnLock = "${src}/yarn.lock";
|
inherit (finalAttrs) pname version src;
|
||||||
hash = "sha256-3CYSw1Qy363eyhy3UyFgihSau+miNHwvKjhlq/kWxWQ=";
|
hash = "sha256-3PiB8CT7wxGmvRuQQ5FIAmBqBm9+R55ry+N/qUYWzuk=";
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
yarn
|
|
||||||
fixup-yarn-lock
|
|
||||||
nodejs
|
nodejs
|
||||||
python3
|
pnpm.configHook
|
||||||
makeWrapper
|
makeWrapper
|
||||||
];
|
];
|
||||||
|
|
||||||
patches = [
|
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
|
|
||||||
# Make Heroic create Steam shortcuts (to non-steam games) with the correct path to heroic.
|
# Make Heroic create Steam shortcuts (to non-steam games) with the correct path to heroic.
|
||||||
./fix-non-steam-shortcuts.patch
|
./fix-non-steam-shortcuts.patch
|
||||||
];
|
];
|
||||||
@ -51,64 +43,52 @@ in stdenv.mkDerivation rec {
|
|||||||
# We are not packaging this as an Electron application bundle, so Electron
|
# We are not packaging this as an Electron application bundle, so Electron
|
||||||
# reports to the application that is is not "packaged", which causes Heroic
|
# reports to the application that is is not "packaged", which causes Heroic
|
||||||
# to take some incorrect codepaths meant for development environments.
|
# to take some incorrect codepaths meant for development environments.
|
||||||
substituteInPlace src/**/*.ts --replace 'app.isPackaged' 'true'
|
substituteInPlace src/**/*.ts --replace-quiet 'app.isPackaged' 'true'
|
||||||
'';
|
|
||||||
|
|
||||||
configurePhase = ''
|
|
||||||
runHook preConfigure
|
|
||||||
|
|
||||||
export HOME=$(mktemp -d)
|
|
||||||
yarn config --offline set yarn-offline-mirror $offlineCache
|
|
||||||
fixup-yarn-lock yarn.lock
|
|
||||||
yarn install --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive
|
|
||||||
patchShebangs node_modules/
|
|
||||||
|
|
||||||
runHook postConfigure
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
runHook preBuild
|
runHook preBuild
|
||||||
|
|
||||||
yarn --offline vite build
|
pnpm --offline electron-vite build
|
||||||
|
|
||||||
# Remove dev dependencies.
|
# Remove dev dependencies.
|
||||||
yarn install --production --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive
|
pnpm --ignore-scripts prune --prod
|
||||||
|
# Clean up broken symlinks left behind by `pnpm prune`
|
||||||
|
find node_modules/.bin -xtype l -delete
|
||||||
|
|
||||||
runHook postBuild
|
runHook postBuild
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# --disable-gpu-compositing is to work around upstream bug
|
# --disable-gpu-compositing is to work around upstream bug
|
||||||
# https://github.com/electron/electron/issues/32317
|
# https://github.com/electron/electron/issues/32317
|
||||||
installPhase = let
|
installPhase = ''
|
||||||
binPlatform = if stdenv.isDarwin then "darwin" else "linux";
|
|
||||||
in ''
|
|
||||||
runHook preInstall
|
runHook preInstall
|
||||||
|
|
||||||
mkdir -p $out/share/{applications,${appName}}
|
mkdir -p $out/share/{applications,heroic}
|
||||||
cp -r . $out/share/${appName}
|
cp -r . $out/share/heroic
|
||||||
rm -rf $out/share/${appName}/{.devcontainer,.vscode,.husky,.idea,.github}
|
rm -rf $out/share/heroic/{.devcontainer,.vscode,.husky,.idea,.github}
|
||||||
|
|
||||||
chmod -R u+w "$out/share/${appName}/public/bin" "$out/share/${appName}/build/bin"
|
chmod -R u+w "$out/share/heroic/public/bin" "$out/share/heroic/build/bin"
|
||||||
rm -rf "$out/share/${appName}/public/bin" "$out/share/${appName}/build/bin"
|
rm -rf "$out/share/heroic/public/bin" "$out/share/heroic/build/bin"
|
||||||
mkdir -p "$out/share/${appName}/build/bin/${binPlatform}"
|
mkdir -p "$out/share/heroic/build/bin/x64/linux"
|
||||||
ln -s \
|
ln -s \
|
||||||
"${gogdl}/bin/gogdl" \
|
"${lib.getExe gogdl}" \
|
||||||
"${legendary-gl}/bin/legendary" \
|
"${lib.getExe legendary-gl}" \
|
||||||
"${nile}/bin/nile" \
|
"${lib.getExe nile}" \
|
||||||
"${lib.optionalString stdenv.isLinux "${vulkan-helper}/bin/vulkan-helper"}" \
|
"${lib.getExe comet-gog}" \
|
||||||
"$out/share/${appName}/build/bin/${binPlatform}"
|
"${lib.getExe vulkan-helper}" \
|
||||||
|
"$out/share/heroic/build/bin/x64/linux/"
|
||||||
|
|
||||||
makeWrapper "${electron}/bin/electron" "$out/bin/heroic" \
|
makeWrapper "${electron}/bin/electron" "$out/bin/heroic" \
|
||||||
--inherit-argv0 \
|
--inherit-argv0 \
|
||||||
--add-flags --disable-gpu-compositing \
|
--add-flags --disable-gpu-compositing \
|
||||||
--add-flags $out/share/${appName} \
|
--add-flags $out/share/heroic \
|
||||||
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime}}"
|
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime}}"
|
||||||
|
|
||||||
substituteInPlace "$out/share/${appName}/flatpak/com.heroicgameslauncher.hgl.desktop" \
|
substituteInPlace "$out/share/heroic/flatpak/com.heroicgameslauncher.hgl.desktop" \
|
||||||
--replace "Exec=heroic-run" "Exec=heroic"
|
--replace-fail "Exec=heroic-run" "Exec=heroic"
|
||||||
mkdir -p "$out/share/applications" "$out/share/icons/hicolor/512x512/apps"
|
mkdir -p "$out/share/applications" "$out/share/icons/hicolor/512x512/apps"
|
||||||
ln -s "$out/share/${appName}/flatpak/com.heroicgameslauncher.hgl.desktop" "$out/share/applications"
|
ln -s "$out/share/heroic/flatpak/com.heroicgameslauncher.hgl.desktop" "$out/share/applications"
|
||||||
ln -s "$out/share/${appName}/flatpak/com.heroicgameslauncher.hgl.png" "$out/share/icons/hicolor/512x512/apps"
|
ln -s "$out/share/heroic/flatpak/com.heroicgameslauncher.hgl.png" "$out/share/icons/hicolor/512x512/apps"
|
||||||
|
|
||||||
runHook postInstall
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
@ -119,7 +99,11 @@ in stdenv.mkDerivation rec {
|
|||||||
changelog = "https://github.com/Heroic-Games-Launcher/HeroicGamesLauncher/releases";
|
changelog = "https://github.com/Heroic-Games-Launcher/HeroicGamesLauncher/releases";
|
||||||
license = licenses.gpl3Only;
|
license = licenses.gpl3Only;
|
||||||
maintainers = with maintainers; [ aidalgol ];
|
maintainers = with maintainers; [ aidalgol ];
|
||||||
platforms = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
|
# Heroic may work on nix-darwin, but it needs a dedicated maintainer for the platform.
|
||||||
mainProgram = appName;
|
# It may also work on other Linux targets, but all the game stores only
|
||||||
|
# support x86 Linux, so it would require extra hacking to run games via QEMU
|
||||||
|
# user emulation. Upstream provide Linux builds only for x86_64.
|
||||||
|
platforms = [ "x86_64-linux" ];
|
||||||
|
mainProgram = "heroic";
|
||||||
};
|
};
|
||||||
}
|
})
|
||||||
|
@ -78,6 +78,7 @@ buildFHSEnv {
|
|||||||
glib
|
glib
|
||||||
gnutls
|
gnutls
|
||||||
gtk3
|
gtk3
|
||||||
|
icu
|
||||||
lcms2
|
lcms2
|
||||||
libevdev
|
libevdev
|
||||||
libgcrypt
|
libgcrypt
|
||||||
|
@ -1,28 +0,0 @@
|
|||||||
diff --git a/src/backend/main.ts b/src/backend/main.ts
|
|
||||||
index 83b58bb2..f61656fa 100644
|
|
||||||
--- a/src/backend/main.ts
|
|
||||||
+++ b/src/backend/main.ts
|
|
||||||
@@ -19,7 +19,6 @@ import {
|
|
||||||
protocol,
|
|
||||||
screen,
|
|
||||||
clipboard,
|
|
||||||
- components,
|
|
||||||
session
|
|
||||||
} from 'electron'
|
|
||||||
import 'backend/updater'
|
|
||||||
@@ -310,14 +309,7 @@ if (!gotTheLock) {
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!process.env.CI) {
|
|
||||||
- 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')
|
|
||||||
}
|
|
||||||
|
|
||||||
// try to fix notification app name on windows
|
|
@ -35333,7 +35333,7 @@ with pkgs;
|
|||||||
|
|
||||||
heroic-unwrapped = callPackage ../games/heroic {
|
heroic-unwrapped = callPackage ../games/heroic {
|
||||||
# Match the version used by the upstream package.
|
# Match the version used by the upstream package.
|
||||||
electron = electron_29;
|
electron = electron_31;
|
||||||
};
|
};
|
||||||
|
|
||||||
heroic = callPackage ../games/heroic/fhsenv.nix { };
|
heroic = callPackage ../games/heroic/fhsenv.nix { };
|
||||||
|
Loading…
Reference in New Issue
Block a user