92cda7a6bb
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.
52 lines
1.6 KiB
Nix
52 lines
1.6 KiB
Nix
{ stdenv, lib, fetchurl
|
|
, SDL, dwarf-fortress-unfuck
|
|
}:
|
|
|
|
let
|
|
baseVersion = "42";
|
|
patchVersion = "05";
|
|
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";
|
|
sha256 = "0g7r0v2lsqj9ryxh12q8yrk96bgs00rf2ncw228cwwqgmps3xcws";
|
|
};
|
|
|
|
installPhase = ''
|
|
mkdir -p $out
|
|
cp -r * $out
|
|
rm $out/libs/lib*
|
|
|
|
# Store the original hash
|
|
orig_hash=$(md5sum $out/libs/Dwarf_Fortress | awk '{ print $1 }')
|
|
echo $orig_hash | cut -c1-8 > $out/hash.md5.orig # for dwarf-therapist
|
|
echo $orig_hash > $out/full-hash-orig.md5 # for dfhack
|
|
|
|
patchelf \
|
|
--set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) \
|
|
--set-rpath "${libpath}" \
|
|
$out/libs/Dwarf_Fortress
|
|
|
|
# Store new hash
|
|
patched_hash=$(md5sum $out/libs/Dwarf_Fortress | awk '{ print $1 }')
|
|
echo $patched_hash | cut -c1-8 > $out/hash.md5.patched # for dwarf-therapist
|
|
echo $patched_hash > $out/full-hash-patched.md5 # for dfhack
|
|
'';
|
|
|
|
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;
|
|
maintainers = with lib.maintainers; [ a1russell robbinch roconnor the-kenny abbradar ];
|
|
};
|
|
}
|