Merge pull request #38878 from tadfisher/steamcmd

steamcmd: init at 20180104
This commit is contained in:
Matthew Bauer 2018-09-08 17:55:56 -05:00 committed by GitHub
commit a0dc4854af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 73 additions and 0 deletions

View File

@ -19,6 +19,7 @@ let
then pkgs.pkgsi686Linux.steamPackages.steam-runtime-wrapped
else null;
};
steamcmd = callPackage ./steamcmd.nix { };
};
in self

View File

@ -0,0 +1,46 @@
{ stdenv, fetchurl, steam-run, bash
, steamRoot ? "~/.local/share/Steam"
}:
stdenv.mkDerivation rec {
name = "steamcmd-${version}";
version = "20180104"; # According to steamcmd_linux.tar.gz mtime
src = fetchurl {
url = https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz;
sha256 = "0z0y0zqvhydmfc9y9vg5am0vz7m3gbj4l2dwlrfz936hpx301gyf";
};
# The source tarball does not have a single top-level directory.
preUnpack = ''
mkdir $name
cd $name
sourceRoot=.
'';
buildInputs = [ bash steam-run ];
dontBuild = true;
installPhase = ''
mkdir -p $out/share/steamcmd/linux32
install -Dm755 steamcmd.sh $out/share/steamcmd/steamcmd.sh
install -Dm755 linux32/* $out/share/steamcmd/linux32
mkdir -p $out/bin
substitute ${./steamcmd.sh} $out/bin/steamcmd \
--subst-var shell \
--subst-var out \
--subst-var-by steamRoot "${steamRoot}" \
--subst-var-by steamRun ${steam-run}
chmod 0755 $out/bin/steamcmd
'';
meta = with stdenv.lib; {
description = "Steam command-line tools";
homepage = "https://developer.valvesoftware.com/wiki/SteamCMD";
platforms = platforms.linux;
license = licenses.unfreeRedistributable;
maintainers = with maintainers; [ tadfisher ];
};
}

View File

@ -0,0 +1,24 @@
#!@bash@/bin/bash -e
# Always run steamcmd in the user's Steam root.
STEAMROOT=@steamRoot@
# Create a facsimile Steam root if it doesn't exist.
if [ ! -e "$STEAMROOT" ]; then
mkdir -p "$STEAMROOT"/{appcache,config,logs,Steamapps/common}
mkdir -p ~/.steam
ln -sf "$STEAMROOT" ~/.steam/root
ln -sf "$STEAMROOT" ~/.steam/steam
fi
# Copy the system steamcmd install to the Steam root. If we don't do
# this, steamcmd assumes the path to `steamcmd` is the Steam root.
# Note that symlinks don't work here.
if [ ! -e "$STEAMROOT/steamcmd.sh" ]; then
mkdir -p "$STEAMROOT/linux32"
# steamcmd.sh will replace these on first use
cp @out@/share/steamcmd/steamcmd.sh "$STEAMROOT/."
cp @out@/share/steamcmd/linux32/* "$STEAMROOT/linux32/."
fi
@steamRun@/bin/steam-run "$STEAMROOT/steamcmd.sh" "$@"

View File

@ -20218,6 +20218,8 @@ with pkgs;
nativeOnly = true;
}).run;
steamcmd = steamPackages.steamcmd;
linux-steam-integration = callPackage ../games/linux-steam-integration {
gtk = pkgs.gtk3;
};