diff options
author | Svein Ove Aas <sveina@gmail.com> | 2018-07-05 16:36:27 +0100 |
---|---|---|
committer | Svein Ove Aas <sveina@gmail.com> | 2018-07-05 20:21:59 +0100 |
commit | 5012ce727ab54d7fe02ae730011d3160ab3743a0 (patch) | |
tree | 91b42c716887e30c3e16e5fca145269837d8d416 /pkgs/games/dwarf-fortress/dfhack | |
parent | 1bb95d8409aabcc9ee52045771b7c9109336fc2f (diff) |
dwarf-fortress: Init TWBT at 6.46
Diffstat (limited to 'pkgs/games/dwarf-fortress/dfhack')
-rw-r--r-- | pkgs/games/dwarf-fortress/dfhack/default.nix | 60 |
1 files changed, 34 insertions, 26 deletions
diff --git a/pkgs/games/dwarf-fortress/dfhack/default.nix b/pkgs/games/dwarf-fortress/dfhack/default.nix index a6430fa3c260..3acd556e80cc 100644 --- a/pkgs/games/dwarf-fortress/dfhack/default.nix +++ b/pkgs/games/dwarf-fortress/dfhack/default.nix @@ -1,6 +1,7 @@ -{ stdenv, hostPlatform, lib, fetchFromGitHub, cmake, writeScriptBin, callPackage +{ stdenv, buildEnv, hostPlatform, lib, fetchurl, fetchFromGitHub, cmake, writeScriptBin, callPackage , perl, XMLLibXML, XMLLibXSLT, zlib , enableStoneSense ? false, allegro5, libGLU_combined +, enableTWBT ? true, twbt , SDL }: @@ -33,40 +34,47 @@ let fi ''; -in stdenv.mkDerivation rec { - name = "dfhack-${version}"; + dfhack = stdenv.mkDerivation rec { + name = "dfhack-base-${version}"; - # Beware of submodules - src = fetchFromGitHub { - owner = "DFHack"; - repo = "dfhack"; - sha256 = "1vzrpdw0pn18calayf9dwqpyg37cb7wkzkvskxjx9nak5ilxzywm"; - rev = version; - fetchSubmodules = true; - }; + # Beware of submodules + src = fetchFromGitHub { + owner = "DFHack"; + repo = "dfhack"; + sha256 = "1vzrpdw0pn18calayf9dwqpyg37cb7wkzkvskxjx9nak5ilxzywm"; + rev = version; + fetchSubmodules = true; + }; - nativeBuildInputs = [ cmake perl XMLLibXML XMLLibXSLT fakegit ]; - # We don't use system libraries because dfhack needs old C++ ABI. - buildInputs = [ zlib SDL ] - ++ lib.optionals enableStoneSense [ allegro5 libGLU_combined ]; + nativeBuildInputs = [ cmake perl XMLLibXML XMLLibXSLT fakegit ]; + # We don't use system libraries because dfhack needs old C++ ABI. + buildInputs = [ zlib SDL ] + ++ lib.optionals enableStoneSense [ allegro5 libGLU_combined ]; - preConfigure = '' - # Trick build system into believing we have .git - mkdir -p .git/modules/library/xml - touch .git/index .git/modules/library/xml/index - ''; + preConfigure = '' + # Trick build system into believing we have .git + mkdir -p .git/modules/library/xml + touch .git/index .git/modules/library/xml/index + ''; - preBuild = '' - export LD_LIBRARY_PATH="$PWD/depends/protobuf:$LD_LIBRARY_PATH" - ''; + preBuild = '' + export LD_LIBRARY_PATH="$PWD/depends/protobuf:$LD_LIBRARY_PATH" + ''; - cmakeFlags = [ "-DDFHACK_BUILD_ARCH=${arch}" "-DDOWNLOAD_RUBY=OFF" ] - ++ lib.optionals enableStoneSense [ "-DBUILD_STONESENSE=ON" "-DSTONESENSE_INTERNAL_SO=OFF" ]; + cmakeFlags = [ "-DDFHACK_BUILD_ARCH=${arch}" "-DDOWNLOAD_RUBY=OFF" ] + ++ lib.optionals enableStoneSense [ "-DBUILD_STONESENSE=ON" "-DSTONESENSE_INTERNAL_SO=OFF" ]; - enableParallelBuilding = true; + enableParallelBuilding = true; + }; +in + +buildEnv { + name = "dfhack-${version}"; passthru = { inherit version dfVersion; }; + paths = [ dfhack ] ++ lib.optionals enableTWBT [ twbt.lib ]; + 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/; |