From 4fca46cfcfd9c80f8beb76d053e157d5c31ddcd4 Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Mon, 5 Sep 2016 22:34:42 +0200 Subject: pkgs/games/humblebundle: add pico-8 Not really a game but a emulator of an imaginary console, so close enough. This package uses the dynamically linked pico-8 version, the (probably) statically linked one had an inexplicable issue with SDL. --- pkgs/games/humblebundle/default.nix | 1 + pkgs/games/humblebundle/pico-8.nix | 45 +++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 pkgs/games/humblebundle/pico-8.nix (limited to 'pkgs/games') diff --git a/pkgs/games/humblebundle/default.nix b/pkgs/games/humblebundle/default.nix index 1c1e7a21..e1c7c0e1 100644 --- a/pkgs/games/humblebundle/default.nix +++ b/pkgs/games/humblebundle/default.nix @@ -21,6 +21,7 @@ let jamestown = callPackage ./jamestown.nix {}; liads = callPackage ./liads.nix {}; megabytepunch = callPackage ./megabytepunch.nix {}; + pico-8 = callPackage ./pico-8.nix {}; rocketbirds = callPackage ./rocketbirds.nix {}; spaz = callPackage ./spaz.nix {}; starbound = callPackage ./starbound.nix {}; diff --git a/pkgs/games/humblebundle/pico-8.nix b/pkgs/games/humblebundle/pico-8.nix new file mode 100644 index 00000000..e54e3302 --- /dev/null +++ b/pkgs/games/humblebundle/pico-8.nix @@ -0,0 +1,45 @@ +{ stdenv, fetchHumbleBundle, SDL2, unzip }: + +stdenv.mkDerivation rec { + name = "pico-8-${version}"; + version = "0.1.8"; + + src = fetchHumbleBundle { + name = "pico8_linux"; + machineName = "pico8_linux"; + downloadName = { + "x86_64-linux" = "64-bit"; + "i686-linux" = "32-bit"; + }.${stdenv.system}; + md5 = "5866cf247c3390011fb4e84092c3ac8e"; + }; + + unpackCmd = '' + ${unzip}/bin/unzip -qq -d . "$src" || : + ''; + + phases = [ "unpackPhase" "buildPhase" "installPhase" ]; + + buildPhase = let + rpath = stdenv.lib.makeLibraryPath [ + stdenv.cc.cc SDL2 + ]; + in '' + patchelf \ + --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ + --set-rpath "${rpath}" pico8_dyn + ''; + + installPhase = '' + install -vD pico8_dyn "$out/share/pico8" + install -vD pico8.dat "$out/share/pico8.dat" + install -vD pico-8.txt "$out/share/pico-8.txt" + install -vD license.txt "$out/share/license.txt" + install -vD lexaloffle-pico8.png "$out/share/lexaloffle-pico8.png" + + mkdir -p "$out/bin" + ln -s "$out/share/pico8" "$out/bin/pico8" + ''; + + dontPatchELF = true; +} -- cgit 1.4.1