2016-01-12 17:56:59 +00:00
|
|
|
{ stdenv, lib, fetchurl
|
|
|
|
, SDL, dwarf-fortress-unfuck
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
baseVersion = "42";
|
2016-03-03 11:58:13 +00:00
|
|
|
patchVersion = "06";
|
2016-01-12 17:56:59 +00:00
|
|
|
dfVersion = "0.${baseVersion}.${patchVersion}";
|
|
|
|
libpath = lib.makeLibraryPath [ stdenv.cc.cc stdenv.glibc dwarf-fortress-unfuck SDL ];
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
assert dwarf-fortress-unfuck.dfVersion == dfVersion;
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "dwarf-fortress-original-${dfVersion}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://www.bay12games.com/dwarves/df_${baseVersion}_${patchVersion}_linux.tar.bz2";
|
2016-03-03 11:58:13 +00:00
|
|
|
sha256 = "17y9zq9xn1g0a501w4vkinb0n2yjiczsi2g7r6zggr41pxrqxpq3";
|
2016-01-12 17:56:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
|
|
|
cp -r * $out
|
|
|
|
rm $out/libs/lib*
|
|
|
|
|
|
|
|
# Store the original hash
|
2016-01-23 20:57:58 +00:00
|
|
|
md5sum $out/libs/Dwarf_Fortress | awk '{ print $1 }' > $out/hash.md5.orig
|
2016-01-12 17:56:59 +00:00
|
|
|
|
|
|
|
patchelf \
|
|
|
|
--set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) \
|
|
|
|
--set-rpath "${libpath}" \
|
|
|
|
$out/libs/Dwarf_Fortress
|
|
|
|
|
2016-01-23 20:57:58 +00:00
|
|
|
# Store the new hash
|
|
|
|
md5sum $out/libs/Dwarf_Fortress | awk '{ print $1 }' > $out/hash.md5
|
2016-01-12 17:56:59 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
passthru = { inherit baseVersion patchVersion dfVersion; };
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "A single-player fantasy game with a randomly generated adventure world";
|
|
|
|
homepage = http://www.bay12games.com/dwarves;
|
|
|
|
license = lib.licenses.unfreeRedistributable;
|
2016-03-03 11:58:13 +00:00
|
|
|
platforms = [ "i686-linux" ];
|
2016-01-12 17:56:59 +00:00
|
|
|
maintainers = with lib.maintainers; [ a1russell robbinch roconnor the-kenny abbradar ];
|
|
|
|
};
|
|
|
|
}
|