Merge pull request #38878 from tadfisher/steamcmd
steamcmd: init at 20180104
This commit is contained in:
commit
a0dc4854af
@ -19,6 +19,7 @@ let
|
|||||||
then pkgs.pkgsi686Linux.steamPackages.steam-runtime-wrapped
|
then pkgs.pkgsi686Linux.steamPackages.steam-runtime-wrapped
|
||||||
else null;
|
else null;
|
||||||
};
|
};
|
||||||
|
steamcmd = callPackage ./steamcmd.nix { };
|
||||||
};
|
};
|
||||||
|
|
||||||
in self
|
in self
|
||||||
|
46
pkgs/games/steam/steamcmd.nix
Normal file
46
pkgs/games/steam/steamcmd.nix
Normal 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 ];
|
||||||
|
};
|
||||||
|
}
|
24
pkgs/games/steam/steamcmd.sh
Normal file
24
pkgs/games/steam/steamcmd.sh
Normal 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" "$@"
|
@ -20218,6 +20218,8 @@ with pkgs;
|
|||||||
nativeOnly = true;
|
nativeOnly = true;
|
||||||
}).run;
|
}).run;
|
||||||
|
|
||||||
|
steamcmd = steamPackages.steamcmd;
|
||||||
|
|
||||||
linux-steam-integration = callPackage ../games/linux-steam-integration {
|
linux-steam-integration = callPackage ../games/linux-steam-integration {
|
||||||
gtk = pkgs.gtk3;
|
gtk = pkgs.gtk3;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user