From bdf36222ea18cae482f6d2e602b2db2c0529e2cb Mon Sep 17 00:00:00 2001 From: TomaSajt <62384384+TomaSajt@users.noreply.github.com> Date: Fri, 15 Aug 2025 21:52:20 +0200 Subject: [PATCH 1/9] comet-gog_heroic: init at 0.2.0; comet-gog: refactor --- pkgs/by-name/co/comet-gog/package.nix | 39 ++++++++++++++++++++------- pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 31 insertions(+), 10 deletions(-) diff --git a/pkgs/by-name/co/comet-gog/package.nix b/pkgs/by-name/co/comet-gog/package.nix index f02b6a61c78e..01870f624414 100644 --- a/pkgs/by-name/co/comet-gog/package.nix +++ b/pkgs/by-name/co/comet-gog/package.nix @@ -1,37 +1,56 @@ { + comet-gog_kind ? "latest", + lib, + stdenv, rustPlatform, fetchFromGitHub, - protobuf, + buildPackages, }: -rustPlatform.buildRustPackage rec { +let + versionInfoTable = { + "latest" = { + version = "0.3.1"; + srcHash = "sha256-asg2xp9A5abmsF+CgOa+ScK2sQwSNFQXD5Qnm76Iyhg="; + cargoHash = "sha256-K0lQuk2PBwnVlkRpYNo4Z7to/Lx2fY6RIlkgmMjvEtc="; + }; + # version pin that is compatible with heroic + "heroic" = { + version = "0.2.0"; + srcHash = "sha256-LAEt2i/SRABrz+y2CTMudrugifLgHNxkMSdC8PXYF0E="; + cargoHash = "sha256-SvDE+QqaSK0+4XgB3bdmqOtwxBDTlf7yckTR8XjmMXc="; + }; + }; + + versionInfo = versionInfoTable.${comet-gog_kind}; +in +rustPlatform.buildRustPackage (finalAttrs: { pname = "comet-gog"; - version = "0.3.1"; + inherit (versionInfo) version cargoHash; src = fetchFromGitHub { owner = "imLinguin"; repo = "comet"; - tag = "v${version}"; - hash = "sha256-asg2xp9A5abmsF+CgOa+ScK2sQwSNFQXD5Qnm76Iyhg="; + tag = "v${finalAttrs.version}"; + hash = versionInfo.srcHash; fetchSubmodules = true; }; - cargoHash = "sha256-K0lQuk2PBwnVlkRpYNo4Z7to/Lx2fY6RIlkgmMjvEtc="; - # error: linker `aarch64-linux-gnu-gcc` not found postPatch = '' rm .cargo/config.toml ''; - env.PROTOC = lib.getExe' protobuf "protoc"; + # TECHNICALLY, we could remove this, but then we'd be using the vendored precompiled protoc binary... + env.PROTOC = lib.getExe' buildPackages.protobuf "protoc"; meta = { - changelog = "https://github.com/imLinguin/comet/releases/tag/v${version}"; + changelog = "https://github.com/imLinguin/comet/releases/tag/${finalAttrs.src.tag}"; description = "Open Source implementation of GOG Galaxy's Communication Service"; homepage = "https://github.com/imLinguin/comet"; license = lib.licenses.gpl3Plus; mainProgram = "comet"; maintainers = with lib.maintainers; [ tomasajt ]; }; -} +}) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a7e5d5076e3b..d45f3bb530f5 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2650,6 +2650,8 @@ with pkgs; cocoapods-beta = lowPrio (callPackage ../development/tools/cocoapods { beta = true; }); + comet-gog_heroic = callPackage ../by-name/co/comet-gog/package.nix { comet-gog_kind = "heroic"; }; + compass = callPackage ../development/tools/compass { }; cone = callPackage ../development/compilers/cone { From f3e899c89f5204b9f73b60d7266875d48730bf77 Mon Sep 17 00:00:00 2001 From: TomaSajt <62384384+TomaSajt@users.noreply.github.com> Date: Fri, 15 Aug 2025 21:53:19 +0200 Subject: [PATCH 2/9] comet-gog: add dummy-service passthru --- pkgs/by-name/co/comet-gog/package.nix | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/pkgs/by-name/co/comet-gog/package.nix b/pkgs/by-name/co/comet-gog/package.nix index 01870f624414..c0d17cf6e886 100644 --- a/pkgs/by-name/co/comet-gog/package.nix +++ b/pkgs/by-name/co/comet-gog/package.nix @@ -6,6 +6,10 @@ rustPlatform, fetchFromGitHub, buildPackages, + + meson, + ninja, + pkgsCross, }: let @@ -45,6 +49,29 @@ rustPlatform.buildRustPackage (finalAttrs: { # TECHNICALLY, we could remove this, but then we'd be using the vendored precompiled protoc binary... env.PROTOC = lib.getExe' buildPackages.protobuf "protoc"; + passthru.dummy-service = stdenv.mkDerivation { + pname = "galaxy-dummy-service"; + inherit (finalAttrs) version src; + + sourceRoot = "${finalAttrs.src.name}/dummy-service"; + + nativeBuildInputs = [ + meson + ninja + pkgsCross.mingwW64.buildPackages.gcc + ]; + + mesonFlags = [ + "--cross-file meson/x86_64-w64-mingw32.ini" + ]; + + installPhase = '' + runHook preInstall + install -D GalaxyCommunication.exe -t "$out"/ + runHook postInstall + ''; + }; + meta = { changelog = "https://github.com/imLinguin/comet/releases/tag/${finalAttrs.src.tag}"; description = "Open Source implementation of GOG Galaxy's Communication Service"; From eb430bbda1082b9ff71dd5e5fbad87a1aec4e509 Mon Sep 17 00:00:00 2001 From: TomaSajt <62384384+TomaSajt@users.noreply.github.com> Date: Fri, 15 Aug 2025 21:54:05 +0200 Subject: [PATCH 3/9] comet-gog: add aidalgol to maintainers --- pkgs/by-name/co/comet-gog/package.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/co/comet-gog/package.nix b/pkgs/by-name/co/comet-gog/package.nix index c0d17cf6e886..171026bbb31e 100644 --- a/pkgs/by-name/co/comet-gog/package.nix +++ b/pkgs/by-name/co/comet-gog/package.nix @@ -78,6 +78,9 @@ rustPlatform.buildRustPackage (finalAttrs: { homepage = "https://github.com/imLinguin/comet"; license = lib.licenses.gpl3Plus; mainProgram = "comet"; - maintainers = with lib.maintainers; [ tomasajt ]; + maintainers = with lib.maintainers; [ + tomasajt + aidalgol + ]; }; }) From 22acebbfe68bb9d7e4f907c504f079e539f8f52a Mon Sep 17 00:00:00 2001 From: Aidan Gauland Date: Sat, 9 Aug 2025 17:24:00 +1200 Subject: [PATCH 4/9] heroic-unwrapped: correct meta.changelog --- pkgs/by-name/he/heroic-unwrapped/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/he/heroic-unwrapped/package.nix b/pkgs/by-name/he/heroic-unwrapped/package.nix index 90786b9fbf5c..5df26277434f 100644 --- a/pkgs/by-name/he/heroic-unwrapped/package.nix +++ b/pkgs/by-name/he/heroic-unwrapped/package.nix @@ -112,7 +112,7 @@ stdenv.mkDerivation (finalAttrs: { meta = with lib; { description = "Native GOG, Epic, and Amazon Games Launcher for Linux, Windows and Mac"; homepage = "https://github.com/Heroic-Games-Launcher/HeroicGamesLauncher"; - changelog = "https://github.com/Heroic-Games-Launcher/HeroicGamesLauncher/releases"; + changelog = "https://github.com/Heroic-Games-Launcher/HeroicGamesLauncher/releases/tag/v${finalAttrs.version}"; license = licenses.gpl3Only; maintainers = with maintainers; [ aidalgol ]; # Heroic may work on nix-darwin, but it needs a dedicated maintainer for the platform. From 481d9aa2367700a94c7037f699dc2b9dfed72e15 Mon Sep 17 00:00:00 2001 From: Aidan Gauland Date: Sun, 17 Aug 2025 13:36:40 +1200 Subject: [PATCH 5/9] heroic-unwrapped: remove update script We need to keep the helper programs at the same versions as upstream, so updating just this package is insufficient. --- pkgs/by-name/he/heroic-unwrapped/package.nix | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pkgs/by-name/he/heroic-unwrapped/package.nix b/pkgs/by-name/he/heroic-unwrapped/package.nix index 5df26277434f..79ff693f5316 100644 --- a/pkgs/by-name/he/heroic-unwrapped/package.nix +++ b/pkgs/by-name/he/heroic-unwrapped/package.nix @@ -2,7 +2,6 @@ lib, stdenv, fetchFromGitHub, - nix-update-script, # Pinned, because our FODs are not guaranteed to be stable between major versions. pnpm_10, nodejs, @@ -104,11 +103,6 @@ stdenv.mkDerivation (finalAttrs: { runHook postInstall ''; - passthru = { - inherit (finalAttrs) pnpmDeps; - updateScript = nix-update-script { }; - }; - meta = with lib; { description = "Native GOG, Epic, and Amazon Games Launcher for Linux, Windows and Mac"; homepage = "https://github.com/Heroic-Games-Launcher/HeroicGamesLauncher"; From bf8f6f0d2f42c3e769d8d71570d2911dcff962ef Mon Sep 17 00:00:00 2001 From: Aidan Gauland Date: Sat, 9 Aug 2025 17:33:35 +1200 Subject: [PATCH 6/9] heroic-unwrapped: Add missing dependencies - comet-gog.dummy-service - epic-integration --- .../he/heroic-unwrapped/epic-integration.nix | 49 +++++++++++++++++++ pkgs/by-name/he/heroic-unwrapped/package.nix | 13 ++++- 2 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 pkgs/by-name/he/heroic-unwrapped/epic-integration.nix diff --git a/pkgs/by-name/he/heroic-unwrapped/epic-integration.nix b/pkgs/by-name/he/heroic-unwrapped/epic-integration.nix new file mode 100644 index 000000000000..d025a13a1b99 --- /dev/null +++ b/pkgs/by-name/he/heroic-unwrapped/epic-integration.nix @@ -0,0 +1,49 @@ +{ + lib, + stdenv, + gitUpdater, + fetchFromGitHub, + cmake, + pkgsCross, +}: +stdenv.mkDerivation (finalAttrs: { + pname = "heroic-epic-integration"; + version = "0.3"; + + src = fetchFromGitHub { + owner = "Etaash-mathamsetty"; + repo = "heroic-epic-integration"; + tag = "v${finalAttrs.version}"; + hash = "sha256-Zn0MsaQd8Ro6eu8IQkMcLNGLVTUukwajkn8PRLfB+Yw="; + }; + + nativeBuildInputs = [ + cmake + pkgsCross.mingwW64.buildPackages.gcc + ]; + + cmakeFlags = [ (lib.cmakeFeature "CMAKE_TOOLCHAIN_FILE" "../windows.cmake") ]; + + installPhase = '' + runHook preInstall + + mkdir $out + cp heroic-epic-integration.exe $out/EpicGamesLauncher.exe + + runHook postInstall + ''; + + meta = { + description = "Wrapper process for games launched through Heroic Games Launcher"; + longDescription = '' + This is a Windows executable that pretends to be EpicGamesLauncher.exe for + games that expect it to be their parent process. + ''; + homepage = "https://github.com/Etaash-mathamsetty/heroic-epic-integration"; + changelog = "https://github.com/Etaash-mathamsetty/heroic-epic-integration/releases/tag/v${finalAttrs.version}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ aidalgol ]; + }; + + passthru.updateScript = gitUpdater { }; +}) diff --git a/pkgs/by-name/he/heroic-unwrapped/package.nix b/pkgs/by-name/he/heroic-unwrapped/package.nix index 79ff693f5316..6eb9aed9a7a5 100644 --- a/pkgs/by-name/he/heroic-unwrapped/package.nix +++ b/pkgs/by-name/he/heroic-unwrapped/package.nix @@ -1,5 +1,6 @@ { lib, + callPackage, stdenv, fetchFromGitHub, # Pinned, because our FODs are not guaranteed to be stable between major versions. @@ -18,6 +19,7 @@ }: let + epic-integration = callPackage ./epic-integration.nix { }; electron = electron_36; in stdenv.mkDerivation (finalAttrs: { @@ -78,7 +80,9 @@ stdenv.mkDerivation (finalAttrs: { cp -r public "$out/opt/heroic/resources/app.asar.unpacked/build" rm -rf "$out/opt/heroic/resources/app.asar.unpacked/build/bin" - mkdir -p "$out/opt/heroic/resources/app.asar.unpacked/build/bin/x64/linux" + mkdir -p \ + "$out/opt/heroic/resources/app.asar.unpacked/build/bin/x64/linux" \ + "$out/opt/heroic/resources/app.asar.unpacked/build/bin/x64/win32" ln -s \ "${lib.getExe gogdl}" \ "${lib.getExe legendary-heroic}" \ @@ -86,6 +90,11 @@ stdenv.mkDerivation (finalAttrs: { "${lib.getExe comet-gog}" \ "${lib.getExe vulkan-helper}" \ "$out/opt/heroic/resources/app.asar.unpacked/build/bin/x64/linux" + # Don't symlink these so we don't confuse Windows applications under Wine/Proton. + cp \ + "${comet-gog.dummy-service}/GalaxyCommunication.exe" \ + "${epic-integration}/EpicGamesLauncher.exe" \ + "$out/opt/heroic/resources/app.asar.unpacked/build/bin/x64/win32" makeWrapper "${electron}/bin/electron" "$out/bin/heroic" \ --inherit-argv0 \ @@ -103,6 +112,8 @@ stdenv.mkDerivation (finalAttrs: { runHook postInstall ''; + passthru.epic-integration = epic-integration; + meta = with lib; { description = "Native GOG, Epic, and Amazon Games Launcher for Linux, Windows and Mac"; homepage = "https://github.com/Heroic-Games-Launcher/HeroicGamesLauncher"; From 043ee2d9c71c43079635200e70fe7dadfb1fc4e4 Mon Sep 17 00:00:00 2001 From: Aidan Gauland Date: Sun, 17 Aug 2025 14:20:58 +1200 Subject: [PATCH 7/9] legendary-heroic: move beside heroic-unwrapped This is a fork only for Heroic, so move the nix file for this derivation to beside heroic-unwrapped, but expose it as a passthru for ease of overriding. --- .../package.nix => he/heroic-unwrapped/legendary.nix} | 0 pkgs/by-name/he/heroic-unwrapped/package.nix | 8 +++++--- 2 files changed, 5 insertions(+), 3 deletions(-) rename pkgs/by-name/{le/legendary-heroic/package.nix => he/heroic-unwrapped/legendary.nix} (100%) diff --git a/pkgs/by-name/le/legendary-heroic/package.nix b/pkgs/by-name/he/heroic-unwrapped/legendary.nix similarity index 100% rename from pkgs/by-name/le/legendary-heroic/package.nix rename to pkgs/by-name/he/heroic-unwrapped/legendary.nix diff --git a/pkgs/by-name/he/heroic-unwrapped/package.nix b/pkgs/by-name/he/heroic-unwrapped/package.nix index 6eb9aed9a7a5..01b7d196013b 100644 --- a/pkgs/by-name/he/heroic-unwrapped/package.nix +++ b/pkgs/by-name/he/heroic-unwrapped/package.nix @@ -12,13 +12,13 @@ electron_36, vulkan-helper, gogdl, - legendary-heroic, nile, comet-gog, umu-launcher, }: let + legendary = callPackage ./legendary.nix { }; epic-integration = callPackage ./epic-integration.nix { }; electron = electron_36; in @@ -85,7 +85,7 @@ stdenv.mkDerivation (finalAttrs: { "$out/opt/heroic/resources/app.asar.unpacked/build/bin/x64/win32" ln -s \ "${lib.getExe gogdl}" \ - "${lib.getExe legendary-heroic}" \ + "${lib.getExe legendary}" \ "${lib.getExe nile}" \ "${lib.getExe comet-gog}" \ "${lib.getExe vulkan-helper}" \ @@ -112,7 +112,9 @@ stdenv.mkDerivation (finalAttrs: { runHook postInstall ''; - passthru.epic-integration = epic-integration; + passthru = { + inherit epic-integration legendary; + }; meta = with lib; { description = "Native GOG, Epic, and Amazon Games Launcher for Linux, Windows and Mac"; From 6bf6032722799c157aee90152b8aa4e1305bc097 Mon Sep 17 00:00:00 2001 From: Aidan Gauland Date: Sun, 17 Aug 2025 15:36:30 +1200 Subject: [PATCH 8/9] heroic-unwrapped: use correct comet-gog version --- pkgs/by-name/he/heroic-unwrapped/package.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/he/heroic-unwrapped/package.nix b/pkgs/by-name/he/heroic-unwrapped/package.nix index 01b7d196013b..ad4d2b1dfd8f 100644 --- a/pkgs/by-name/he/heroic-unwrapped/package.nix +++ b/pkgs/by-name/he/heroic-unwrapped/package.nix @@ -13,13 +13,14 @@ vulkan-helper, gogdl, nile, - comet-gog, + comet-gog_heroic, umu-launcher, }: let legendary = callPackage ./legendary.nix { }; epic-integration = callPackage ./epic-integration.nix { }; + comet-gog = comet-gog_heroic; electron = electron_36; in stdenv.mkDerivation (finalAttrs: { From dae6e7c82a5f70fa0d5eb6d045688c8c76a201db Mon Sep 17 00:00:00 2001 From: Aidan Gauland Date: Tue, 19 Aug 2025 09:55:43 +1200 Subject: [PATCH 9/9] heroic-unwrapped: Apply patch for upstream bugfix PR --- pkgs/by-name/he/heroic-unwrapped/package.nix | 2 + .../by-name/he/heroic-unwrapped/pr-4885.patch | 71 +++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 pkgs/by-name/he/heroic-unwrapped/pr-4885.patch diff --git a/pkgs/by-name/he/heroic-unwrapped/package.nix b/pkgs/by-name/he/heroic-unwrapped/package.nix index ad4d2b1dfd8f..5eb4256f3d3a 100644 --- a/pkgs/by-name/he/heroic-unwrapped/package.nix +++ b/pkgs/by-name/he/heroic-unwrapped/package.nix @@ -50,6 +50,8 @@ stdenv.mkDerivation (finalAttrs: { patches = [ # Make Heroic create Steam shortcuts (to non-steam games) with the correct path to heroic. ./fix-non-steam-shortcuts.patch + # Fixes incorrect path to GalaxyCommunication.exe + ./pr-4885.patch ]; env.ELECTRON_SKIP_BINARY_DOWNLOAD = "1"; diff --git a/pkgs/by-name/he/heroic-unwrapped/pr-4885.patch b/pkgs/by-name/he/heroic-unwrapped/pr-4885.patch new file mode 100644 index 000000000000..96d71ae63f42 --- /dev/null +++ b/pkgs/by-name/he/heroic-unwrapped/pr-4885.patch @@ -0,0 +1,71 @@ +From a98cc23b288e13665c8698eec56e0653613946d7 Mon Sep 17 00:00:00 2001 +From: Aidan Gauland +Date: Tue, 19 Aug 2025 09:45:55 +1200 +Subject: [PATCH] [Fix] Run GalaxyComm executable path through fixAsarPath + +--- + src/backend/constants/paths.ts | 4 ++++ + src/backend/launcher.ts | 15 +++++---------- + 2 files changed, 9 insertions(+), 10 deletions(-) + +diff --git a/src/backend/constants/paths.ts b/src/backend/constants/paths.ts +index 1d05ce5b58..2e9cff1197 100644 +--- a/src/backend/constants/paths.ts ++++ b/src/backend/constants/paths.ts +@@ -44,6 +44,10 @@ export const fakeEpicExePath = fixAsarPath( + join(publicDir, 'bin', 'x64', 'win32', 'EpicGamesLauncher.exe') + ) + ++export const galaxyCommunicationExePath = fixAsarPath( ++ join(publicDir, 'bin', 'x64', 'win32', 'GalaxyCommunication.exe') ++) ++ + export const webviewPreloadPath = fixAsarPath( + join('file://', publicDir, 'webviewPreload.js') + ) +diff --git a/src/backend/launcher.ts b/src/backend/launcher.ts +index a239cff927..2262dc35b2 100644 +--- a/src/backend/launcher.ts ++++ b/src/backend/launcher.ts +@@ -80,7 +80,7 @@ import { + defaultWinePrefix, + fixesPath, + flatpakHome, +- publicDir, ++ galaxyCommunicationExePath, + runtimePath, + userHome + } from './constants/paths' +@@ -888,28 +888,23 @@ async function prepareWineLaunch( + + try { + if (runner === 'gog' && experimentalFeatures?.cometSupport !== false) { +- const communicationSource = join( +- publicDir, +- 'bin/x64/win32/GalaxyCommunication.exe' +- ) +- +- const galaxyCommPath = ++ const galaxyCommWinePath = + 'C:\\ProgramData\\GOG.com\\Galaxy\\redists\\GalaxyCommunication.exe' + const communicationDest = await getWinePath({ +- path: galaxyCommPath, ++ path: galaxyCommWinePath, + gameSettings, + variant: 'unix' + }) + + if (!existsSync(communicationDest)) { + mkdirSync(dirname(communicationDest), { recursive: true }) +- await copyFile(communicationSource, communicationDest) ++ await copyFile(galaxyCommunicationExePath, communicationDest) + await runWineCommand({ + commandParts: [ + 'sc', + 'create', + 'GalaxyCommunication', +- `binpath=${galaxyCommPath}` ++ `binpath=${galaxyCommWinePath}` + ], + gameSettings, + protonVerb: 'runinprefix'