2016-01-12 18:56:59 +01:00
|
|
|
{ stdenv, lib, fetchurl
|
|
|
|
, SDL, dwarf-fortress-unfuck
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2017-12-07 00:53:24 +01:00
|
|
|
baseVersion = "44";
|
2018-04-12 23:36:29 +02:00
|
|
|
patchVersion = "09";
|
2016-01-12 18:56:59 +01:00
|
|
|
dfVersion = "0.${baseVersion}.${patchVersion}";
|
|
|
|
libpath = lib.makeLibraryPath [ stdenv.cc.cc stdenv.glibc dwarf-fortress-unfuck SDL ];
|
2016-08-13 02:10:46 +02:00
|
|
|
platform =
|
|
|
|
if stdenv.system == "x86_64-linux" then "linux"
|
|
|
|
else if stdenv.system == "i686-linux" then "linux32"
|
|
|
|
else throw "Unsupported platform";
|
|
|
|
sha256 =
|
2018-04-12 23:36:29 +02:00
|
|
|
if stdenv.system == "x86_64-linux" then "1haikynkg1pqyrzzqk1qxm19p36ww58qp8brh3fjxssp4x71rcdy"
|
|
|
|
else if stdenv.system == "i686-linux" then "0lmbrdf7wjdwj5yx0khnq871yxvhfwqxjjyfkqcdy5ik18lvlkj8"
|
2016-08-13 02:10:46 +02:00
|
|
|
else throw "Unsupported platform";
|
2016-01-12 18:56:59 +01:00
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
assert dwarf-fortress-unfuck.dfVersion == dfVersion;
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "dwarf-fortress-original-${dfVersion}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
2016-08-13 02:10:46 +02:00
|
|
|
url = "http://www.bay12games.com/dwarves/df_${baseVersion}_${patchVersion}_${platform}.tar.bz2";
|
|
|
|
inherit sha256;
|
2016-01-12 18:56:59 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
|
|
|
cp -r * $out
|
|
|
|
rm $out/libs/lib*
|
|
|
|
|
|
|
|
# Store the original hash
|
2016-01-23 21:57:58 +01:00
|
|
|
md5sum $out/libs/Dwarf_Fortress | awk '{ print $1 }' > $out/hash.md5.orig
|
2016-01-12 18:56:59 +01:00
|
|
|
|
|
|
|
patchelf \
|
|
|
|
--set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) \
|
|
|
|
--set-rpath "${libpath}" \
|
|
|
|
$out/libs/Dwarf_Fortress
|
|
|
|
|
2016-01-23 21:57:58 +01:00
|
|
|
# Store the new hash
|
|
|
|
md5sum $out/libs/Dwarf_Fortress | awk '{ print $1 }' > $out/hash.md5
|
2016-01-12 18:56:59 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
passthru = { inherit baseVersion patchVersion dfVersion; };
|
|
|
|
|
2016-08-13 02:10:46 +02:00
|
|
|
meta = with stdenv.lib; {
|
2016-01-12 18:56:59 +01:00
|
|
|
description = "A single-player fantasy game with a randomly generated adventure world";
|
2017-08-01 22:03:30 +02:00
|
|
|
homepage = http://www.bay12games.com/dwarves;
|
2016-08-13 02:10:46 +02:00
|
|
|
license = licenses.unfreeRedistributable;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ a1russell robbinch roconnor the-kenny abbradar ];
|
2016-01-12 18:56:59 +01:00
|
|
|
};
|
|
|
|
}
|