about summary refs log tree commit diff
path: root/pkgs/games
diff options
context:
space:
mode:
authoraszlig <aszlig@nix.build>2018-05-19 02:43:33 +0200
committeraszlig <aszlig@nix.build>2018-05-19 02:43:33 +0200
commita03fd458f14ad769f252326d7ef593d674e51d68 (patch)
tree8ac8550a2b98fa5e363f18eaf104e681e429e2ad /pkgs/games
parent614a669a1e1c5bbeebad2705d5f79fe9439ef34f (diff)
games/stardew-valley: Add multiplayer beta
This adds version 1.3.11 of the ongoing multiplayer beta, so it can be
conveniently installed via Nix :-)

I haven't tested this a whole lot, only started a new farm, walked
around and that's it.

Signed-off-by: aszlig <aszlig@nix.build>
Diffstat (limited to 'pkgs/games')
-rw-r--r--pkgs/games/gog/default.nix1
-rw-r--r--pkgs/games/gog/stardew-valley.nix43
2 files changed, 37 insertions, 7 deletions
diff --git a/pkgs/games/gog/default.nix b/pkgs/games/gog/default.nix
index 122a6396..ca876a6a 100644
--- a/pkgs/games/gog/default.nix
+++ b/pkgs/games/gog/default.nix
@@ -13,6 +13,7 @@ let
 
     albion = callPackage_i686 ./albion { inherit (pkgs) buildSandbox; };
     stardew-valley = callPackage ./stardew-valley.nix {};
+    stardew-valley-beta = callPackage ./stardew-valley.nix { beta = true; };
   };
 in {
   options.gog = {
diff --git a/pkgs/games/gog/stardew-valley.nix b/pkgs/games/gog/stardew-valley.nix
index 4dcbcbae..39faff37 100644
--- a/pkgs/games/gog/stardew-valley.nix
+++ b/pkgs/games/gog/stardew-valley.nix
@@ -1,16 +1,27 @@
-{ lib, buildGame, fetchGog, unzip, makeWrapper, mono50, SDL2, libGL, openal }:
+{ lib, stdenv, buildGame, fetchGog, unzip, makeWrapper
+, mono50, SDL2, libGL, openal
+
+, beta ? false
+}:
 
 buildGame rec {
   name = "stardew-valley-${version}";
-  version = "1.2.33";
+  version = if beta then "1.3.11" else "1.2.33";
 
-  src = fetchGog {
+  src = fetchGog (if beta then {
+    productId = 1453375253;
+    downloadName = "80335";
+    downloadType = "product_bonus";
+    suffix = "tar.gz";
+    sha256 = "1aqw94paig3q5430vrbh35sghl6snhrdi9aj7bdkfymdmacs2yf3";
+  } else {
     productId = 1453375253;
     downloadName = "en3installer10";
     sha256 = "199xf008cxm6ywb4d8c3dz0h7iiv9d0ka5k93gq0jqj3ga3fjn3i";
-  };
+  });
 
-  unpackCmd = "${unzip}/bin/unzip -qq \"$curSrc\" 'data/noarch/game/*' || :";
+  unpackCmd = lib.optionalString (!beta)
+    "${unzip}/bin/unzip -qq \"$curSrc\" 'data/noarch/game/*' || :";
 
   nativeBuildInputs = [ makeWrapper ];
 
@@ -23,7 +34,15 @@ buildGame rec {
     sed -i -e '/<dllmap.*dll="${dll}\.dll".*os="linux"/ {
       s!target="[^"]*"!target="'"${target}"'"!
     }' MonoGame.Framework.dll.config
-  '') dllmap);
+  '') dllmap) + lib.optionalString beta ''
+    sed -i -e '/<dllmap.*os="linux"/ {
+      s!target="[^"]*"!target="${
+        "'\"$out\"'/libexec/stardew-valley/libGalaxyCSharpGlue.so"
+      }"!
+    }' GalaxyCSharp.dll.config
+  '';
+
+  bitSuffix = lib.optionalString stdenv.is64bit 64;
 
   installPhase = ''
     mkdir -p "$out/share" "$out/libexec/stardew-valley"
@@ -31,9 +50,19 @@ buildGame rec {
     cp -rv Content "$out/share/stardew-valley"
     cp -rv monoconfig "$out/libexec/stardew-valley/StardewValley.exe.config"
     cp -rvt "$out/libexec/stardew-valley" StardewValley.exe \
-      MonoGame.Framework.dll* BmFont.dll xTile.dll Lidgren.Network.dll
+      MonoGame.Framework.dll* BmFont.dll xTile.dll Lidgren.Network.dll \
+      ${lib.optionalString beta "GalaxyCSharp.dll"}
     ln -s "$out/share/stardew-valley" "$out/libexec/stardew-valley/Content"
 
+    ${lib.optionalString beta ''
+      # install -vD "libGalaxyPeer$bitSuffix.so" \
+      #   "$out/libexec/stardew-valley/libGalaxyPeer$bitSuffix.so"
+      install -vD "lib$bitSuffix/libGalaxy$bitSuffix.so" \
+        "$out/libexec/stardew-valley/libGalaxy$bitSuffix.so"
+      install -vD "lib$bitSuffix/libGalaxyCSharpGlue.so" \
+        "$out/libexec/stardew-valley/libGalaxyCSharpGlue.so"
+    ''}
+
     makeWrapper ${lib.escapeShellArg mono50}/bin/mono \
       "$out/bin/stardew-valley" \
       --add-flags "$out/libexec/stardew-valley/StardewValley.exe" \