steam (and friends): migrate to by-name, small cleanups all over

- rename "steam-original" or "steam" to "steam-unwrapped", as that's what it is
- rename "steam-fhsenv" to "steam", as that's what you actually want
- remove some no-longer-relevant hacks
This commit is contained in:
K900 2024-10-16 21:49:32 +03:00
parent 6ae5c7581c
commit 5c33791df3
11 changed files with 24 additions and 105 deletions

View File

@ -16,7 +16,7 @@ in
config = lib.mkIf cfg.enable {
services.udev.packages = [
pkgs.steamPackages.steam
pkgs.steam-unwrapped
];
# The uinput module needs to be loaded in order to trigger the udev rules

View File

@ -1,7 +1,7 @@
{ lib, stdenv, fetchurl, runtimeShell, traceDeps ? false, bash }:
{ lib, stdenv, fetchurl, bash }:
stdenv.mkDerivation (finalAttrs: {
pname = "steam-original";
pname = "steam-unwrapped";
version = "1.0.0.81";
src = fetchurl {
@ -12,20 +12,8 @@ stdenv.mkDerivation (finalAttrs: {
makeFlags = [ "DESTDIR=$(out)" "PREFIX=" ];
postInstall =
let
traceLog = "/tmp/steam-trace-dependencies.log";
in ''
postInstall = ''
rm $out/bin/steamdeps
${lib.optionalString traceDeps ''
cat > $out/bin/steamdeps <<EOF
#!${runtimeShell}
echo \$1 >> ${traceLog}
cat \$1 >> ${traceLog}
echo >> ${traceLog}
EOF
chmod +x $out/bin/steamdeps
''}
# install udev rules
mkdir -p $out/etc/udev/rules.d/
@ -38,7 +26,7 @@ stdenv.mkDerivation (finalAttrs: {
sed -e 's,/usr/bin/steam,steam,g' steam.desktop > $out/share/applications/steam.desktop
'';
passthru.updateScript = ./update-bootstrap.py;
passthru.updateScript = ./update.py;
meta = with lib; {
description = "Digital distribution platform";
@ -49,7 +37,7 @@ stdenv.mkDerivation (finalAttrs: {
'';
homepage = "https://store.steampowered.com/";
license = licenses.unfreeRedistributable;
maintainers = with maintainers; [ jagajaga ];
maintainers = lib.teams.steam.members ++ [ lib.maintainers.jagajaga ];
mainProgram = "steam";
};
})

View File

@ -27,5 +27,5 @@ if len(found_versions) == 0:
sys.exit(1)
found_versions.sort()
subprocess.run(["nix-update", "--version", found_versions[-1], "steamPackages.steam"])
subprocess.run(["nix-update", "--version", found_versions[-1], "steam-unwrapped"])
found_versions[0]

View File

@ -1,6 +1,6 @@
{
lib,
steam,
steam-unwrapped,
buildFHSEnv,
writeShellScript,
extraPkgs ? pkgs: [ ], # extra packages to add to targetPkgs
@ -21,7 +21,7 @@ let
# https://gitlab.steamos.cloud/steamrt/steam-runtime-tools/-/blob/main/docs/distro-assumptions.md#command-line-tools
targetPkgs = pkgs: with pkgs; [
steam
steam-unwrapped
bash
coreutils
@ -63,8 +63,8 @@ let
libcap # not documented, required by srt-bwrap
] ++ extraLibraries pkgs;
extraInstallCommands = lib.optionalString (steam != null) ''
ln -s ${steam}/share $out/share
extraInstallCommands = lib.optionalString (steam-unwrapped != null) ''
ln -s ${steam-unwrapped}/share $out/share
'';
profile = ''
@ -124,7 +124,7 @@ in steamEnv {
exec "$@"
'';
meta = (steam.meta or {}) // {
meta = (steam-unwrapped.meta or {}) // {
description = "Run commands in the same FHS environment that is used for Steam";
mainProgram = "steam-run";
name = "steam-run";
@ -135,7 +135,7 @@ in steamEnv {
};
};
meta = (steam.meta or {}) // {
meta = (steam-unwrapped.meta or {}) // {
description = "Steam dependencies (dummy package, do not use)";
};
}

View File

@ -1,47 +0,0 @@
source $stdenv/setup
outp=$out/lib/steam-runtime
buildDir() {
paths="$1"
pkgs="$2"
for pkg in $pkgs; do
echo "adding package $pkg"
for path in $paths; do
if [ -d $pkg/$path ]; then
cd $pkg/$path
for file in *; do
found=""
for i in $paths; do
if [ -e "$outp/$i/$file" ]; then
found=1
break
fi
done
if [ -z "$found" ]; then
mkdir -p $outp/$path
ln -s "$pkg/$path/$file" $outp/$path
sovers=$(echo $file | perl -ne 'print if s/.*?\.so\.(.*)/\1/')
if [ ! -z "$sovers" ]; then
fname=''${file%.''${sovers}}
for ver in ''${sovers//./ }; do
found=""
for i in $paths; do
if [ -e "$outp/$i/$fname" ]; then
found=1
break
fi
done
[ -n "$found" ] || ln -s "$pkg/$path/$file" "$outp/$path/$fname"
fname="$fname.$ver"
done
fi
fi
done
fi
done
done
}
eval "$installPhase"

View File

@ -1,25 +0,0 @@
{ makeScopeWithSplicing', generateSplicesForMkScope
, stdenv
}:
let
steamPackagesFun = self: let
inherit (self) callPackage;
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}";
steam = callPackage ./steam.nix { };
steam-fhsenv = callPackage ./fhsenv.nix {};
# This has to exist so Hydra tries to build all of Steam's dependencies.
# FIXME: Maybe we should expose it as something more generic?
steam-fhsenv-without-steam = steam-fhsenv.override { steam = null; };
steamcmd = callPackage ./steamcmd.nix { };
};
in makeScopeWithSplicing' {
otherSplices = generateSplicesForMkScope "steamPackages";
f = steamPackagesFun;
}

View File

@ -1550,6 +1550,13 @@ mapAliases {
ssm-agent = amazon-ssm-agent; # Added 2023-10-17
starboard-octant-plugin = throw "starboard-octant-plugin has been dropped due to needing octant which is archived"; # Added 2023-09-29
starspace = throw "starspace has been removed from nixpkgs, as it was broken"; # Added 2024-07-15
steamPackages = {
steamArch = throw "`steamPackages.steamArch` has been removed as it's no longer applicable";
steam = lib.warn "`steamPackages.steam` has been moved to top level as `steam-unwrapped`" steam-unwrapped;
steam-fhsenv = lib.warn "`steamPackages.steam-fhsenv` has been moved to top level as `steam`" steam;
steam-fhsenv-without-steam = lib.warn "`steamPackages.steam-fhsenv-without-steam` has been moved to top level as `steam-fhsenv-without-steam`" steam-fhsenv-without-steam;
steamcmd = lib.warn "`steamPackages.steamcmd` has been moved to top level as `steamcmd`" steamcmd;
};
steam-small = steam; # Added 2024-09-12
steam-run-native = steam-run; # added 2022-02-21
StormLib = stormlib; # Added 2024-01-21

View File

@ -35203,18 +35203,15 @@ with pkgs;
stockfish = callPackage ../games/stockfish { };
steamPackages = recurseIntoAttrs (callPackage ../games/steam { });
steam = steamPackages.steam-fhsenv;
steam-run = steam.run;
steam-run-free = steamPackages.steam-fhsenv-without-steam.run;
# This exists so Hydra tries to build all of Steam's dependencies.
steam-fhsenv-without-steam = steam.override { steam-unwrapped = null; };
steam-run-free = steam-fhsenv-without-steam.run;
steam-tui = callPackage ../games/steam-tui { };
steamcmd = steamPackages.steamcmd;
steam-acf = callPackage ../tools/games/steam-acf { };
steamback = python311.pkgs.callPackage ../tools/games/steamback { };

View File

@ -21,7 +21,6 @@
rPackages
roundcubePlugins
sourceHanPackages
steamPackages
ut2004Packages
zabbix50
zabbix60