2022-12-19 17:17:39 +01:00
|
|
|
;;; SPDX-License-Identifier: GPL-3.0-or-later
|
2021-01-08 02:05:19 +01:00
|
|
|
;;; Copyright © 2020 pkill-9
|
|
|
|
;;; Copyright © 2020, 2021 ison <ison@airmail.cc>
|
2021-03-05 19:40:43 +01:00
|
|
|
;;; Copyright © 2021 pineapples
|
2021-02-06 18:09:37 +01:00
|
|
|
;;; Copyright © 2021 Jean-Baptiste Volatier <jbv@pm.me>
|
2021-11-19 02:21:38 +01:00
|
|
|
;;; Copyright © 2021 Kozo <kozodev@runbox.com>
|
2022-01-31 17:47:41 +01:00
|
|
|
;;; Copyright © 2021, 2022 John Kehayias <john.kehayias@protonmail.com>
|
2020-05-06 20:53:49 +02:00
|
|
|
|
|
|
|
;;; The steam script provided by this package may optionally be started as
|
|
|
|
;;; a shell instead of automatically launching Steam by setting the
|
|
|
|
;;; environment variable DEBUG=1. If the sandbox is started this way then
|
2020-09-14 23:59:05 +02:00
|
|
|
;;; Steam should subsequently be launched via fhs-internal.
|
2020-05-06 20:53:49 +02:00
|
|
|
|
|
|
|
;;; The sandbox shell aids in debugging missing container elements. For
|
|
|
|
;;; example a missing symlink may be created manually before launching Steam
|
|
|
|
;;; to verify that the fix works before filing a bug report.
|
|
|
|
|
2020-09-14 23:59:05 +02:00
|
|
|
;;; A container wrapper creates the following store items:
|
|
|
|
;;; * Main container package [nonguix-container->package] (basically a dummy
|
|
|
|
;;; package with symlink to wrapper script)
|
2021-10-28 20:38:51 +02:00
|
|
|
;;; - Wrapper script [make-container-wrapper] (runs "guix shell")
|
2020-09-14 23:59:05 +02:00
|
|
|
;;; References:
|
|
|
|
;;; -> manifest.scm [make-container-manifest] (used by wrapper to guarantee
|
|
|
|
;;; exact store items)
|
|
|
|
;;; -> container-internal [make-container-internal] {inside container}
|
|
|
|
;;; (dummy package added to container with symlink to internal-script)
|
|
|
|
;;; - internal-script [make-internal-script] {inside container}
|
|
|
|
;;; (script run in-container which performs additional setup before
|
|
|
|
;;; launching the desired application)
|
|
|
|
;;; References:
|
|
|
|
;;; -> Wrapped package {inside container} (in this case Steam).
|
|
|
|
|
|
|
|
;;; Note: The extra container-internal package is necessary because there is no
|
|
|
|
;;; way to add the container package's own store path to its own manifest unless
|
|
|
|
;;; the manifest is printed inside the build phases. However, the (guix gexp)
|
|
|
|
;;; module is apparently disallowed inside build phases.
|
|
|
|
|
2020-05-06 20:53:49 +02:00
|
|
|
(define-module (nongnu packages steam-client)
|
2022-08-12 21:01:50 +02:00
|
|
|
#:use-module ((guix licenses) #:prefix license:)
|
2020-05-06 20:53:49 +02:00
|
|
|
#:use-module ((nonguix licenses) #:prefix license:)
|
|
|
|
#:use-module (guix gexp)
|
2022-08-12 21:01:50 +02:00
|
|
|
#:use-module (guix git-download)
|
2021-12-20 09:26:50 +01:00
|
|
|
#:use-module (guix utils)
|
2020-05-06 20:53:49 +02:00
|
|
|
#:use-module (guix packages)
|
2020-09-13 04:44:54 +02:00
|
|
|
#:use-module (guix records)
|
2020-05-06 20:53:49 +02:00
|
|
|
#:use-module (guix download)
|
|
|
|
#:use-module (guix build-system gnu)
|
2022-08-12 21:01:50 +02:00
|
|
|
#:use-module (guix build-system python)
|
2020-05-06 20:53:49 +02:00
|
|
|
#:use-module (guix build-system trivial)
|
2021-04-12 15:38:52 +02:00
|
|
|
#:use-module (guix transformations)
|
2021-12-20 09:26:50 +01:00
|
|
|
#:use-module (gnu packages)
|
2020-05-06 20:53:49 +02:00
|
|
|
#:use-module (gnu packages audio)
|
|
|
|
#:use-module (gnu packages base)
|
2020-09-13 04:44:54 +02:00
|
|
|
#:use-module (gnu packages bash)
|
2020-09-16 21:21:42 +02:00
|
|
|
#:use-module (gnu packages certs)
|
|
|
|
#:use-module (gnu packages compression)
|
2021-12-20 09:26:50 +01:00
|
|
|
#:use-module (gnu packages elf)
|
2020-09-16 21:21:42 +02:00
|
|
|
#:use-module (gnu packages file)
|
2020-05-06 20:53:49 +02:00
|
|
|
#:use-module (gnu packages fonts)
|
|
|
|
#:use-module (gnu packages fontutils)
|
2021-12-20 09:26:50 +01:00
|
|
|
#:use-module (gnu packages freedesktop)
|
2020-09-16 21:21:42 +02:00
|
|
|
#:use-module (gnu packages gawk)
|
2020-05-06 20:53:49 +02:00
|
|
|
#:use-module (gnu packages gcc)
|
|
|
|
#:use-module (gnu packages gl)
|
|
|
|
#:use-module (gnu packages glib)
|
2021-12-20 09:26:50 +01:00
|
|
|
#:use-module (gnu packages gnome)
|
2022-02-27 20:52:55 +01:00
|
|
|
#:use-module (gnu packages graphics)
|
2021-12-20 09:26:50 +01:00
|
|
|
#:use-module (gnu packages libbsd)
|
|
|
|
#:use-module (gnu packages libusb)
|
2020-09-16 21:21:42 +02:00
|
|
|
#:use-module (gnu packages linux)
|
2021-12-20 09:26:50 +01:00
|
|
|
#:use-module (gnu packages llvm)
|
2022-02-27 20:52:55 +01:00
|
|
|
#:use-module (gnu packages logging)
|
2021-04-12 15:38:52 +02:00
|
|
|
#:use-module (nongnu packages nvidia)
|
2021-12-20 09:26:50 +01:00
|
|
|
#:use-module (gnu packages pciutils)
|
2020-09-19 09:57:43 +02:00
|
|
|
#:use-module (gnu packages pulseaudio)
|
|
|
|
#:use-module (gnu packages python)
|
2022-08-12 21:01:50 +02:00
|
|
|
#:use-module (gnu packages python-web)
|
|
|
|
#:use-module (gnu packages python-xyz)
|
2022-02-27 20:52:55 +01:00
|
|
|
#:use-module (gnu packages toolkits)
|
2022-09-23 22:03:08 +02:00
|
|
|
#:use-module (gnu packages video)
|
2020-09-19 09:57:43 +02:00
|
|
|
#:use-module (nonguix utils))
|
2020-05-06 20:53:49 +02:00
|
|
|
|
2020-09-13 04:44:54 +02:00
|
|
|
(define-record-type* <nonguix-container>
|
|
|
|
nonguix-container make-nonguix-container
|
|
|
|
nonguix-container? this-nonguix-container
|
|
|
|
(name ngc-name)
|
|
|
|
(version ngc-version (default #f))
|
|
|
|
(wrap-package ngc-wrap-package)
|
|
|
|
(run ngc-run)
|
|
|
|
(wrapper-name ngc-wrapper-name (default "nonguix-container-wrapper"))
|
|
|
|
(manifest-name ngc-manifest-name (default "nonguix-container-manifest.scm"))
|
|
|
|
(internal-name ngc-internal-name (default "fhs-internal"))
|
|
|
|
(sandbox-home ngc-sandbox-home (default ".local/share/guix-sandbox-home"))
|
|
|
|
(union64 ngc-union64 (default '()))
|
|
|
|
(union32 ngc-union32 (default '()))
|
|
|
|
(preserved-env ngc-preserved-env (default '()))
|
|
|
|
(exposed ngc-exposed (default '()))
|
|
|
|
(shared ngc-shared (default '()))
|
|
|
|
(modules ngc-modules (default '()))
|
|
|
|
(packages ngc-packages (default '()))
|
2020-09-16 21:21:42 +02:00
|
|
|
(link-files ngc-link-files (default '()))
|
2020-09-13 04:44:54 +02:00
|
|
|
(home-page ngc-home-page (default #f))
|
|
|
|
(synopsis ngc-synopsis (default #f))
|
|
|
|
(description ngc-description (default #f))
|
|
|
|
(license ngc-license (default #f)))
|
|
|
|
|
|
|
|
(define steam-client
|
|
|
|
(package
|
|
|
|
(name "steam-client")
|
2022-09-01 20:55:57 +02:00
|
|
|
(version "1.0.0.75")
|
2020-09-13 04:44:54 +02:00
|
|
|
(source
|
|
|
|
(origin
|
|
|
|
(method url-fetch)
|
|
|
|
(uri (string-append "http://repo.steampowered.com/steam/archive/precise/steam_"
|
|
|
|
version ".tar.gz"))
|
|
|
|
(sha256
|
|
|
|
(base32
|
2022-09-01 20:55:57 +02:00
|
|
|
"19rn29slsxv7b5fisr1jzn79bskzifbj5hmxqn2436ivwfjna9g5"))
|
2020-09-13 04:44:54 +02:00
|
|
|
(file-name (string-append name "-" version ".tar.gz"))))
|
|
|
|
(build-system gnu-build-system)
|
|
|
|
(arguments
|
2021-12-20 09:26:50 +01:00
|
|
|
`(#:tests? #f ; There are no tests.
|
|
|
|
#:validate-runpath? #f ; Looks for bin/steam which doesn't exist.
|
2020-09-13 04:44:54 +02:00
|
|
|
#:make-flags
|
|
|
|
(list "PREFIX=" (string-append "DESTDIR=" (assoc-ref %outputs "out")))
|
|
|
|
#:phases
|
|
|
|
(modify-phases %standard-phases
|
2021-12-20 09:26:50 +01:00
|
|
|
(delete 'configure)
|
|
|
|
;; Patch Makefile so it creates links to the store rather than /lib.
|
|
|
|
(add-after 'unpack 'patch-makefile
|
2021-03-04 20:59:09 +01:00
|
|
|
(lambda _
|
2021-12-20 09:26:50 +01:00
|
|
|
(substitute* "Makefile"
|
|
|
|
(("-fns ")
|
|
|
|
"-fns $(DESTDIR)"))))
|
|
|
|
(delete 'patch-dot-desktop-files)
|
2020-09-13 04:44:54 +02:00
|
|
|
(add-after 'unpack 'patch-startscript
|
|
|
|
(lambda _
|
2021-12-20 09:26:50 +01:00
|
|
|
(substitute* "bin_steam.sh"
|
2021-01-08 02:05:19 +01:00
|
|
|
(("/usr") (assoc-ref %outputs "out")))))
|
2020-11-24 17:52:37 +01:00
|
|
|
(add-after 'patch-dot-desktop-files 'patch-desktop-file
|
2020-09-13 04:44:54 +02:00
|
|
|
(lambda _
|
2021-05-26 13:16:41 +02:00
|
|
|
(let ((path (string-append (assoc-ref %outputs "out")
|
|
|
|
"/share/applications/")))
|
|
|
|
(substitute* (string-append path "steam.desktop")
|
|
|
|
(("Exec=.*/steam") "Exec=steam"))
|
|
|
|
(copy-file (string-append path "steam.desktop")
|
|
|
|
(string-append path "steam-asound32.desktop"))
|
|
|
|
(substitute* (string-append path "steam-asound32.desktop")
|
|
|
|
(("Exec=steam %U") "Exec=steam %U -- --asound32")
|
|
|
|
(("Name=Steam") "Name=Steam (32-bit ALSA)")))))
|
2020-09-13 04:44:54 +02:00
|
|
|
;; Steamdeps installs missing packages, which doesn't work with Guix.
|
2021-01-08 02:05:19 +01:00
|
|
|
(add-after 'install-binaries 'post-install
|
|
|
|
(lambda* (#:key inputs outputs #:allow-other-keys)
|
|
|
|
(let ((out (assoc-ref %outputs "out")))
|
2021-12-20 09:26:50 +01:00
|
|
|
(delete-file (string-append out "/lib/steam/bin_steamdeps.py"))
|
|
|
|
(delete-file (string-append out "/bin/steamdeps"))))))))
|
2020-09-13 04:44:54 +02:00
|
|
|
(home-page "https://store.steampowered.com")
|
|
|
|
(synopsis "Digital distribution platform for managing and playing games")
|
|
|
|
(description "Steam is a digital software distribution platform created by Valve.")
|
|
|
|
(license (license:nonfree "file:///share/doc/steam/steam_subscriber_agreement.txt"))))
|
|
|
|
|
2021-12-20 09:26:50 +01:00
|
|
|
(define glibc-for-fhs
|
|
|
|
(package
|
|
|
|
(inherit glibc)
|
|
|
|
(name "glibc-for-fhs")
|
|
|
|
(source (origin (inherit (package-source glibc))
|
|
|
|
;; Remove Guix's patch to read ld.so.cache from /gnu/store
|
|
|
|
;; directories, re-enabling the default /etc/ld.so.cache
|
|
|
|
;; behavior.
|
|
|
|
(patches (delete (car (search-patches "glibc-dl-cache.patch"))
|
|
|
|
(origin-patches (package-source glibc))))))))
|
|
|
|
|
2022-01-31 17:47:41 +01:00
|
|
|
;; After guix commit to add a replacement for expat (security fixes),
|
|
|
|
;; https://git.savannah.gnu.org/cgit/guix.git/commit/?id=2045852b096131a714409aa0cc4fe17938f60b15
|
|
|
|
;; a profile collision happens with the propagated expat (now grafted) from
|
|
|
|
;; fontconfig. See upstream report https://issues.guix.gnu.org/53406
|
|
|
|
;; So we define a fontconfig variation that explicitly does the expat replacement
|
|
|
|
;; which works around this bug for now, at the cost of building fontconfig.
|
|
|
|
;; TODO: remove once upstream bug is fixed
|
|
|
|
(define fontconfig-fixed
|
|
|
|
(package
|
|
|
|
(inherit fontconfig)
|
|
|
|
(propagated-inputs
|
|
|
|
(modify-inputs (package-propagated-inputs fontconfig)
|
|
|
|
(replace "expat" (@@ (gnu packages xml) expat/fixed))))))
|
|
|
|
|
2020-09-13 04:44:54 +02:00
|
|
|
(define fhs-min-libs
|
2021-12-20 09:26:50 +01:00
|
|
|
`(("glibc" ,glibc-for-fhs)
|
2020-09-13 04:44:54 +02:00
|
|
|
("glibc-locales" ,glibc-locales)))
|
|
|
|
|
2020-05-06 20:53:49 +02:00
|
|
|
(define steam-client-libs
|
2020-09-16 02:37:12 +02:00
|
|
|
`(("bash" ,bash) ; Required for steam startup.
|
2020-09-16 21:21:42 +02:00
|
|
|
("coreutils" ,coreutils)
|
|
|
|
("diffutils" ,diffutils)
|
2020-09-16 02:37:12 +02:00
|
|
|
("dbus-glib" ,dbus-glib) ; Required for steam browser.
|
2021-12-20 09:26:50 +01:00
|
|
|
("elfutils" ,elfutils) ; Required for capturing library dependencies in pv.
|
|
|
|
("eudev" ,eudev) ; Required for steamwebhelper/heavy runtime.
|
2022-01-31 17:47:41 +01:00
|
|
|
;; TODO: set back to ,fontconfig once https://issues.guix.gnu.org/53406 is fixed
|
|
|
|
("fontconfig" ,fontconfig-fixed) ; Required for steam client.
|
2020-09-16 21:21:42 +02:00
|
|
|
("file" ,file) ; Used for steam installation.
|
2021-12-20 09:26:50 +01:00
|
|
|
("find" ,findutils) ; Required at least for some logging.
|
2020-09-16 02:37:12 +02:00
|
|
|
("freetype" ,freetype) ; Required for steam login.
|
2020-09-16 21:21:42 +02:00
|
|
|
("gawk" ,gawk)
|
2020-09-16 02:37:12 +02:00
|
|
|
("gcc:lib" ,gcc "lib") ; Required for steam startup.
|
2020-09-16 21:21:42 +02:00
|
|
|
("grep" ,grep)
|
2021-12-20 09:26:50 +01:00
|
|
|
("libbsd" ,libbsd)
|
|
|
|
("libcap" ,libcap) ; Required for SteamVR, but needs pkexec too.
|
|
|
|
("libusb" ,libusb) ; Required for SteamVR.
|
2022-09-23 22:03:08 +02:00
|
|
|
("libva" ,libva) ; Required for hardware video encoding/decoding.
|
|
|
|
("libvdpau" ,libvdpau) ; Required for hardware video encoding/decoding.
|
|
|
|
("libvdpau-va-gl" ,libvdpau-va-gl) ; Additional VDPAU support.
|
2021-12-20 09:26:50 +01:00
|
|
|
("llvm" ,llvm-11) ; Required for mesa.
|
2020-09-16 02:37:12 +02:00
|
|
|
("mesa" ,mesa) ; Required for steam startup.
|
2020-09-16 21:21:42 +02:00
|
|
|
("nss-certs" ,nss-certs) ; Required for steam login.
|
2021-12-20 09:26:50 +01:00
|
|
|
("pciutils" ,pciutils) ; Tries to run lspci at steam startup.
|
|
|
|
("procps" ,procps)
|
2020-09-16 21:21:42 +02:00
|
|
|
("sed" ,sed)
|
|
|
|
("tar" ,tar)
|
2021-12-20 09:26:50 +01:00
|
|
|
("usbutils" ,usbutils) ; Required for SteamVR.
|
2020-09-16 21:21:42 +02:00
|
|
|
("util-linux" ,util-linux) ; Required for steam login.
|
2021-12-20 09:26:50 +01:00
|
|
|
("wayland" ,wayland) ; Required for mesa vulkan (e.g. libvulkan_radeon).
|
2023-01-03 20:33:50 +01:00
|
|
|
("flatpak-xdg-utils" ,flatpak-xdg-utils)
|
2021-12-20 09:26:50 +01:00
|
|
|
("xz" ,xz)
|
|
|
|
("zenity" ,zenity))) ; Required for progress dialogs.
|
2020-05-06 20:53:49 +02:00
|
|
|
|
|
|
|
(define steam-gameruntime-libs
|
2020-09-16 02:37:12 +02:00
|
|
|
`(("alsa-lib" ,alsa-lib) ; Required for audio in most games.
|
|
|
|
("alsa-plugins:pulseaudio" ,alsa-plugins "pulseaudio") ; Required for audio in most games.
|
2020-09-13 04:44:54 +02:00
|
|
|
("font-dejavu" ,font-dejavu)
|
|
|
|
("font-liberation" ,font-liberation)
|
2022-02-27 20:52:55 +01:00
|
|
|
("imgui" ,imgui-1.86) ; Required for MangoHud.
|
|
|
|
("mangohud" ,mangohud)
|
2020-09-19 09:57:43 +02:00
|
|
|
("openal" ,openal) ; Prevents corrupt audio in Crypt of the Necrodancer.
|
|
|
|
("pulseaudio" ,pulseaudio) ; Prevents corrupt audio in Sven Coop.
|
2022-02-27 20:52:55 +01:00
|
|
|
("python" ,python) ; Required for KillingFloor2 and Wreckfest.
|
|
|
|
("spdlog" ,spdlog))) ; Required for MangoHud.
|
2020-05-06 20:53:49 +02:00
|
|
|
|
2020-09-13 04:44:54 +02:00
|
|
|
(define* (fhs-union inputs #:key (name "fhs-union") (version "0.0") (system "x86_64-linux"))
|
|
|
|
"Create a package housing the union of inputs."
|
2020-09-05 19:23:47 +02:00
|
|
|
(package
|
2020-09-13 04:44:54 +02:00
|
|
|
(name name)
|
|
|
|
(version version)
|
2020-09-05 19:23:47 +02:00
|
|
|
(source #f)
|
2020-09-13 04:44:54 +02:00
|
|
|
(inputs inputs)
|
2020-09-05 19:23:47 +02:00
|
|
|
(build-system trivial-build-system)
|
|
|
|
(arguments
|
2020-09-13 04:44:54 +02:00
|
|
|
`(#:system ,system
|
2020-09-05 19:23:47 +02:00
|
|
|
#:modules ((guix build union))
|
|
|
|
#:builder
|
|
|
|
(begin
|
|
|
|
(use-modules (ice-9 match)
|
|
|
|
(guix build union))
|
|
|
|
(match %build-inputs
|
2020-09-14 23:59:05 +02:00
|
|
|
(((_ . directories) ...)
|
2020-09-05 19:23:47 +02:00
|
|
|
(union-build (assoc-ref %outputs "out")
|
|
|
|
directories)
|
|
|
|
#t)))))
|
|
|
|
(home-page #f)
|
2020-09-13 04:44:54 +02:00
|
|
|
(synopsis "Libraries used for FHS")
|
|
|
|
(description "Libraries needed to build a guix container FHS.")
|
2020-09-05 19:23:47 +02:00
|
|
|
(license #f)))
|
2020-05-06 20:53:49 +02:00
|
|
|
|
2021-12-20 09:26:50 +01:00
|
|
|
(define (ld.so.conf->ld.so.cache ld-conf)
|
|
|
|
"Create a ld.so.cache file-like object from an ld.so.conf file."
|
|
|
|
(computed-file
|
|
|
|
"ld.so.cache"
|
|
|
|
(with-imported-modules
|
|
|
|
`((guix build utils))
|
|
|
|
#~(begin
|
|
|
|
(use-modules (guix build utils))
|
|
|
|
(let ((ldconfig (string-append #$glibc "/sbin/ldconfig")))
|
|
|
|
(invoke ldconfig
|
|
|
|
"-X" ; Don't update symbolic links.
|
|
|
|
"-f" #$ld-conf ; Use #$ld-conf as configuration file.
|
|
|
|
"-C" #$output)))))) ; Use #$output as cache file.
|
|
|
|
|
|
|
|
(define (packages->ld.so.conf packages)
|
|
|
|
"Takes a list of package objects and returns a file-like object for ld.so.conf
|
|
|
|
in the Guix store"
|
|
|
|
(computed-file
|
|
|
|
"ld.so.conf"
|
|
|
|
(with-imported-modules
|
|
|
|
`((guix build union)
|
|
|
|
(guix build utils))
|
|
|
|
#~(begin
|
|
|
|
(use-modules (guix build union)
|
|
|
|
(guix build utils))
|
|
|
|
;; Need to quote "#$packages" as #$packages tries to "apply" the first item to the rest, like a procedure.
|
|
|
|
(let* ((packages '#$packages)
|
|
|
|
;; Add "/lib" to each package.
|
|
|
|
;; TODO Make this more general for other needed directories.
|
|
|
|
(dirs-lib
|
|
|
|
(lambda (packages)
|
|
|
|
(map (lambda (package)
|
|
|
|
(string-append package "/lib"))
|
|
|
|
packages)))
|
|
|
|
(fhs-lib-dirs
|
|
|
|
(dirs-lib packages)))
|
|
|
|
(call-with-output-file #$output
|
|
|
|
(lambda (port)
|
|
|
|
(for-each (lambda (directory)
|
|
|
|
(display directory port)
|
|
|
|
(newline port))
|
|
|
|
fhs-lib-dirs)))
|
|
|
|
#$output)))))
|
|
|
|
|
|
|
|
(define steam-ld.so.conf
|
|
|
|
(packages->ld.so.conf
|
|
|
|
(list (fhs-union `(,@steam-client-libs
|
|
|
|
,@steam-gameruntime-libs
|
|
|
|
,@fhs-min-libs)
|
|
|
|
#:name "fhs-union-64")
|
|
|
|
(fhs-union `(,@steam-client-libs
|
|
|
|
,@steam-gameruntime-libs
|
|
|
|
,@fhs-min-libs)
|
|
|
|
#:name "fhs-union-32"
|
|
|
|
#:system "i686-linux"))))
|
|
|
|
|
|
|
|
(define steam-ld.so.cache
|
|
|
|
(ld.so.conf->ld.so.cache steam-ld.so.conf))
|
|
|
|
|
2020-09-13 04:44:54 +02:00
|
|
|
(define (nonguix-container->package container)
|
2020-09-14 00:29:18 +02:00
|
|
|
"Return a package with wrapper script to launch the supplied container object
|
|
|
|
in a sandboxed FHS environment."
|
2021-05-26 13:16:41 +02:00
|
|
|
(let* ((fhs-internal (make-container-internal container))
|
2020-09-13 04:44:54 +02:00
|
|
|
(fhs-manifest (make-container-manifest container fhs-internal))
|
|
|
|
(fhs-wrapper (make-container-wrapper container fhs-manifest fhs-internal))
|
|
|
|
(pkg (ngc-wrap-package container)))
|
|
|
|
(package
|
2020-09-14 23:59:05 +02:00
|
|
|
(name (ngc-name container))
|
2020-09-13 04:44:54 +02:00
|
|
|
(version (or (ngc-version container)
|
|
|
|
(package-version pkg)))
|
|
|
|
(source #f)
|
2021-05-26 13:16:41 +02:00
|
|
|
(inputs `(("wrap-package" ,(ngc-wrap-package container))
|
2020-09-16 21:21:42 +02:00
|
|
|
,@(if (null? (ngc-union64 container))
|
2020-09-14 23:59:05 +02:00
|
|
|
'()
|
|
|
|
`(("fhs-union-64" ,(ngc-union64 container))))
|
|
|
|
,@(if (null? (ngc-union32 container))
|
|
|
|
'()
|
|
|
|
`(("fhs-union-32" ,(ngc-union32 container))))
|
|
|
|
("fhs-internal" ,fhs-internal)
|
|
|
|
("fhs-wrapper" ,fhs-wrapper)
|
|
|
|
("fhs-manifest" ,fhs-manifest)))
|
2020-09-13 04:44:54 +02:00
|
|
|
(build-system trivial-build-system)
|
|
|
|
(arguments
|
|
|
|
`(#:modules ((guix build utils))
|
|
|
|
#:builder
|
|
|
|
(begin
|
|
|
|
(use-modules (guix build utils))
|
2020-09-14 23:59:05 +02:00
|
|
|
(let* ((out (assoc-ref %outputs "out"))
|
|
|
|
(internal-target (string-append (assoc-ref %build-inputs "fhs-internal")
|
|
|
|
"/bin/" ,(ngc-internal-name container)))
|
|
|
|
(internal-dest (string-append out "/sbin/" ,(ngc-internal-name container)))
|
|
|
|
(manifest-target (assoc-ref %build-inputs "fhs-manifest"))
|
|
|
|
(manifest-dest (string-append out "/etc/" ,(ngc-manifest-name container)))
|
2020-09-13 04:44:54 +02:00
|
|
|
(wrapper-target (assoc-ref %build-inputs "fhs-wrapper"))
|
2020-09-16 21:21:42 +02:00
|
|
|
(wrapper-dest (string-append out "/bin/" ,(ngc-name container)))
|
|
|
|
(link-files ',(ngc-link-files container)))
|
2020-09-14 23:59:05 +02:00
|
|
|
(mkdir-p (string-append out "/sbin"))
|
|
|
|
(mkdir-p (string-append out "/etc"))
|
|
|
|
(mkdir-p (string-append out "/bin"))
|
|
|
|
(symlink internal-target internal-dest)
|
|
|
|
(symlink wrapper-target wrapper-dest)
|
2020-09-16 21:21:42 +02:00
|
|
|
(symlink manifest-target manifest-dest)
|
|
|
|
(for-each
|
|
|
|
(lambda (link)
|
|
|
|
(mkdir-p (dirname (string-append out "/" link)))
|
|
|
|
(symlink (string-append (assoc-ref %build-inputs "wrap-package")
|
|
|
|
"/" link)
|
|
|
|
(string-append out "/" link)))
|
|
|
|
link-files)))))
|
2020-09-13 04:44:54 +02:00
|
|
|
(home-page (or (ngc-home-page container)
|
|
|
|
(package-home-page pkg)))
|
|
|
|
(synopsis (or (ngc-synopsis container)
|
|
|
|
(package-synopsis pkg)))
|
|
|
|
(description (or (ngc-description container)
|
|
|
|
(package-description pkg)))
|
|
|
|
(license (or (ngc-license container)
|
|
|
|
(package-license pkg))))))
|
2020-05-06 20:53:49 +02:00
|
|
|
|
2020-09-13 04:44:54 +02:00
|
|
|
(define (make-container-wrapper container fhs-manifest fhs-internal)
|
2020-09-14 00:29:18 +02:00
|
|
|
"Return a script file-like object that launches the supplied container object
|
|
|
|
in a sandboxed FHS environment."
|
2020-09-13 04:44:54 +02:00
|
|
|
(program-file
|
|
|
|
(ngc-wrapper-name container)
|
|
|
|
(with-imported-modules
|
|
|
|
`((guix build utils))
|
|
|
|
#~(begin
|
|
|
|
(use-modules (guix build utils))
|
|
|
|
(define (preserve-var var)
|
|
|
|
(string-append "--preserve=" var))
|
|
|
|
(define* (add-path path #:key writable?)
|
|
|
|
(let ((opt (if writable?
|
|
|
|
"--share="
|
|
|
|
"--expose=")))
|
|
|
|
(if (pair? path)
|
|
|
|
(string-append opt (car path) "=" (cdr path))
|
|
|
|
(string-append opt path))))
|
|
|
|
(define (exists-> file)
|
|
|
|
(if (and file (file-exists? file))
|
|
|
|
`(,file) '()))
|
2021-03-05 19:40:43 +01:00
|
|
|
(let* ((run #$(file-append fhs-internal "/bin/" (ngc-internal-name container)))
|
2020-09-13 04:44:54 +02:00
|
|
|
(manifest-file #$(file-append fhs-manifest))
|
2021-03-05 19:40:43 +01:00
|
|
|
(xdg-runtime (getenv "XDG_RUNTIME_DIR"))
|
2020-09-13 04:44:54 +02:00
|
|
|
(home (getenv "HOME"))
|
2021-10-17 21:16:38 +02:00
|
|
|
(sandbox-home (or (getenv "GUIX_SANDBOX_HOME")
|
|
|
|
(string-append home "/" #$(ngc-sandbox-home container))))
|
2021-03-10 04:41:30 +01:00
|
|
|
(preserved-env '("^DBUS_"
|
|
|
|
"^DISPLAY$"
|
|
|
|
"^DRI_PRIME$"
|
2022-12-27 22:38:30 +01:00
|
|
|
"^GDK_SCALE$" ; For Steam UI scaling.
|
2021-12-20 09:26:50 +01:00
|
|
|
"^PRESSURE_VESSEL_" ; For pressure vessel options.
|
2021-03-10 04:41:30 +01:00
|
|
|
"_PROXY$"
|
|
|
|
"_proxy$"
|
|
|
|
"^SDL_"
|
|
|
|
"^STEAM_"
|
2022-09-23 22:03:08 +02:00
|
|
|
"^VDPAU_DRIVER_PATH$" ; For VDPAU drivers.
|
2021-03-10 04:41:30 +01:00
|
|
|
"^XAUTHORITY$"
|
2021-03-10 23:02:09 +01:00
|
|
|
;; Matching all ^XDG_ vars causes issues
|
|
|
|
;; discussed in 80decf05.
|
|
|
|
"^XDG_DATA_HOME$"
|
2021-12-20 09:26:50 +01:00
|
|
|
"^XDG_RUNTIME_DIR$"
|
|
|
|
;; The following are useful for debugging.
|
|
|
|
"^CAPSULE_DEBUG$"
|
|
|
|
"^G_MESSAGES_DEBUG$"
|
|
|
|
"^LD_DEBUG$"
|
|
|
|
"^LIBGL_DEBUG$"))
|
|
|
|
(expose `("/dev/bus/usb" ; Needed for libusb.
|
|
|
|
"/dev/dri"
|
2020-09-13 04:44:54 +02:00
|
|
|
"/dev/input" ; Needed for controller input.
|
2022-08-12 20:42:37 +02:00
|
|
|
"/dev/uinput" ; Needed for Steam Input.
|
2021-02-06 18:09:37 +01:00
|
|
|
,@(exists-> "/dev/nvidia0") ; needed for nvidia proprietary driver
|
|
|
|
,@(exists-> "/dev/nvidiactl")
|
|
|
|
,@(exists-> "/dev/nvidia-modeset")
|
2021-12-20 09:26:50 +01:00
|
|
|
,@(exists-> "/etc/machine-id")
|
2022-02-24 01:23:36 +01:00
|
|
|
"/etc/localtime" ; Needed for correct time zone.
|
2022-02-27 20:52:55 +01:00
|
|
|
"/sys/class/drm" ; Needed for hw monitoring like MangoHud.
|
|
|
|
"/sys/class/hwmon" ; Needed for hw monitoring like MangoHud.
|
2021-12-20 09:26:50 +01:00
|
|
|
"/sys/class/hidraw" ; Needed for devices like the Valve Index.
|
|
|
|
"/sys/class/input" ; Needed for controller input.
|
2022-09-16 17:12:20 +02:00
|
|
|
,@(exists-> "/sys/class/power_supply") ; Needed for power monitoring like MangoHud.
|
2022-02-27 20:52:55 +01:00
|
|
|
,@(exists-> "/sys/class/powercap") ; Needed for power monitoring like MangoHud.
|
2021-12-20 09:26:50 +01:00
|
|
|
"/sys/dev"
|
2020-09-13 04:44:54 +02:00
|
|
|
"/sys/devices"
|
2021-07-01 20:33:59 +02:00
|
|
|
,@(exists-> "/var/run/dbus")))
|
2021-12-20 09:26:50 +01:00
|
|
|
;; /dev/hidraw is needed for SteamVR to access the HMD, although here we
|
|
|
|
;; share all hidraw devices. Instead we could filter to only share specific
|
|
|
|
;; device. See, for example, this script:
|
|
|
|
;; https://arvchristos.github.io/post/matching-dev-hidraw-devices-with-physical-devices/
|
|
|
|
(share `(,@(find-files "/dev" "hidraw")
|
|
|
|
"/dev/shm"
|
|
|
|
;; "/tmp/.X11-unix" is needed for bwrap, and "/tmp" more generally
|
|
|
|
;; for writing things like crash dumps and "steam_chrome_shm".
|
|
|
|
"/tmp"
|
2020-09-13 04:44:54 +02:00
|
|
|
,(string-append sandbox-home "=" home)
|
|
|
|
,@(exists-> (string-append home "/.config/pulse"))
|
2021-03-05 19:40:43 +01:00
|
|
|
,@(exists-> (string-append xdg-runtime "/pulse"))
|
|
|
|
,@(exists-> (string-append xdg-runtime "/bus"))
|
2020-09-13 04:44:54 +02:00
|
|
|
,@(exists-> (getenv "XAUTHORITY"))))
|
|
|
|
(DEBUG (equal? (getenv "DEBUG") "1"))
|
2020-09-14 23:59:05 +02:00
|
|
|
(args (cdr (command-line)))
|
2020-09-13 04:44:54 +02:00
|
|
|
(command (if DEBUG '()
|
2020-09-14 23:59:05 +02:00
|
|
|
`("--" ,run ,@args))))
|
2021-12-20 09:26:50 +01:00
|
|
|
;; TODO: Remove once upstream change is merged and in stable pressure-vessel
|
|
|
|
;; (although may want to hold off for anyone using older pressure-vessel versions
|
|
|
|
;; for whatever reason), see:
|
|
|
|
;; https://gitlab.steamos.cloud/steamrt/steam-runtime-tools/-/merge_requests/406
|
|
|
|
(setenv "PRESSURE_VESSEL_FILESYSTEMS_RO" "/gnu/store")
|
2022-09-23 22:03:08 +02:00
|
|
|
;; By default VDPAU drivers are searched for in libvdpau's store
|
|
|
|
;; path, so set this path to where the drivers will actually be
|
|
|
|
;; located in the container.
|
|
|
|
(setenv "VDPAU_DRIVER_PATH" "/lib64/vdpau")
|
2020-09-13 04:44:54 +02:00
|
|
|
(format #t "\n* Launching ~a in sandbox: ~a.\n\n"
|
|
|
|
#$(package-name (ngc-wrap-package container)) sandbox-home)
|
|
|
|
(when DEBUG
|
|
|
|
(format #t "* DEBUG set to 1: Starting shell. Launch application manually with: ~a.\n\n"
|
|
|
|
#$(ngc-internal-name container)))
|
|
|
|
(mkdir-p sandbox-home)
|
2021-03-08 23:50:29 +01:00
|
|
|
(invoke #$(file-append pulseaudio "/bin/pulseaudio")
|
|
|
|
"--start"
|
|
|
|
"--exit-idle-time=60")
|
|
|
|
(apply invoke
|
2021-10-28 20:38:51 +02:00
|
|
|
`("guix" "shell"
|
|
|
|
"--container" "--no-cwd" "--network"
|
2020-09-13 04:44:54 +02:00
|
|
|
,@(map preserve-var preserved-env)
|
|
|
|
,@(map add-path expose)
|
|
|
|
,@(map (lambda (item)
|
|
|
|
(add-path item #:writable? #t))
|
|
|
|
share)
|
|
|
|
"-m" ,manifest-file
|
|
|
|
,@command)))))))
|
2020-05-06 20:53:49 +02:00
|
|
|
|
2020-09-13 04:44:54 +02:00
|
|
|
(define (make-container-manifest container fhs-internal)
|
2020-09-14 00:29:18 +02:00
|
|
|
"Return a scheme file-like object to be used as package manifest for FHS
|
2020-09-14 23:59:05 +02:00
|
|
|
containers. This manifest will use the 'modules' and 'packages' fields
|
|
|
|
specified in the container object, and will also include the exact store paths
|
|
|
|
of the containers 'wrap-package', 'union32', and 'union64' fields, as well as
|
|
|
|
the exact path for the fhs-internal package."
|
2020-09-13 04:44:54 +02:00
|
|
|
(scheme-file
|
|
|
|
(ngc-manifest-name container)
|
|
|
|
#~(begin
|
|
|
|
(use-package-modules
|
|
|
|
#$@(ngc-modules container))
|
|
|
|
(use-modules (guix gexp)
|
|
|
|
(guix utils)
|
|
|
|
(guix profiles)
|
|
|
|
(guix store)
|
|
|
|
(guix scripts package)
|
|
|
|
(srfi srfi-11))
|
2020-09-04 04:22:43 +02:00
|
|
|
|
2020-09-13 04:44:54 +02:00
|
|
|
;; Copied from guix/scripts/package.scm.
|
|
|
|
(define (store-item->manifest-entry item)
|
|
|
|
"Return a manifest entry for ITEM, a \"/gnu/store/...\" file name."
|
|
|
|
(let-values (((name version)
|
|
|
|
(package-name->name+version (store-path-package-name item)
|
|
|
|
#\-)))
|
|
|
|
(manifest-entry
|
|
|
|
(name name)
|
|
|
|
(version version)
|
|
|
|
(output "out") ;XXX: wild guess
|
|
|
|
(item item))))
|
2020-09-04 04:22:43 +02:00
|
|
|
|
2020-09-13 04:44:54 +02:00
|
|
|
(manifest-add
|
|
|
|
(packages->manifest (list #$@(ngc-packages container)))
|
|
|
|
(map store-item->manifest-entry
|
|
|
|
'(#$(file-append (ngc-wrap-package container))
|
|
|
|
#$(file-append (ngc-union64 container))
|
|
|
|
#$(file-append (ngc-union32 container))
|
|
|
|
#$(file-append fhs-internal)))))))
|
2020-05-06 20:53:49 +02:00
|
|
|
|
2021-05-26 13:16:41 +02:00
|
|
|
(define (make-container-internal container)
|
2020-09-14 00:29:18 +02:00
|
|
|
"Return a dummy package housing the fhs-internal script."
|
2020-09-13 04:44:54 +02:00
|
|
|
(package
|
|
|
|
(name (ngc-internal-name container))
|
2020-09-13 05:55:26 +02:00
|
|
|
(version (or (ngc-version container)
|
|
|
|
(package-version (ngc-wrap-package container))))
|
2020-09-13 04:44:54 +02:00
|
|
|
(source #f)
|
2021-05-26 13:16:41 +02:00
|
|
|
(inputs `(("fhs-internal-script" ,(make-internal-script container))))
|
2020-09-13 04:44:54 +02:00
|
|
|
(build-system trivial-build-system)
|
|
|
|
(arguments
|
|
|
|
`(#:modules ((guix build utils))
|
|
|
|
#:builder
|
|
|
|
(begin
|
|
|
|
(use-modules (guix build utils))
|
|
|
|
(let* ((bin (string-append (assoc-ref %outputs "out") "/bin"))
|
|
|
|
(internal-target (assoc-ref %build-inputs "fhs-internal-script"))
|
|
|
|
(internal-dest (string-append bin "/" ,(ngc-internal-name container))))
|
|
|
|
(mkdir-p bin)
|
|
|
|
(symlink internal-target internal-dest)))))
|
|
|
|
(home-page #f)
|
2020-09-14 23:59:05 +02:00
|
|
|
(synopsis "Script used to set up sandbox")
|
|
|
|
(description "Script used inside the FHS Guix container to set up the
|
2020-09-13 04:44:54 +02:00
|
|
|
environment.")
|
|
|
|
(license #f)))
|
2020-05-06 20:53:49 +02:00
|
|
|
|
2021-05-26 13:16:41 +02:00
|
|
|
(define (make-internal-script container)
|
2020-09-14 00:29:18 +02:00
|
|
|
"Return an fhs-internal script which is used to perform additional steps to
|
|
|
|
set up the environment inside an FHS container before launching the desired
|
|
|
|
application."
|
2021-12-20 09:26:50 +01:00
|
|
|
;; The ld cache is not created inside the container, meaning the paths it
|
|
|
|
;; contains are directly to /gnu/store/. Instead, it could be generated with
|
|
|
|
;; a generic ld.so.conf and result in paths more typical in an FHS distro,
|
|
|
|
;; like /lib within the container. This may be useful for future compatibility.
|
|
|
|
(let* ((ld.so.conf steam-ld.so.conf)
|
|
|
|
(ld.so.cache steam-ld.so.cache)
|
|
|
|
(pkg (ngc-wrap-package container))
|
2020-09-13 04:44:54 +02:00
|
|
|
(run (ngc-run container)))
|
|
|
|
(program-file
|
|
|
|
(ngc-internal-name container)
|
|
|
|
(with-imported-modules
|
2022-06-30 21:38:54 +02:00
|
|
|
`((guix build utils))
|
2020-09-13 04:44:54 +02:00
|
|
|
#~(begin
|
2021-05-26 13:16:41 +02:00
|
|
|
(use-modules (guix build utils)
|
|
|
|
(ice-9 getopt-long))
|
2020-09-19 09:57:43 +02:00
|
|
|
(define (path->str path)
|
|
|
|
(if (list? path)
|
|
|
|
(string-join path "/")
|
|
|
|
path))
|
|
|
|
(define (new-symlink pair)
|
|
|
|
(let ((target (path->str (car pair)))
|
|
|
|
(dest (path->str (cdr pair))))
|
|
|
|
(unless (file-exists? dest)
|
|
|
|
(symlink target dest))))
|
|
|
|
(define (icd-symlink file)
|
|
|
|
(new-symlink
|
|
|
|
`(,file . ("/usr/share/vulkan/icd.d" ,(basename file)))))
|
2021-05-26 13:16:41 +02:00
|
|
|
(define fhs-option-spec
|
|
|
|
'((asound32 (value #f))))
|
|
|
|
(let* ((guix-env (getenv "GUIX_ENVIRONMENT"))
|
|
|
|
(union64 #$(file-append (ngc-union64 container)))
|
|
|
|
(union32 #$(file-append (ngc-union32 container)))
|
2021-12-20 09:26:50 +01:00
|
|
|
(ld.so.conf #$(file-append ld.so.conf))
|
|
|
|
(ld.so.cache #$(file-append ld.so.cache))
|
2021-05-26 13:16:41 +02:00
|
|
|
(all-args (cdr (command-line)))
|
|
|
|
(fhs-args (member "--" all-args))
|
|
|
|
(steam-args (if fhs-args
|
|
|
|
(reverse (cdr (member "--" (reverse all-args))))
|
|
|
|
all-args)))
|
2020-09-19 09:57:43 +02:00
|
|
|
(delete-file "/bin/sh")
|
|
|
|
(rmdir "/bin")
|
|
|
|
(for-each
|
|
|
|
mkdir-p
|
|
|
|
'("/run/current-system/profile/etc"
|
|
|
|
"/run/current-system/profile/share"
|
|
|
|
"/sbin"
|
2022-02-27 20:52:55 +01:00
|
|
|
"/usr/share/vulkan/icd.d"
|
|
|
|
"/usr/share/vulkan/implicit_layer.d")) ; Implicit layers like MangoHud
|
2020-09-19 09:57:43 +02:00
|
|
|
(for-each
|
|
|
|
new-symlink
|
2021-12-20 09:26:50 +01:00
|
|
|
`((,ld.so.cache . "/etc/ld.so.cache")
|
|
|
|
(,ld.so.conf . "/etc/ld.so.conf") ;; needed?
|
|
|
|
((,guix-env "etc/ssl") . "/etc/ssl")
|
2020-09-19 09:57:43 +02:00
|
|
|
((,guix-env "etc/ssl") . "/run/current-system/profile/etc/ssl")
|
|
|
|
((,union32 "lib") . "/lib")
|
|
|
|
((,union32 "lib") . "/run/current-system/profile/lib")
|
|
|
|
((,union64 "bin") . "/bin")
|
2021-12-20 09:26:50 +01:00
|
|
|
((,union64 "bin") . "/usr/bin") ; Steam hardcodes some paths like xdg-open.
|
2020-09-19 09:57:43 +02:00
|
|
|
((,union64 "lib") . "/lib64")
|
|
|
|
((,union64 "lib") . "/run/current-system/profile/lib64")
|
|
|
|
((,union64 "lib/locale") . "/run/current-system/locale")
|
|
|
|
((,union64 "sbin/ldconfig") . "/sbin/ldconfig")
|
|
|
|
((,union64 "share/drirc.d") . "/usr/share/drirc.d")
|
|
|
|
((,union64 "share/fonts") . "/run/current-system/profile/share/fonts")
|
2021-12-20 09:26:50 +01:00
|
|
|
((,union64 "etc/fonts") . "/etc/fonts")
|
2020-09-19 09:57:43 +02:00
|
|
|
((,union64 "share/vulkan/explicit_layer.d") .
|
2022-02-27 20:52:55 +01:00
|
|
|
"/usr/share/vulkan/explicit_layer.d")
|
|
|
|
;; The MangoHud layer has the same file name for 64- and 32-bit,
|
|
|
|
;; so create links with different names.
|
|
|
|
((,union64 "share/vulkan/implicit_layer.d/MangoHud.json") .
|
|
|
|
"/usr/share/vulkan/implicit_layer.d/MangoHud.json")
|
|
|
|
((,union32 "share/vulkan/implicit_layer.d/MangoHud.json") .
|
|
|
|
"/usr/share/vulkan/implicit_layer.d/MangoHud.x86.json")))
|
2020-09-19 09:57:43 +02:00
|
|
|
(for-each
|
|
|
|
icd-symlink
|
2022-02-27 20:52:55 +01:00
|
|
|
;; Use stat to follow links from packages like MangoHud.
|
2020-09-19 09:57:43 +02:00
|
|
|
`(,@(find-files (string-append union32 "/share/vulkan/icd.d")
|
2022-02-27 20:52:55 +01:00
|
|
|
#:directories? #t #:stat stat)
|
2020-09-19 09:57:43 +02:00
|
|
|
,@(find-files (string-append union64 "/share/vulkan/icd.d")
|
2022-02-27 20:52:55 +01:00
|
|
|
#:directories? #t #:stat stat)))
|
2021-12-20 09:26:50 +01:00
|
|
|
;; TODO: Is this the right place for this?
|
|
|
|
;; Newer versions of Steam won't startup if they can't copy to here
|
|
|
|
;; (previous would output this error but continue).
|
|
|
|
(if (file-exists? ".steam/root/bootstrap.tar.xz")
|
|
|
|
(chmod ".steam/root/bootstrap.tar.xz" #o644))
|
2021-05-26 13:16:41 +02:00
|
|
|
|
2021-12-20 09:26:50 +01:00
|
|
|
;; Process FHS-specific command line options.
|
2021-05-26 13:16:41 +02:00
|
|
|
(let* ((options (getopt-long (or fhs-args '("")) fhs-option-spec))
|
|
|
|
(asound32-opt (option-ref options 'asound32 #f))
|
|
|
|
(asound-lib (if asound32-opt "lib" "lib64")))
|
|
|
|
(if asound32-opt
|
|
|
|
(display "\n\n/etc/asound.conf configured for 32-bit.\n\n\n")
|
|
|
|
(display "\n\n/etc/asound.conf configured for 64-bit.\nLaunch steam with \"steam -- --asound32\" to use 32-bit instead.\n\n\n"))
|
|
|
|
(with-output-to-file "/etc/asound.conf"
|
|
|
|
(lambda _ (format (current-output-port) "# Generated by steam-client
|
|
|
|
|
|
|
|
# Use PulseAudio by default
|
|
|
|
pcm_type.pulse {
|
|
|
|
lib \"/~a/alsa-lib/libasound_module_pcm_pulse.so\"
|
|
|
|
}
|
|
|
|
|
|
|
|
ctl_type.pulse {
|
|
|
|
lib \"/~a/alsa-lib/libasound_module_ctl_pulse.so\"
|
|
|
|
}
|
|
|
|
|
|
|
|
pcm.!default {
|
|
|
|
type pulse
|
|
|
|
fallback \"sysdefault\"
|
|
|
|
hint {
|
|
|
|
show on
|
|
|
|
description \"Default ALSA Output (currently PulseAudio Sound Server)\"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ctl.!default {
|
|
|
|
type pulse
|
|
|
|
fallback \"sysdefault\"
|
|
|
|
}\n\n" asound-lib asound-lib))))
|
|
|
|
|
|
|
|
(apply system* `(#$(file-append pkg run) ,@steam-args))))))))
|
2020-05-06 20:53:49 +02:00
|
|
|
|
2020-09-13 04:44:54 +02:00
|
|
|
(define-public steam
|
|
|
|
(nonguix-container->package
|
|
|
|
(nonguix-container
|
|
|
|
(name "steam")
|
|
|
|
(wrap-package steam-client)
|
2021-12-20 09:26:50 +01:00
|
|
|
(run "/bin/steam")
|
2020-09-13 04:44:54 +02:00
|
|
|
(union64
|
|
|
|
(fhs-union `(,@steam-client-libs
|
|
|
|
,@steam-gameruntime-libs
|
|
|
|
,@fhs-min-libs)
|
|
|
|
#:name "fhs-union-64"))
|
|
|
|
(union32
|
|
|
|
(fhs-union `(,@steam-client-libs
|
|
|
|
,@steam-gameruntime-libs
|
|
|
|
,@fhs-min-libs)
|
|
|
|
#:name "fhs-union-32"
|
|
|
|
#:system "i686-linux"))
|
2021-05-26 13:16:41 +02:00
|
|
|
(link-files '("share/applications/steam.desktop"
|
|
|
|
"share/applications/steam-asound32.desktop"))
|
2020-05-06 20:53:49 +02:00
|
|
|
(description "Steam is a digital software distribution platform created by
|
2020-09-13 04:44:54 +02:00
|
|
|
Valve. This package provides a script for launching Steam in a Guix container
|
|
|
|
which will use the directory @file{$HOME/.local/share/guix-sandbox-home} where
|
|
|
|
all games will be installed."))))
|
2021-04-12 15:38:52 +02:00
|
|
|
|
|
|
|
(define-public steam-nvidia
|
|
|
|
(nonguix-container->package
|
|
|
|
(nonguix-container
|
|
|
|
(name "steam-nvidia")
|
|
|
|
(wrap-package steam-client)
|
2021-12-20 09:26:50 +01:00
|
|
|
(run "/bin/steam")
|
2021-04-12 15:38:52 +02:00
|
|
|
(union64
|
|
|
|
(replace-mesa
|
|
|
|
(fhs-union `(,@steam-client-libs
|
|
|
|
,@steam-gameruntime-libs
|
|
|
|
,@fhs-min-libs)
|
|
|
|
#:name "fhs-union-64")))
|
|
|
|
(union32
|
|
|
|
(replace-mesa
|
|
|
|
(fhs-union `(,@steam-client-libs
|
|
|
|
,@steam-gameruntime-libs
|
|
|
|
,@fhs-min-libs)
|
|
|
|
#:name "fhs-union-32"
|
|
|
|
#:system "i686-linux")))
|
2021-05-28 07:48:03 +02:00
|
|
|
(link-files '("share/applications/steam.desktop"
|
|
|
|
"share/applications/steam-asound32.desktop"))
|
2021-04-12 15:38:52 +02:00
|
|
|
(description "Steam is a digital software distribution platform created by
|
|
|
|
Valve. This package provides a script for launching Steam in a Guix container
|
|
|
|
which will use the directory @file{$HOME/.local/share/guix-sandbox-home} where
|
|
|
|
all games will be installed."))))
|
2022-08-12 21:01:50 +02:00
|
|
|
|
|
|
|
(define-public protonup-ng
|
|
|
|
(package
|
|
|
|
(name "protonup-ng")
|
|
|
|
(version "0.2.1")
|
|
|
|
(source
|
|
|
|
(origin
|
|
|
|
(method git-fetch)
|
|
|
|
(uri (git-reference
|
|
|
|
(url "https://github.com/cloudishBenne/protonup-ng")
|
|
|
|
(commit version)))
|
|
|
|
(file-name (git-file-name name version))
|
|
|
|
(sha256
|
|
|
|
(base32 "0yd2mhhqxzarqxk85zf42s931jzc94f1cssn1hblsqghr79laa45"))))
|
|
|
|
(build-system python-build-system)
|
|
|
|
(arguments
|
|
|
|
(list #:tests? #f)) ; there are no tests
|
|
|
|
(inputs
|
|
|
|
(list python-configparser python-requests))
|
|
|
|
(home-page "https://github.com/cloudishBenne/protonup-ng")
|
|
|
|
(synopsis "Manage Proton-GE Installations")
|
|
|
|
(description "ProtonUp-ng is a CLI program and API to automate the installation
|
|
|
|
and update of GloriousEggroll's Proton-GE.")
|
|
|
|
(license license:gpl3)))
|