Skip to content

Instantly share code, notes, and snippets.

@aszlig
Created December 20, 2018 12:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aszlig/ec82270b5a708639f28b536e63a82b61 to your computer and use it in GitHub Desktop.
Save aszlig/ec82270b5a708639f28b536e63a82b61 to your computer and use it in GitHub Desktop.
{ stdenv, buildGame, fetchGog, fetchFromGitHub, makeWrapper
# Dependencies for HashLink:
, cmake, pkgconfig, haxe
, SDL2, libGLU, libpng, libjpeg_turbo, libvorbis, mbedtls, openal, libuv
}:
let
hashlink = stdenv.mkDerivation rec {
name = "hashlink-${version}";
version = "1.6";
src = fetchFromGitHub {
owner = "HaxeFoundation";
repo = "hashlink";
rev = version;
sha256 = "1g3mmr2ghc778li15adpxqhyr5khf56pr53vpnfdi2kcbpnmi4g0";
};
cmakeFlags = [ "-DBUILD_TESTING=OFF" ];
nativeBuildInputs = [ cmake pkgconfig ];
buildInputs = [
SDL2 libGLU libpng libjpeg_turbo libvorbis mbedtls openal libuv
];
};
in buildGame rec {
name = "dead-cells-${version}";
version = "9.2";
src = fetchGog {
productId = 1237807960;
downloadName = "en3installer0";
sha256 = "1w0fj0nxcqz4wjl3vs6c7mn201ni784i1gdv293abzxjsc92l738";
};
inherit hashlink;
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ libuv hashlink ];
installPhase = ''
for i in hlboot.dat res.pak; do
install -vD -m 0644 "$i" "$out/share/dead-cells/$i"
done
install -vD uv.hdll "$out/libexec/dead-cells/uv.hdll"
makeWrapper "$hashlink/bin/hl" "$out/bin/dead-cells" \
--prefix LD_LIBRARY_PATH : "$out/libexec/dead-cells" \
--add-flags "$out/share/dead-cells/hlboot.dat"
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment