diff options
author | Nikolay Amiantov <ab@fmap.me> | 2017-10-16 02:58:04 +0300 |
---|---|---|
committer | Nikolay Amiantov <ab@fmap.me> | 2017-10-16 21:42:30 +0300 |
commit | 38ffe0e1f6bcce05c7f209666354f3487b512149 (patch) | |
tree | 9b9af8130be8bcec052e7810bedd6df04bba29bd /pkgs/games/steam | |
parent | 12d6fed2ba3d6ad40f493e320fe55995166783fd (diff) | |
download | nixlib-38ffe0e1f6bcce05c7f209666354f3487b512149.tar nixlib-38ffe0e1f6bcce05c7f209666354f3487b512149.tar.gz nixlib-38ffe0e1f6bcce05c7f209666354f3487b512149.tar.bz2 nixlib-38ffe0e1f6bcce05c7f209666354f3487b512149.tar.lz nixlib-38ffe0e1f6bcce05c7f209666354f3487b512149.tar.xz nixlib-38ffe0e1f6bcce05c7f209666354f3487b512149.tar.zst nixlib-38ffe0e1f6bcce05c7f209666354f3487b512149.zip |
steam-run-native: init
Refactor Steam so that native steam-run can be built as a free package and expose it so that Hydra builds needed i686 packages.
Diffstat (limited to 'pkgs/games/steam')
-rw-r--r-- | pkgs/games/steam/chrootenv.nix | 12 | ||||
-rw-r--r-- | pkgs/games/steam/default.nix | 10 | ||||
-rw-r--r-- | pkgs/games/steam/runtime-wrapped.nix | 20 | ||||
-rw-r--r-- | pkgs/games/steam/runtime.nix | 19 |
4 files changed, 30 insertions, 31 deletions
diff --git a/pkgs/games/steam/chrootenv.nix b/pkgs/games/steam/chrootenv.nix index 0c59821bdd26..856e4f6c6c15 100644 --- a/pkgs/games/steam/chrootenv.nix +++ b/pkgs/games/steam/chrootenv.nix @@ -1,5 +1,5 @@ { stdenv, lib, writeScript, buildFHSUserEnv, steam -, steam-runtime, steam-runtime-i686 ? null +, steam-runtime-wrapped, steam-runtime-wrapped-i686 ? null , withJava ? false , withPrimus ? false , extraPkgs ? pkgs: [ ] # extra packages to add to targetPkgs @@ -69,9 +69,9 @@ in buildFHSUserEnv rec { extraBuildCommands = '' mkdir -p steamrt - ln -s ../lib/steam-runtime steamrt/${steam-runtime.arch} - ${lib.optionalString (steam-runtime-i686 != null) '' - ln -s ../lib32/steam-runtime steamrt/${steam-runtime-i686.arch} + ln -s ../lib/steam-runtime steamrt/${steam-runtime-wrapped.arch} + ${lib.optionalString (steam-runtime-wrapped-i686 != null) '' + ln -s ../lib32/steam-runtime steamrt/${steam-runtime-wrapped-i686.arch} ''} ''; @@ -96,8 +96,8 @@ in buildFHSUserEnv rec { inherit multiPkgs extraBuildCommands; runScript = - let ldPath = map (x: "/steamrt/${steam-runtime.arch}/" + x) steam-runtime.libs - ++ lib.optionals (steam-runtime-i686 != null) (map (x: "/steamrt/${steam-runtime-i686.arch}/" + x) steam-runtime-i686.libs); + let ldPath = map (x: "/steamrt/${steam-runtime-wrapped.arch}/" + x) steam-runtime-wrapped.libs + ++ lib.optionals (steam-runtime-wrapped-i686 != null) (map (x: "/steamrt/${steam-runtime-wrapped-i686.arch}/" + x) steam-runtime-wrapped-i686.libs); in writeScript "steam-run" '' #!${stdenv.shell} run="$1" diff --git a/pkgs/games/steam/default.nix b/pkgs/games/steam/default.nix index ae3fe561272f..54805e91b2bd 100644 --- a/pkgs/games/steam/default.nix +++ b/pkgs/games/steam/default.nix @@ -4,14 +4,18 @@ let callPackage = newScope self; self = rec { + steamArch = if pkgs.stdenv.system == "x86_64-linux" then "amd64" + else if pkgs.stdenv.system == "i686-linux" then "i386" + else abort "Unsupported platform"; + steam-runtime = callPackage ./runtime.nix { }; steam-runtime-wrapped = callPackage ./runtime-wrapped.nix { }; steam = callPackage ./steam.nix { }; steam-fonts = callPackage ./fonts.nix { }; steam-chrootenv = callPackage ./chrootenv.nix { - steam-runtime-i686 = - if pkgs.system == "x86_64-linux" - then pkgs.pkgsi686Linux.steamPackages.steam-runtime + steam-runtime-wrapped-i686 = + if steamArch == "amd64" + then pkgs.pkgsi686Linux.steamPackages.steam-runtime-wrapped else null; }; }; diff --git a/pkgs/games/steam/runtime-wrapped.nix b/pkgs/games/steam/runtime-wrapped.nix index 3d614bda31e4..1ec9fc7d5d97 100644 --- a/pkgs/games/steam/runtime-wrapped.nix +++ b/pkgs/games/steam/runtime-wrapped.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, perl, pkgs, steam-runtime +{ stdenv, steamArch, lib, perl, pkgs, steam-runtime , nativeOnly ? false , runtimeOnly ? false }: @@ -96,6 +96,13 @@ let allPkgs = ourRuntime ++ steamRuntime; + 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" ]; + in stdenv.mkDerivation rec { name = "steam-runtime-wrapped"; @@ -103,10 +110,13 @@ in stdenv.mkDerivation rec { builder = ./build-wrapped.sh; + passthru = { + inherit gnuArch libs bins; + arch = steamArch; + }; + installPhase = '' - buildDir "${toString steam-runtime.libs}" "${toString (map lib.getLib allPkgs)}" - buildDir "${toString steam-runtime.bins}" "${toString (map lib.getBin allPkgs)}" + buildDir "${toString libs}" "${toString (map lib.getLib allPkgs)}" + buildDir "${toString bins}" "${toString (map lib.getBin allPkgs)}" ''; - - meta.hydraPlatforms = []; } diff --git a/pkgs/games/steam/runtime.nix b/pkgs/games/steam/runtime.nix index fa1da4791963..82fce93a66ae 100644 --- a/pkgs/games/steam/runtime.nix +++ b/pkgs/games/steam/runtime.nix @@ -1,10 +1,6 @@ -{ stdenv, fetchurl, writeText, python2, dpkg, binutils }: +{ stdenv, steamArch, 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; }); +let input = builtins.getAttr steamArch (import ./runtime-generated.nix { inherit fetchurl; }); inputFile = writeText "steam-runtime.json" (builtins.toJSON input); @@ -18,17 +14,6 @@ in stdenv.mkDerivation { 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; |