From 3e3ea0689898d247235cd8bb67be5cf82ff26956 Mon Sep 17 00:00:00 2001 From: Guillaume Maudoux Date: Tue, 14 Jul 2015 17:26:11 +0200 Subject: unepic: Add unepic at version 1.50.5 --- humblebundle/default.nix | 1 + humblebundle/unepic.nix | 44 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 humblebundle/unepic.nix diff --git a/humblebundle/default.nix b/humblebundle/default.nix index 953f3481..e77a7deb 100644 --- a/humblebundle/default.nix +++ b/humblebundle/default.nix @@ -20,6 +20,7 @@ let rocketbirds = callPackage ./rocketbirds.nix {}; spaz = callPackage ./spaz.nix {}; swordsandsoldiers = callPackage ./swordsandsoldiers.nix {}; + unepic = callPackage ./unepic.nix {}; }; in with lib; { options.humblebundle = { diff --git a/humblebundle/unepic.nix b/humblebundle/unepic.nix new file mode 100644 index 00000000..cc4099f5 --- /dev/null +++ b/humblebundle/unepic.nix @@ -0,0 +1,44 @@ +{ stdenv, fetchHumbleBundle, unzip, makeWrapper, SDL2, SDL2_mixer, zlib }: + +let + version = "1.50.5"; + versionName = "15005"; + arch = { + "i686-linux" = "32"; + "x86_64-linux" = "64"; + }.${stdenv.system}; +in stdenv.mkDerivation rec { + name = "unepic-${version}"; + + src = fetchHumbleBundle { + name = "unepic-15005.run"; + machineName = "unepic_linux"; + downloadName = ".run"; + md5 = "940824c4de6e48522845f63423e87783"; + }; + + phases = [ "installPhase" ]; + + buildInputs = [ unzip makeWrapper ]; + + installPhase = let + rpath = stdenv.lib.makeLibraryPath [ SDL2 SDL2_mixer zlib stdenv.cc.cc ]; + in '' + dest="$out/opt/games/unepic" + exe="$dest/unepic${arch}" + + mkdir -p "$out/opt/games" + unzip "$src" "data/*" -d "$out/opt/games" || [ "$?" -eq 1 ] + mv "$out/opt/games/data" "$dest" + rm -r "$dest"/lib* + + # Patch $exe acccording to arch. + patchelf \ + --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ + --set-rpath "${rpath}" "$exe" + + mkdir -p "$out/bin" + + makeWrapper "$exe" "$out/bin/unepic" --run "cd '$dest'" + ''; +} -- cgit 1.4.1