diff options
| author | John Kehayias <john.kehayias@protonmail.com> | 2023-09-04 14:27:35 -0400 |
|---|---|---|
| committer | John Kehayias <john.kehayias@protonmail.com> | 2023-10-10 13:43:02 -0400 |
| commit | 2fdfb97f4e5bacc998ee265638b44be6bde0d621 (patch) | |
| tree | 197424279c7f2af3ec0763a1639b1cf0e6f59136 | |
| parent | 5e5167168efbdaf561a53edd5622531f411a051b (diff) | |
nongnu: Add heroic.heroic
* nongnu/packages/steam-client.scm: Rename to ...
* nongnu/packages/game-client.scm: ... this.
(heroic-client, heroic-extra-client-libs, heroic-container,
heroic-nvidia-container, heroic, heroic-nvidia): New variables.
* nonguix/multi-arch-container.scm (make-container-wrapper): Preserve "^SSL_"
for heroic to use curl.
(make-internal-script): Add symlink for "/usrshare/glib-2.0".
| -rw-r--r-- | nongnu/packages/game-client.scm (renamed from nongnu/packages/steam-client.scm) | 116 | ||||
| -rw-r--r-- | nonguix/multiarch-container.scm | 2 |
2 files changed, 116 insertions, 2 deletions
diff --git a/nongnu/packages/steam-client.scm b/nongnu/packages/game-client.scm index e7592cf..3f5c600 100644 --- a/nongnu/packages/steam-client.scm +++ b/nongnu/packages/game-client.scm | |||
| @@ -4,16 +4,17 @@ | |||
| 4 | ;;; Copyright © 2021 pineapples | 4 | ;;; Copyright © 2021 pineapples |
| 5 | ;;; Copyright © 2021 Jean-Baptiste Volatier <jbv@pm.me> | 5 | ;;; Copyright © 2021 Jean-Baptiste Volatier <jbv@pm.me> |
| 6 | ;;; Copyright © 2021 Kozo <kozodev@runbox.com> | 6 | ;;; Copyright © 2021 Kozo <kozodev@runbox.com> |
| 7 | ;;; Copyright © 2021, 2022 John Kehayias <john.kehayias@protonmail.com> | 7 | ;;; Copyright © 2021, 2022, 2023 John Kehayias <john.kehayias@protonmail.com> |
| 8 | ;;; Copyright © 2023 Giacomo Leidi <goodoldpaul@autistici.org> | 8 | ;;; Copyright © 2023 Giacomo Leidi <goodoldpaul@autistici.org> |
| 9 | ;;; Copyright © 2023 Elijah Malaby | 9 | ;;; Copyright © 2023 Elijah Malaby |
| 10 | 10 | ||
| 11 | (define-module (nongnu packages steam-client) | 11 | (define-module (nongnu packages game-client) |
| 12 | #:use-module ((guix licenses) #:prefix license:) | 12 | #:use-module ((guix licenses) #:prefix license:) |
| 13 | #:use-module ((nonguix licenses) #:prefix license:) | 13 | #:use-module ((nonguix licenses) #:prefix license:) |
| 14 | #:use-module (guix git-download) | 14 | #:use-module (guix git-download) |
| 15 | #:use-module (guix packages) | 15 | #:use-module (guix packages) |
| 16 | #:use-module (guix download) | 16 | #:use-module (guix download) |
| 17 | #:use-module (guix gexp) | ||
| 17 | #:use-module (guix build-system gnu) | 18 | #:use-module (guix build-system gnu) |
| 18 | #:use-module (guix build-system python) | 19 | #:use-module (guix build-system python) |
| 19 | #:use-module (gnu packages audio) | 20 | #:use-module (gnu packages audio) |
| @@ -21,6 +22,7 @@ | |||
| 21 | #:use-module (gnu packages bash) | 22 | #:use-module (gnu packages bash) |
| 22 | #:use-module (gnu packages certs) | 23 | #:use-module (gnu packages certs) |
| 23 | #:use-module (gnu packages compression) | 24 | #:use-module (gnu packages compression) |
| 25 | #:use-module (gnu packages curl) | ||
| 24 | #:use-module (gnu packages elf) | 26 | #:use-module (gnu packages elf) |
| 25 | #:use-module (gnu packages file) | 27 | #:use-module (gnu packages file) |
| 26 | #:use-module (gnu packages fonts) | 28 | #:use-module (gnu packages fonts) |
| @@ -48,9 +50,75 @@ | |||
| 48 | #:use-module (gnu packages toolkits) | 50 | #:use-module (gnu packages toolkits) |
| 49 | #:use-module (gnu packages video) | 51 | #:use-module (gnu packages video) |
| 50 | #:use-module (gnu packages xorg) | 52 | #:use-module (gnu packages xorg) |
| 53 | #:use-module (nonguix build-system chromium-binary) | ||
| 51 | #:use-module (nonguix multiarch-container) | 54 | #:use-module (nonguix multiarch-container) |
| 52 | #:use-module (nonguix utils)) | 55 | #:use-module (nonguix utils)) |
| 53 | 56 | ||
| 57 | (define-public heroic-client | ||
| 58 | (package | ||
| 59 | (name "heroic-client") | ||
| 60 | (version "2.9.1") | ||
| 61 | (source | ||
| 62 | (origin | ||
| 63 | (method url-fetch) | ||
| 64 | (uri (string-append "https://github.com/Heroic-Games-Launcher/" | ||
| 65 | "HeroicGamesLauncher/releases/download/v" | ||
| 66 | version "/heroic_" version "_amd64.deb")) | ||
| 67 | (sha256 | ||
| 68 | (base32 | ||
| 69 | "128x6bqp85nib7v6ldnyy39qrxppqjgwmfvi59lbf0jr5pa546jg")))) | ||
| 70 | (build-system chromium-binary-build-system) | ||
| 71 | (arguments | ||
| 72 | (list #:validate-runpath? #f ; TODO: fails on wrapped binary and included other files | ||
| 73 | #:wrapper-plan | ||
| 74 | #~'("lib/Heroic/heroic" | ||
| 75 | "lib/Heroic/libEGL.so" | ||
| 76 | "lib/Heroic/libGLESv2.so" | ||
| 77 | "lib/Heroic/libvk_swiftshader.so" | ||
| 78 | "lib/Heroic/libvulkan.so.1" | ||
| 79 | "lib/Heroic/chrome-sandbox" | ||
| 80 | "lib/Heroic/chrome_crashpad_handler" | ||
| 81 | "lib/Heroic/libffmpeg.so") | ||
| 82 | #:phases | ||
| 83 | #~(modify-phases %standard-phases | ||
| 84 | (replace 'unpack | ||
| 85 | (lambda _ | ||
| 86 | (invoke "ar" "x" #$source) | ||
| 87 | (invoke "tar" "xvf" "data.tar.xz") | ||
| 88 | (copy-recursively "usr/" ".") | ||
| 89 | ;; Use the more standard lib directory for everything. | ||
| 90 | (rename-file "opt/" "lib") | ||
| 91 | ;; Remove unneeded files. | ||
| 92 | (delete-file-recursively "usr") | ||
| 93 | (delete-file "control.tar.gz") | ||
| 94 | (delete-file "data.tar.xz") | ||
| 95 | (delete-file "debian-binary") | ||
| 96 | ;; Fix the .desktop file binary location. | ||
| 97 | (substitute* '("share/applications/heroic.desktop") | ||
| 98 | (("/opt/Heroic/") | ||
| 99 | (string-append #$output "/bin/"))))) | ||
| 100 | (add-after 'install 'symlink-binary-file-and-cleanup | ||
| 101 | (lambda _ | ||
| 102 | (delete-file (string-append #$output "/environment-variables")) | ||
| 103 | (mkdir-p (string-append #$output "/bin")) | ||
| 104 | (symlink (string-append #$output "/lib/Heroic/heroic") | ||
| 105 | (string-append #$output "/bin/heroic")))) | ||
| 106 | (add-after 'install-wrapper 'wrap-where-patchelf-does-not-work | ||
| 107 | (lambda _ | ||
| 108 | (wrap-program (string-append #$output "/lib/Heroic/heroic") | ||
| 109 | `("LD_LIBRARY_PATH" ":" prefix | ||
| 110 | (,(string-join | ||
| 111 | (list | ||
| 112 | (string-append #$output "/lib/Heroic")) | ||
| 113 | ":"))))))))) | ||
| 114 | (native-inputs (list tar)) | ||
| 115 | (home-page "https://heroicgameslauncher.com") | ||
| 116 | (synopsis "A Native GOG, Amazon and Epic Games Launcher") | ||
| 117 | (description "Heroic is an Open Source Game Launcher. Right now it supports launching | ||
| 118 | games from the Epic Games Store using Legendary, GOG Games using our custom | ||
| 119 | implementation with gogdl and Amazon Games using Nile.") | ||
| 120 | (license license:gpl3))) | ||
| 121 | |||
| 54 | (define steam-client | 122 | (define steam-client |
| 55 | (package | 123 | (package |
| 56 | (name "steam-client") | 124 | (name "steam-client") |
| @@ -179,6 +247,10 @@ | |||
| 179 | ("python" ,python) ; Required for KillingFloor2 and Wreckfest. | 247 | ("python" ,python) ; Required for KillingFloor2 and Wreckfest. |
| 180 | ("spdlog" ,spdlog))) ; Required for MangoHud. | 248 | ("spdlog" ,spdlog))) ; Required for MangoHud. |
| 181 | 249 | ||
| 250 | (define heroic-extra-client-libs | ||
| 251 | `(("curl" ,curl) ; Required for Heroic to download e.g. Wine. | ||
| 252 | ("gtk+" ,gtk+))) ; Required for Heroic interface (gtk filechooser schema). | ||
| 253 | |||
| 182 | (define steam-ld.so.conf | 254 | (define steam-ld.so.conf |
| 183 | (packages->ld.so.conf | 255 | (packages->ld.so.conf |
| 184 | (list (fhs-union `(,@steam-client-libs | 256 | (list (fhs-union `(,@steam-client-libs |
| @@ -229,6 +301,46 @@ all games will be installed."))) | |||
| 229 | (define-public steam (nonguix-container->package steam-container)) | 301 | (define-public steam (nonguix-container->package steam-container)) |
| 230 | (define-public steam-nvidia (nonguix-container->package steam-nvidia-container)) | 302 | (define-public steam-nvidia (nonguix-container->package steam-nvidia-container)) |
| 231 | 303 | ||
| 304 | (define-public heroic-container | ||
| 305 | (nonguix-container | ||
| 306 | (name "heroic") | ||
| 307 | (wrap-package heroic-client) | ||
| 308 | (run "/bin/heroic") | ||
| 309 | (ld.so.conf steam-ld.so.conf) | ||
| 310 | (ld.so.cache steam-ld.so.cache) | ||
| 311 | (union64 | ||
| 312 | (fhs-union `(,@heroic-extra-client-libs | ||
| 313 | ,@steam-client-libs | ||
| 314 | ,@steam-gameruntime-libs | ||
| 315 | ,@fhs-min-libs) | ||
| 316 | #:name "fhs-union-64")) | ||
| 317 | ;; Don't include heroic-client-libs as they are not needed in 32-bit and | ||
| 318 | ;; cause profile collisions with gtk+ and the libx11 graft (which is deep | ||
| 319 | ;; and wide spread in the dependency tree). | ||
| 320 | (union32 | ||
| 321 | (fhs-union `(,@steam-client-libs | ||
| 322 | ,@steam-gameruntime-libs | ||
| 323 | ,@fhs-min-libs) | ||
| 324 | #:name "fhs-union-32" | ||
| 325 | #:system "i686-linux")) | ||
| 326 | (link-files '("share/applications/heroic.desktop")) | ||
| 327 | (description "Heroic is an Open Source Game Launcher. Right now it supports launching | ||
| 328 | games from the Epic Games Store using Legendary, GOG Games using our custom | ||
| 329 | implementation with gogdl and Amazon Games using Nile. This package provides | ||
| 330 | a script for launching Heroic in a Guix container which will use the directory | ||
| 331 | @file{$HOME/.local/share/guix-sandbox-home} where all games will be | ||
| 332 | installed."))) | ||
| 333 | |||
| 334 | (define-public heroic-nvidia-container | ||
| 335 | (nonguix-container | ||
| 336 | (inherit heroic-container) | ||
| 337 | (name "heroic-nvidia") | ||
| 338 | (union64 (replace-mesa (ngc-union64 heroic-container))) | ||
| 339 | (union32 (replace-mesa (ngc-union32 heroic-steam-container))))) | ||
| 340 | |||
| 341 | (define-public heroic (nonguix-container->package heroic-container)) | ||
| 342 | (define-public heroic-nvidia (nonguix-container->package heroic-nvidia-container)) | ||
| 343 | |||
| 232 | (define-public protonup-ng | 344 | (define-public protonup-ng |
| 233 | (package | 345 | (package |
| 234 | (name "protonup-ng") | 346 | (name "protonup-ng") |
diff --git a/nonguix/multiarch-container.scm b/nonguix/multiarch-container.scm index 1a61346..2732fd7 100644 --- a/nonguix/multiarch-container.scm +++ b/nonguix/multiarch-container.scm | |||
| @@ -271,6 +271,7 @@ in a sandboxed FHS environment." | |||
| 271 | "^QT_X11_NO_MITSHM$" | 271 | "^QT_X11_NO_MITSHM$" |
| 272 | "^SDL_" | 272 | "^SDL_" |
| 273 | "^STEAM_" | 273 | "^STEAM_" |
| 274 | "^SSL_" ; SSL certificate environment, needed by curl for Heroic. | ||
| 274 | "^VDPAU_DRIVER_PATH$" ; For VDPAU drivers. | 275 | "^VDPAU_DRIVER_PATH$" ; For VDPAU drivers. |
| 275 | "^XAUTHORITY$" | 276 | "^XAUTHORITY$" |
| 276 | ;; Matching all ^XDG_ vars causes issues | 277 | ;; Matching all ^XDG_ vars causes issues |
| @@ -480,6 +481,7 @@ application." | |||
| 480 | ((,union64 "lib/locale") . "/run/current-system/locale") | 481 | ((,union64 "lib/locale") . "/run/current-system/locale") |
| 481 | ((,union64 "sbin/ldconfig") . "/sbin/ldconfig") | 482 | ((,union64 "sbin/ldconfig") . "/sbin/ldconfig") |
| 482 | ((,union64 "share/mime") . "/usr/share/mime") ; Steam tray icon. | 483 | ((,union64 "share/mime") . "/usr/share/mime") ; Steam tray icon. |
| 484 | ((,union64 "share/glib-2.0") . "/usr/share/glib-2.0") ; Heroic interface. | ||
| 483 | ((,union64 "share/drirc.d") . "/usr/share/drirc.d") | 485 | ((,union64 "share/drirc.d") . "/usr/share/drirc.d") |
| 484 | ((,union64 "share/fonts") . "/run/current-system/profile/share/fonts") | 486 | ((,union64 "share/fonts") . "/run/current-system/profile/share/fonts") |
| 485 | ((,union64 "etc/fonts") . "/etc/fonts") | 487 | ((,union64 "etc/fonts") . "/etc/fonts") |
