2017-10-16 01:58:04 +02:00
|
|
|
{ stdenv, steamArch, lib, perl, pkgs, steam-runtime
|
2015-08-23 17:17:15 +02:00
|
|
|
, runtimeOnly ? false
|
|
|
|
}:
|
|
|
|
|
2017-12-18 01:19:23 +01:00
|
|
|
let
|
2018-03-16 00:37:42 +01:00
|
|
|
overridePkgs = lib.optionals (!runtimeOnly) (with pkgs; [
|
2016-05-15 01:35:08 +02:00
|
|
|
libgpgerror
|
2015-08-23 17:17:15 +02:00
|
|
|
libpulseaudio
|
|
|
|
alsaLib
|
|
|
|
openalSoft
|
2018-07-22 04:03:24 +02:00
|
|
|
libva1
|
2018-03-16 00:37:42 +01:00
|
|
|
libvdpau
|
2017-03-19 19:19:45 +01:00
|
|
|
vulkan-loader
|
2017-09-10 10:54:06 +02:00
|
|
|
gcc.cc
|
2017-12-18 01:19:23 +01:00
|
|
|
nss
|
|
|
|
nspr
|
2018-10-09 01:02:24 +02:00
|
|
|
xorg.libxcb
|
2018-03-16 00:37:42 +01:00
|
|
|
]);
|
2015-08-23 17:17:15 +02:00
|
|
|
|
2018-03-16 00:37:42 +01:00
|
|
|
allPkgs = overridePkgs ++ [ steam-runtime ];
|
2016-05-15 01:35:08 +02:00
|
|
|
|
2017-10-16 01:58:04 +02: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 17:17:15 +02:00
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
name = "steam-runtime-wrapped";
|
|
|
|
|
|
|
|
nativeBuildInputs = [ perl ];
|
|
|
|
|
2015-10-20 16:08:44 +02:00
|
|
|
builder = ./build-wrapped.sh;
|
2015-08-23 17:17:15 +02:00
|
|
|
|
2017-10-16 01:58:04 +02:00
|
|
|
passthru = {
|
2018-03-16 00:37:42 +01:00
|
|
|
inherit gnuArch libs bins overridePkgs;
|
2017-10-16 01:58:04 +02:00
|
|
|
arch = steamArch;
|
|
|
|
};
|
|
|
|
|
2015-08-23 17:17:15 +02:00
|
|
|
installPhase = ''
|
2017-10-16 01:58:04 +02:00
|
|
|
buildDir "${toString libs}" "${toString (map lib.getLib allPkgs)}"
|
|
|
|
buildDir "${toString bins}" "${toString (map lib.getBin allPkgs)}"
|
2015-08-23 17:17:15 +02:00
|
|
|
'';
|
|
|
|
}
|