2017-10-15 23:58:04 +00:00
|
|
|
{ stdenv, steamArch, lib, perl, pkgs, steam-runtime
|
2015-08-23 15:17:15 +00:00
|
|
|
, runtimeOnly ? false
|
|
|
|
}:
|
|
|
|
|
2017-12-18 00:19:23 +00:00
|
|
|
let
|
2018-03-15 23:37:42 +00:00
|
|
|
overridePkgs = lib.optionals (!runtimeOnly) (with pkgs; [
|
2016-05-14 23:35:08 +00:00
|
|
|
libgpgerror
|
2015-08-23 15:17:15 +00:00
|
|
|
libpulseaudio
|
|
|
|
alsaLib
|
|
|
|
openalSoft
|
2018-07-22 02:03:24 +00:00
|
|
|
libva1
|
2018-03-15 23:37:42 +00:00
|
|
|
libvdpau
|
2017-03-19 18:19:45 +00:00
|
|
|
vulkan-loader
|
2018-11-05 22:46:53 +00:00
|
|
|
gcc.cc.lib
|
2017-12-18 00:19:23 +00:00
|
|
|
nss
|
|
|
|
nspr
|
2018-10-08 23:02:24 +00:00
|
|
|
xorg.libxcb
|
2018-03-15 23:37:42 +00:00
|
|
|
]);
|
2015-08-23 15:17:15 +00:00
|
|
|
|
2018-03-15 23:37:42 +00:00
|
|
|
allPkgs = overridePkgs ++ [ steam-runtime ];
|
2016-05-14 23:35:08 +00:00
|
|
|
|
2017-10-15 23:58:04 +00:00
|
|
|
gnuArch = if steamArch == "amd64" then "x86_64-linux-gnu"
|
|
|
|
else if steamArch == "i386" then "i386-linux-gnu"
|
|
|
|
else abort "Unsupported architecture";
|
|
|
|
|
|
|
|
libs = [ "lib/${gnuArch}" "lib" "usr/lib/${gnuArch}" "usr/lib" ];
|
|
|
|
bins = [ "bin" "usr/bin" ];
|
|
|
|
|
2015-08-23 15:17:15 +00:00
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
name = "steam-runtime-wrapped";
|
|
|
|
|
|
|
|
nativeBuildInputs = [ perl ];
|
|
|
|
|
2015-10-20 14:08:44 +00:00
|
|
|
builder = ./build-wrapped.sh;
|
2015-08-23 15:17:15 +00:00
|
|
|
|
2017-10-15 23:58:04 +00:00
|
|
|
passthru = {
|
2018-03-15 23:37:42 +00:00
|
|
|
inherit gnuArch libs bins overridePkgs;
|
2017-10-15 23:58:04 +00:00
|
|
|
arch = steamArch;
|
|
|
|
};
|
|
|
|
|
2015-08-23 15:17:15 +00:00
|
|
|
installPhase = ''
|
2017-10-15 23:58:04 +00:00
|
|
|
buildDir "${toString libs}" "${toString (map lib.getLib allPkgs)}"
|
|
|
|
buildDir "${toString bins}" "${toString (map lib.getBin allPkgs)}"
|
2015-08-23 15:17:15 +00:00
|
|
|
'';
|
|
|
|
}
|