about summary refs log tree commit diff
path: root/pkgs/games
diff options
context:
space:
mode:
authoraszlig <aszlig@nix.build>2020-06-07 08:34:30 +0200
committeraszlig <aszlig@nix.build>2020-06-07 08:39:22 +0200
commit4d374b59d8b5c5e6d602782a9a14a800f8277faf (patch)
tree584aec1070aa29a3339ffbff0c1559ba82b34937 /pkgs/games
parent410ff8acc53ad2548ea0c5f9caee073bfb4d5596 (diff)
games/gog: Add Hollow Knight version 1.4.3.2
Hollow Knight is a 2D Metroidvania action-adventure game, which takes
place in Hallownest, a fictional ancient kingdom.

The player controls an insect-like, silent, and nameless knight while
exploring the underground world.

Packaging the game would have been almost straightforward, would there
not be another occasion where the developer has mixed up the persistent
data path with the non-persistent data path, which is quite common in
many games.

Fortunately, this is pretty easy to fix with our Mono game patcher.

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/hollow-knight.nix24
2 files changed, 25 insertions, 0 deletions
diff --git a/pkgs/games/gog/default.nix b/pkgs/games/gog/default.nix
index 723392b7..2c195dbe 100644
--- a/pkgs/games/gog/default.nix
+++ b/pkgs/games/gog/default.nix
@@ -17,6 +17,7 @@ let
     epistory = callPackage ./epistory.nix { };
     freedom-planet = callPackage ./freedom-planet.nix {};
     homm3 = callPackage ./homm3 {};
+    hollow-knight = callPackage ./hollow-knight.nix {};
     kingdoms-and-castles = callPackage ./kingdoms-and-castles.nix {};
     overload = callPackage ./overload.nix {};
     party-hard = callPackage ./party-hard.nix {};
diff --git a/pkgs/games/gog/hollow-knight.nix b/pkgs/games/gog/hollow-knight.nix
new file mode 100644
index 00000000..05c839f6
--- /dev/null
+++ b/pkgs/games/gog/hollow-knight.nix
@@ -0,0 +1,24 @@
+{ buildUnity, fetchGog, monogamePatcher }:
+
+buildUnity {
+  name = "hollow-knight";
+  fullName = "hollow_knight";
+  saveDir = "Team Cherry/Hollow Knight";
+  version = "1.4.3.2";
+
+  src = fetchGog {
+    productId = 1308320804;
+    downloadName = "en3installer0";
+    sha256 = "19g0b6mzjahvj1y3mk25li61wardgk4fnl5cn9v24s9lhq8i8d28";
+  };
+
+  nativeBuildInputs = [ monogamePatcher ];
+
+  buildPhase = ''
+    monogame-patcher replace-call \
+      -i hollow_knight_Data/Managed/Assembly-CSharp.dll \
+      'System.String UnityEngine.Application::get_dataPath()' \
+      'System.String UnityEngine.Application::get_persistentDataPath()' \
+      ConfigManager::Awake
+  '';
+}