nixpkgs/pkgs/games/steam/runtime.nix
2016-03-04 14:46:46 +03:00

39 lines
1.2 KiB
Nix

{ stdenv, fetchurl, writeText, python2, dpkg, binutils }:
let arch = if stdenv.system == "x86_64-linux" then "amd64"
else if stdenv.system == "i686-linux" then "i386"
else abort "Unsupported platform";
input = builtins.getAttr arch (import ./runtime-generated.nix { inherit fetchurl; });
inputFile = writeText "steam-runtime.json" (builtins.toJSON input);
in stdenv.mkDerivation {
name = "steam-runtime-2016-03-03";
nativeBuildInputs = [ python2 dpkg binutils ];
buildCommand = ''
mkdir -p $out
python2 ${./build-runtime.py} -i ${inputFile} -r $out
'';
passthru = rec {
inherit arch;
gnuArch = if arch == "amd64" then "x86_64-linux-gnu"
else if arch == "i386" then "i386-linux-gnu"
else abort "Unsupported architecture";
libs = [ "lib/${gnuArch}" "lib" "usr/lib/${gnuArch}" "usr/lib" ];
bins = [ "bin" "usr/bin" ];
};
meta = with stdenv.lib; {
description = "The official runtime used by Steam";
homepage = https://github.com/ValveSoftware/steam-runtime;
license = licenses.unfreeRedistributable; # Includes NVIDIA CG toolkit
maintainers = with maintainers; [ hrdinka abbradar ];
};
}