{ stdenv, pkgs, requireFile, SDL2, makeWrapper, mesa_glu, alsaLib, unzip, strace, ... }: let originalArchive = "gog_prison_architect_2.18.0.20.sh"; fetchfile = (import ../../lib/fetchfile.nix) { inherit stdenv pkgs; }; in stdenv.mkDerivation rec { name = "prison-architect-${version}"; version = "2.18.0.20"; src = fetchfile { path = ../../../nixrc-src-games/gog_prison_architect_2.18.0.20.sh; storeHash = "i2sl8hc5aaay2gw371zr0hpjdh6gw7ns"; }; phases = "unpackPhase installPhase"; unpackCmd = "${unzip}/bin/unzip -qq $src || true"; sourceRoot = "data"; libPath = stdenv.lib.makeLibraryPath [ mesa_glu alsaLib stdenv.cc.cc.lib SDL2 ]; buildInputs = [ makeWrapper ]; installPhase = '' mkdir -p $out mv noarch/game/* $out/ mkdir -p $out/bin chmod +x $out/PrisonArchitect.x86_64 patchelf \ --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \ $out/PrisonArchitect.x86_64 #for lib in linux/*.so{,.*}; do # patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) $lib #done makeWrapper ${strace}/bin/strace $out/bin/prison-architect-strace \ --add-flags -f \ --add-flags $out/PrisonArchitect.x86_64 \ --set SDL_AUDIODRIVER alsa \ --prefix LD_LIBRARY_PATH : /run/opengl-driver/lib:$libPath makeWrapper $out/PrisonArchitect.x86_64 $out/bin/prison-architect \ --set SDL_AUDIODRIVER alsa \ --prefix LD_LIBRARY_PATH : /run/opengl-driver/lib:$libPath ''; }