summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Kehayias <john.kehayias@protonmail.com>2024-01-03 20:08:28 -0500
committerJohn Kehayias <john.kehayias@protonmail.com>2024-01-03 23:02:39 -0500
commite823034e401a94e4fdffd81d4d9e926b05f1c856 (patch)
tree13c0f4f9b076cec21df0faa881b5568668d4a2ca
parentc6771b89c36f4e1bf3eb4e66232ef3b9ae5cd435 (diff)
nongnu: Add heroic.
* nongnu/packages/game-client.scm (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 "/usr/share/glib-2.0".
-rw-r--r--nongnu/packages/game-client.scm112
-rw-r--r--nonguix/multiarch-container.scm2
2 files changed, 113 insertions, 1 deletions
diff --git a/nongnu/packages/game-client.scm b/nongnu/packages/game-client.scm
index 18bc21d..fa935b6 100644
--- a/nongnu/packages/game-client.scm
+++ b/nongnu/packages/game-client.scm
@@ -4,7 +4,7 @@
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, 2024 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;;; Copyright © 2023 Timo Wilken <guix@twilken.net> 10;;; Copyright © 2023 Timo Wilken <guix@twilken.net>
@@ -15,6 +15,7 @@
15 #:use-module (guix git-download) 15 #:use-module (guix git-download)
16 #:use-module (guix packages) 16 #:use-module (guix packages)
17 #:use-module (guix download) 17 #:use-module (guix download)
18 #:use-module (guix gexp)
18 #:use-module (guix build-system gnu) 19 #:use-module (guix build-system gnu)
19 #:use-module (guix build-system python) 20 #:use-module (guix build-system python)
20 #:use-module (gnu packages audio) 21 #:use-module (gnu packages audio)
@@ -22,6 +23,7 @@
22 #:use-module (gnu packages bash) 23 #:use-module (gnu packages bash)
23 #:use-module (gnu packages certs) 24 #:use-module (gnu packages certs)
24 #:use-module (gnu packages compression) 25 #:use-module (gnu packages compression)
26 #:use-module (gnu packages curl)
25 #:use-module (gnu packages elf) 27 #:use-module (gnu packages elf)
26 #:use-module (gnu packages file) 28 #:use-module (gnu packages file)
27 #:use-module (gnu packages fonts) 29 #:use-module (gnu packages fonts)
@@ -49,9 +51,68 @@
49 #:use-module (gnu packages toolkits) 51 #:use-module (gnu packages toolkits)
50 #:use-module (gnu packages video) 52 #:use-module (gnu packages video)
51 #:use-module (gnu packages xorg) 53 #:use-module (gnu packages xorg)
54 #:use-module (nonguix build-system chromium-binary)
52 #:use-module (nonguix multiarch-container) 55 #:use-module (nonguix multiarch-container)
53 #:use-module (nonguix utils)) 56 #:use-module (nonguix utils))
54 57
58(define heroic-client
59 (package
60 (name "heroic-client")
61 (version "2.11.0")
62 (source
63 (origin
64 (method url-fetch)
65 (uri (string-append "https://github.com/Heroic-Games-Launcher/"
66 "HeroicGamesLauncher/releases/download/v"
67 version "/heroic_" version "_amd64.deb"))
68 (sha256
69 (base32
70 "1g54rzhgbqqd7nsbd08p3jkdyy01gz0q8yvhpcd698jpi2ks87q0"))))
71 (build-system chromium-binary-build-system)
72 (arguments
73 (list #:validate-runpath? #f ; TODO: fails on wrapped binary and included other files
74 #:wrapper-plan
75 #~'("lib/Heroic/heroic"
76 "lib/Heroic/libEGL.so"
77 "lib/Heroic/libGLESv2.so"
78 "lib/Heroic/libvk_swiftshader.so"
79 "lib/Heroic/libvulkan.so.1"
80 "lib/Heroic/chrome-sandbox"
81 "lib/Heroic/chrome_crashpad_handler"
82 "lib/Heroic/libffmpeg.so")
83 #:phases
84 #~(modify-phases %standard-phases
85 (add-after 'binary-unpack 'setup-cwd
86 (lambda _
87 (copy-recursively "usr/" ".")
88 ;; Use the more standard lib directory for everything.
89 (rename-file "opt/" "lib")
90 ;; Remove unneeded files.
91 (delete-file-recursively "usr")
92 ;; Fix the .desktop file binary location.
93 (substitute* '("share/applications/heroic.desktop")
94 (("/opt/Heroic/")
95 (string-append #$output "/bin/")))))
96 (add-after 'install 'symlink-binary-file
97 (lambda _
98 (mkdir-p (string-append #$output "/bin"))
99 (symlink (string-append #$output "/lib/Heroic/heroic")
100 (string-append #$output "/bin/heroic"))))
101 (add-after 'install-wrapper 'wrap-where-patchelf-does-not-work
102 (lambda _
103 (wrap-program (string-append #$output "/lib/Heroic/heroic")
104 `("LD_LIBRARY_PATH" ":" prefix
105 (,(string-join
106 (list
107 (string-append #$output "/lib/Heroic"))
108 ":")))))))))
109 (home-page "https://heroicgameslauncher.com")
110 (synopsis "A Native GOG, Amazon and Epic Games Launcher")
111 (description "Heroic is an Open Source Game Launcher. Right now it supports launching
112games from the Epic Games Store using Legendary, GOG Games using our custom
113implementation with gogdl and Amazon Games using Nile.")
114 (license license:gpl3)))
115
55(define steam-client 116(define steam-client
56 (package 117 (package
57 (name "steam-client") 118 (name "steam-client")
@@ -157,6 +218,11 @@
157 ("python" ,python) ; Required for KillingFloor2 and Wreckfest. 218 ("python" ,python) ; Required for KillingFloor2 and Wreckfest.
158 ("spdlog" ,spdlog))) ; Required for MangoHud. 219 ("spdlog" ,spdlog))) ; Required for MangoHud.
159 220
221(define heroic-extra-client-libs
222 `(("curl" ,curl) ; Required for Heroic to download e.g. Wine.
223 ("which" ,which) ; Heroic complains about trying to use which (though works).
224 ("gtk+" ,gtk+))) ; Required for Heroic interface (gtk filechooser schema).
225
160(define steam-ld.so.conf 226(define steam-ld.so.conf
161 (packages->ld.so.conf 227 (packages->ld.so.conf
162 (list (fhs-union `(,@steam-client-libs 228 (list (fhs-union `(,@steam-client-libs
@@ -209,6 +275,50 @@ all games will be installed.")))
209(define-public steam (nonguix-container->package steam-container)) 275(define-public steam (nonguix-container->package steam-container))
210(define-public steam-nvidia (nonguix-container->package steam-nvidia-container)) 276(define-public steam-nvidia (nonguix-container->package steam-nvidia-container))
211 277
278(define-public heroic-container
279 (nonguix-container
280 (name "heroic")
281 (wrap-package heroic-client)
282 (run "/bin/heroic")
283 (ld.so.conf steam-ld.so.conf)
284 (ld.so.cache steam-ld.so.cache)
285 ;; TODO: Probably can remove some of the packages from these lists, at
286 ;; least changing the client libraries as Heroic is rather different from
287 ;; Steam. However, a good number will be needed to run games anyway. A
288 ;; better separation and testing in Steam as well would be helpful to
289 ;; differentiate what packages are needed for what in general. For now,
290 ;; this is easier and works.
291 (union64
292 (fhs-union `(,@heroic-extra-client-libs
293 ,@steam-client-libs
294 ,@steam-gameruntime-libs
295 ,@fhs-min-libs)
296 #:name "fhs-union-64"))
297 ;; Don't include heroic-client-libs as they are not needed in 32-bit.
298 (union32
299 (fhs-union `(,@steam-client-libs
300 ,@steam-gameruntime-libs
301 ,@fhs-min-libs)
302 #:name "fhs-union-32"
303 #:system "i686-linux"))
304 (link-files '("share/applications/heroic.desktop"))
305 (description "Heroic is an Open Source Game Launcher. Right now it supports launching
306games from the Epic Games Store using Legendary, GOG Games using our custom
307implementation with gogdl and Amazon Games using Nile. This package provides
308a script for launching Heroic in a Guix container which will use the directory
309@file{$HOME/.local/share/guix-sandbox-home} where all games will be
310installed.")))
311
312(define-public heroic-nvidia-container
313 (nonguix-container
314 (inherit heroic-container)
315 (name "heroic-nvidia")
316 (union64 (replace-mesa (ngc-union64 heroic-container)))
317 (union32 (replace-mesa (ngc-union32 heroic-container)))))
318
319(define-public heroic (nonguix-container->package heroic-container))
320(define-public heroic-nvidia (nonguix-container->package heroic-nvidia-container))
321
212(define-public protonup-ng 322(define-public protonup-ng
213 (package 323 (package
214 (name "protonup-ng") 324 (name "protonup-ng")
diff --git a/nonguix/multiarch-container.scm b/nonguix/multiarch-container.scm
index 8d3bf70..135a72c 100644
--- a/nonguix/multiarch-container.scm
+++ b/nonguix/multiarch-container.scm
@@ -287,6 +287,7 @@ in a sandboxed FHS environment."
287 "^QT_X11_NO_MITSHM$" 287 "^QT_X11_NO_MITSHM$"
288 "^SDL_" 288 "^SDL_"
289 "^STEAM_" 289 "^STEAM_"
290 "^SSL_" ; SSL certificate environment, needed by curl for Heroic.
290 "^VDPAU_DRIVER_PATH$" ; For VDPAU drivers. 291 "^VDPAU_DRIVER_PATH$" ; For VDPAU drivers.
291 "^XAUTHORITY$" 292 "^XAUTHORITY$"
292 ;; Matching all ^XDG_ vars causes issues 293 ;; Matching all ^XDG_ vars causes issues
@@ -506,6 +507,7 @@ application."
506 ((,union64 "lib/locale") . "/usr/lib/locale") 507 ((,union64 "lib/locale") . "/usr/lib/locale")
507 ((,union64 "sbin/ldconfig") . "/sbin/ldconfig") 508 ((,union64 "sbin/ldconfig") . "/sbin/ldconfig")
508 ((,union64 "share/mime") . "/usr/share/mime") ; Steam tray icon. 509 ((,union64 "share/mime") . "/usr/share/mime") ; Steam tray icon.
510 ((,union64 "share/glib-2.0") . "/usr/share/glib-2.0") ; Heroic interface.
509 ((,union64 "share/drirc.d") . "/usr/share/drirc.d") 511 ((,union64 "share/drirc.d") . "/usr/share/drirc.d")
510 ((,union64 "share/fonts") . "/run/current-system/profile/share/fonts") 512 ((,union64 "share/fonts") . "/run/current-system/profile/share/fonts")
511 ((,union64 "etc/fonts") . "/etc/fonts") 513 ((,union64 "etc/fonts") . "/etc/fonts")