nixpkgs/pkgs/games/dwarf-fortress/dfhack/default.nix
Nikolay Amiantov 92cda7a6bb dwarf-fortress: 0.40.24 -> 0.42.05, split derivations
This is a massive rework of the current dwarf_fortress package.
The main reason for rework is to split game, its libraries and wrappers,
enabling builds on Hydra and general maintainability.

dfhack, dwarf-fortress-unfuck, dwarf-fortress-original and dwarf-fortress
are now all separate derivations. All were updated to the latest versions
supporting DF 0.42.04 (some things taken from development branches):

dfhack: 20150927 -> 20160118
dwarf-fortress-unfuck: 0.40.24 -> 20160118
dwarf-fortress-original: 0.40.24 -> 0.42.05

dfhack got a patch for using more system libraries.

Wrapper scripts were also redone -- now they support DF_DIR variable (for
setting another data directory) and try to save more space by means of
symlinking. They now try to be more smart, updating those directories that were
not touched by user automatically.

All the new packages now reside in dwarf-fortress-packages. dwarf_fortress was
renamed into dwarf-fortress per our conventions, old name is deprecated. Also
duplicate dfhack derivation is removed.

Also drop dwarfFortress.enableDFHack config option; it can be re-added later
but now is deemed controversial.
2016-01-26 03:03:12 +03:00

50 lines
1.2 KiB
Nix

{ stdenv, fetchgit, cmake, writeScriptBin
, perl, XMLLibXML, XMLLibXSLT
, zlib
, jsoncpp, protobuf, tinyxml
}:
let
rev = "f61ff9147e00f3c379ac0458e79eb556a5de1b68";
dfVersion = "0.42.05";
fakegit = writeScriptBin "git" ''
#! ${stdenv.shell}
if [ "$*" = "describe --tags --long" ]; then
echo "${dfVersion}-unknown"
elif [ "$*" = "rev-parse HEAD" ]; then
echo "${rev}"
else
exit 1
fi
'';
in stdenv.mkDerivation {
name = "dfhack-20160118";
# Beware of submodules
src = fetchgit {
url = "https://github.com/DFHack/dfhack";
inherit rev;
sha256 = "1ah3cplp4mb9pq7rm1cmn8klfjxw3y2xfzy7734i81b3iwiwlpi4";
};
patches = [ ./use-system-libraries.patch ];
nativeBuildInputs = [ cmake perl XMLLibXML XMLLibXSLT fakegit ];
# we can't use native Lua; upstream uses private headers
buildInputs = [ zlib jsoncpp protobuf tinyxml ];
enableParallelBuilding = true;
passthru = { inherit dfVersion; };
meta = with stdenv.lib; {
description = "Memory hacking library for Dwarf Fortress and a set of tools that use it";
homepage = https://github.com/DFHack/dfhack/;
license = licenses.zlib;
platforms = [ "i686-linux" ];
maintainers = with maintainers; [ robbinch a1russell abbradar ];
};
}