2017-10-16 00:58:04 +01:00
|
|
|
{ stdenv, steamArch, lib, perl, pkgs, steam-runtime
|
2015-08-23 16:17:15 +01:00
|
|
|
, nativeOnly ? false
|
|
|
|
, runtimeOnly ? false
|
|
|
|
}:
|
|
|
|
|
|
|
|
assert !(nativeOnly && runtimeOnly);
|
|
|
|
|
2017-12-18 00:19:23 +00:00
|
|
|
let
|
2015-08-23 16:17:15 +01:00
|
|
|
runtimePkgs = with pkgs; [
|
|
|
|
# Required
|
|
|
|
glib
|
|
|
|
gtk2
|
|
|
|
bzip2
|
|
|
|
zlib
|
|
|
|
gdk_pixbuf
|
|
|
|
|
|
|
|
# Without these it silently fails
|
2018-03-13 10:16:03 +00:00
|
|
|
xorg.libXinerama
|
|
|
|
xorg.libXdamage
|
|
|
|
xorg.libXcursor
|
|
|
|
xorg.libXrender
|
|
|
|
xorg.libXScrnSaver
|
|
|
|
xorg.libXxf86vm
|
|
|
|
xorg.libXi
|
|
|
|
xorg.libSM
|
|
|
|
xorg.libICE
|
2015-08-23 16:17:15 +01:00
|
|
|
gnome2.GConf
|
|
|
|
freetype
|
2017-10-28 10:18:26 +01:00
|
|
|
(curl.override { gnutlsSupport = true; sslSupport = false; })
|
2015-08-23 16:17:15 +01:00
|
|
|
nspr
|
|
|
|
nss
|
|
|
|
fontconfig
|
|
|
|
cairo
|
|
|
|
pango
|
|
|
|
expat
|
|
|
|
dbus
|
|
|
|
cups
|
|
|
|
libcap
|
|
|
|
SDL2
|
|
|
|
libusb1
|
2018-02-25 02:23:58 +00:00
|
|
|
dbus-glib
|
2015-08-23 16:17:15 +01:00
|
|
|
libav
|
|
|
|
atk
|
|
|
|
# Only libraries are needed from those two
|
2016-12-28 15:51:01 +00:00
|
|
|
libudev0-shim
|
2015-08-23 16:17:15 +01:00
|
|
|
networkmanager098
|
|
|
|
|
|
|
|
# Verified games requirements
|
2018-03-13 10:16:03 +00:00
|
|
|
xorg.libXmu
|
|
|
|
xorg.libxcb
|
2018-02-24 12:59:47 +00:00
|
|
|
libGLU
|
2015-08-23 16:17:15 +01:00
|
|
|
libuuid
|
|
|
|
libogg
|
|
|
|
libvorbis
|
|
|
|
SDL
|
|
|
|
SDL2_image
|
|
|
|
glew110
|
2017-02-21 01:45:48 +00:00
|
|
|
openssl
|
2015-08-23 16:17:15 +01:00
|
|
|
libidn
|
2017-10-28 23:48:47 +01:00
|
|
|
tbb
|
2015-08-23 16:17:15 +01:00
|
|
|
|
|
|
|
# Other things from runtime
|
2018-03-13 10:16:03 +00:00
|
|
|
xorg.libXinerama
|
2015-08-23 16:17:15 +01:00
|
|
|
flac
|
|
|
|
freeglut
|
|
|
|
libjpeg
|
|
|
|
libpng12
|
|
|
|
libsamplerate
|
|
|
|
libmikmod
|
|
|
|
libtheora
|
|
|
|
pixman
|
|
|
|
speex
|
|
|
|
SDL_image
|
|
|
|
SDL_ttf
|
|
|
|
SDL_mixer
|
|
|
|
SDL2_net
|
|
|
|
SDL2_ttf
|
|
|
|
SDL2_mixer
|
|
|
|
gstreamer
|
2017-02-26 20:25:29 +00:00
|
|
|
gst-plugins-base
|
2017-09-10 09:54:06 +01:00
|
|
|
];
|
2015-08-23 16:17:15 +01:00
|
|
|
|
|
|
|
overridePkgs = with pkgs; [
|
2016-05-15 00:35:08 +01:00
|
|
|
libgpgerror
|
2015-08-23 16:17:15 +01:00
|
|
|
libpulseaudio
|
|
|
|
alsaLib
|
|
|
|
openalSoft
|
2016-03-28 23:14:27 +01:00
|
|
|
libva
|
2017-03-19 18:19:45 +00:00
|
|
|
vulkan-loader
|
2017-09-10 09:54:06 +01:00
|
|
|
gcc.cc
|
2017-12-18 00:19:23 +00:00
|
|
|
nss
|
|
|
|
nspr
|
2017-09-10 09:54:06 +01:00
|
|
|
];
|
2015-08-23 16:17:15 +01:00
|
|
|
|
|
|
|
ourRuntime = if runtimeOnly then []
|
|
|
|
else if nativeOnly then runtimePkgs ++ overridePkgs
|
|
|
|
else overridePkgs;
|
2016-01-15 11:54:01 +00:00
|
|
|
steamRuntime = lib.optional (!nativeOnly) steam-runtime;
|
2015-08-23 16:17:15 +01:00
|
|
|
|
2016-05-15 00:35:08 +01:00
|
|
|
allPkgs = ourRuntime ++ steamRuntime;
|
|
|
|
|
2017-10-16 00:58:04 +01: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 16:17:15 +01:00
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
name = "steam-runtime-wrapped";
|
|
|
|
|
|
|
|
nativeBuildInputs = [ perl ];
|
|
|
|
|
2015-10-20 15:08:44 +01:00
|
|
|
builder = ./build-wrapped.sh;
|
2015-08-23 16:17:15 +01:00
|
|
|
|
2017-10-16 00:58:04 +01:00
|
|
|
passthru = {
|
|
|
|
inherit gnuArch libs bins;
|
|
|
|
arch = steamArch;
|
|
|
|
};
|
|
|
|
|
2015-08-23 16:17:15 +01:00
|
|
|
installPhase = ''
|
2017-10-16 00:58:04 +01:00
|
|
|
buildDir "${toString libs}" "${toString (map lib.getLib allPkgs)}"
|
|
|
|
buildDir "${toString bins}" "${toString (map lib.getBin allPkgs)}"
|
2015-08-23 16:17:15 +01:00
|
|
|
'';
|
|
|
|
}
|