about summary refs log tree commit diff
path: root/humblebundle/liads.nix
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2016-02-08 17:00:34 +0100
committeraszlig <aszlig@redmoonstudios.org>2016-02-08 22:05:32 +0100
commit44cb15c7c64c17a27f18f61445ac9dc123395f96 (patch)
tree219b6b173329fa46ce7ee4e260bcb2cf6f07f014 /humblebundle/liads.nix
parent4655dc8299a6b91744a8c606dea95308388cc158 (diff)
humblebundle: Add Lovers In A Dangerous Spacetime
Yes, they're serious with that name, hence I have abbreviated it to
"liads", so you don't have to type something like this:

nix-build -A humblebundle.lovers-in-a-dangerous-spacetime

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Diffstat (limited to 'humblebundle/liads.nix')
-rw-r--r--humblebundle/liads.nix43
1 files changed, 43 insertions, 0 deletions
diff --git a/humblebundle/liads.nix b/humblebundle/liads.nix
new file mode 100644
index 00000000..a96af8e0
--- /dev/null
+++ b/humblebundle/liads.nix
@@ -0,0 +1,43 @@
+{ stdenv, fetchHumbleBundle, unzip, mesa, xorg, libpulseaudio }:
+
+stdenv.mkDerivation rec {
+  name = "liads-${version}";
+  version = "20160121";
+
+  src = fetchHumbleBundle {
+    machineName = "loversinadangerousspacetime_linux";
+    suffix = "zip";
+    md5 = "0d81adb63ca9233165fb5de415fa5963";
+  };
+
+  unpackCmd = ''
+    ${unzip}/bin/unzip -qq -d liads "$src" || :
+  '';
+
+  arch = if stdenv.system == "x86_64-linux" then "x86_64" else "x86";
+  executable = "LoversInADangerousSpacetime.${arch}";
+
+  buildPhase = let
+    rpath = stdenv.lib.makeLibraryPath [
+      stdenv.cc.cc mesa xorg.libX11 xorg.libXcursor xorg.libXrandr libpulseaudio
+    ];
+  in ''
+    patchelf \
+      --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
+      --set-rpath "${rpath}" "$executable"
+  '';
+
+  installPhase = ''
+    install -vD "$executable" "$out/libexec/liads/liads"
+    ln -s "$out/share/liads" "$out/libexec/liads/Data"
+
+    mkdir -p "$out/bin"
+    ln -s "$out/libexec/liads/liads" "$out/bin/liads"
+
+    mkdir -p "$out/share"
+    cp -vRd LoversInADangerousSpacetime_Data "$out/share/liads"
+  '';
+
+  dontStrip = true;
+  dontPatchELF = true;
+}