Merge pull request #216972 from SuperSandro2000/steam-fhs-full

steam-small: init
This commit is contained in:
K900 2023-02-21 17:29:00 +03:00 committed by GitHub
commit 0870fc6680
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 83 additions and 94 deletions

View file

@ -5,7 +5,7 @@
let
steamPackagesFun = self: let
inherit (self) callPackage;
in {
in rec {
steamArch = if stdenv.hostPlatform.system == "x86_64-linux" then "amd64"
else if stdenv.hostPlatform.system == "i686-linux" then "i386"
else throw "Unsupported platform: ${stdenv.hostPlatform.system}";
@ -21,6 +21,7 @@ let
else null;
inherit buildFHSUserEnv;
};
steam-fhsenv-small = steam-fhsenv.override { withGameSpecificLibraries = false; };
steamcmd = callPackage ./steamcmd.nix { };
};
keep = self: { };

View file

@ -1,46 +1,37 @@
{ config, lib, writeScript, buildFHSUserEnv, steam, glxinfo-i686
{ lib, stdenv, writeScript, buildFHSUserEnv, steam, glxinfo-i686, runtimeShell
, steam-runtime-wrapped, steam-runtime-wrapped-i686 ? null
, extraPkgs ? pkgs: [ ] # extra packages to add to targetPkgs
, extraLibraries ? pkgs: [ ] # extra packages to add to multiPkgs
, extraProfile ? "" # string to append to profile
, extraArgs ? "" # arguments to always pass to steam
, runtimeOnly ? false
, runtimeShell
, stdenv
# DEPRECATED
, withJava ? config.steam.java or false
, withPrimus ? config.steam.primus or false
, withGameSpecificLibraries ? true # exclude game specific libraries
}:
let
commonTargetPkgs = pkgs: with pkgs;
[
# Needed for operating system detection until
# https://github.com/ValveSoftware/steam-for-linux/issues/5909 is resolved
lsb-release
# Errors in output without those
pciutils
# Games' dependencies
xorg.xrandr
which
# Needed by gdialog, including in the steam-runtime
perl
# Open URLs
xdg-utils
iana-etc
# Steam Play / Proton
python3
# Steam VR
procps
usbutils
commonTargetPkgs = pkgs: with pkgs; [
# Needed for operating system detection until
# https://github.com/ValveSoftware/steam-for-linux/issues/5909 is resolved
lsb-release
# Errors in output without those
pciutils
# Games' dependencies
xorg.xrandr
which
# Needed by gdialog, including in the steam-runtime
perl
# Open URLs
xdg-utils
iana-etc
# Steam Play / Proton
python3
# Steam VR
procps
usbutils
# electron based launchers need newer versions of these libraries than what runtime provides
mesa
sqlite
] ++ lib.optional withJava jdk8 # TODO: upgrade https://github.com/NixOS/nixpkgs/pull/89731
++ lib.optional withPrimus primus
++ extraPkgs pkgs;
# electron based launchers need newer versions of these libraries than what runtime provides
mesa
sqlite
] ++ extraPkgs pkgs;
ldPath = lib.optionals stdenv.is64bit [ "/lib64" ]
++ [ "/lib32" ]
@ -87,52 +78,8 @@ in buildFHSUserEnv rec {
libthai
pango
# Not formally in runtime but needed by some games
at-spi2-atk
at-spi2-core # CrossCode
gst_all_1.gstreamer
gst_all_1.gst-plugins-ugly
gst_all_1.gst-plugins-base
json-glib # paradox launcher (Stellaris)
libdrm
libxkbcommon # paradox launcher
libvorbis # Dead Cells
libxcrypt # Alien Isolation, XCOM 2, Company of Heroes 2
mono
xorg.xkeyboardconfig
xorg.libpciaccess
xorg.libXScrnSaver # Dead Cells
udev # shadow of the tomb raider
icu # dotnet runtime, e.g. stardew valley
# screeps dependencies
gtk3
dbus
zlib
atk
cairo
freetype
gdk-pixbuf
fontconfig
# friends options won't display "Launch Game" without it
lsof
# called by steam's setup.sh
file
# Prison Architect
libGLU
libuuid
libbsd
alsa-lib
# Loop Hero
libidn2
libpsl
nghttp2.lib
openssl_1_1
rtmpdump
lsof # friends options won't display "Launch Game" without it
file # called by steam's setup.sh
# dependencies for mesa drivers, needed inside pressure-vessel
mesa.llvmPackages.llvm.lib
@ -144,14 +91,7 @@ in buildFHSUserEnv rec {
xorg.libxshmfence
xorg.libXxf86vm
libelf
# pressure-vessel (required for mangohud and possibly more)
elfutils.out
# Required
glib
gtk2
bzip2
(lib.getLib elfutils)
# Without these it silently fails
xorg.libXinerama
@ -171,10 +111,11 @@ in buildFHSUserEnv rec {
libusb1
dbus-glib
ffmpeg
# Only libraries are needed from those two
libudev0-shim
# Verified games requirements
fontconfig
freetype
xorg.libXt
xorg.libXmu
libogg
@ -182,10 +123,15 @@ in buildFHSUserEnv rec {
SDL
SDL2_image
glew110
libdrm
libidn
tbb
zlib
# Other things from runtime
glib
gtk2
bzip2
flac
freeglut
libjpeg
@ -212,8 +158,48 @@ in buildFHSUserEnv rec {
librsvg
xorg.libXft
libvdpau
]
++ steamPackages.steam-runtime-wrapped.overridePkgs
] ++ lib.optionals withGameSpecificLibraries [
# Not formally in runtime but needed by some games
at-spi2-atk
at-spi2-core # CrossCode
gst_all_1.gstreamer
gst_all_1.gst-plugins-ugly
gst_all_1.gst-plugins-base
json-glib # paradox launcher (Stellaris)
libdrm
libxkbcommon # paradox launcher
libvorbis # Dead Cells
libxcrypt # Alien Isolation, XCOM 2, Company of Heroes 2
mono
xorg.xkeyboardconfig
xorg.libpciaccess
xorg.libXScrnSaver # Dead Cells
udev # Shadow of the Tomb Raider
icu # dotnet runtime, e.g. Stardew Valley
# screeps dependencies
gtk3
dbus
zlib
atk
cairo
freetype
gdk-pixbuf
fontconfig
# Prison Architect
libGLU
libuuid
libbsd
alsa-lib
# Loop Hero
libidn2
libpsl
nghttp2.lib
openssl_1_1
rtmpdump
] ++ steamPackages.steam-runtime-wrapped.overridePkgs
++ extraLibraries pkgs;
extraInstallCommands = ''
@ -266,7 +252,9 @@ in buildFHSUserEnv rec {
exec steam ${extraArgs} "$@"
'';
inherit (steam) meta;
meta = steam.meta // lib.optionalAttrs (!withGameSpecificLibraries) {
description = steam.meta.description + " (without game specific libraries)";
};
# allows for some gui applications to share IPC
# this fixes certain issues where they don't render correctly
@ -282,7 +270,6 @@ in buildFHSUserEnv rec {
targetPkgs = commonTargetPkgs;
inherit multiPkgs profile extraInstallCommands;
inherit unshareIpc unsharePid;
runScript = writeScript "steam-run" ''

View file

@ -35803,6 +35803,7 @@ with pkgs;
});
steam = steamPackages.steam-fhsenv;
steam-small = steamPackages.steam-fhsenv-small;
steam-run = steam.run;