2021-07-03 03:11:41 +00:00
|
|
|
{ stdenvNoCC
|
|
|
|
, lib
|
|
|
|
, fetchurl
|
|
|
|
, unzip
|
2020-04-24 23:36:52 +00:00
|
|
|
, dfVersion
|
|
|
|
}:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
twbt-releases = {
|
|
|
|
"0.44.10" = {
|
|
|
|
twbtRelease = "6.49";
|
|
|
|
sha256 = "1qjkc7k33qhxj2g18njzasccjqsis5y8zrw5vl90h4rs3i8ld9xz";
|
|
|
|
prerelease = false;
|
|
|
|
};
|
|
|
|
"0.44.11" = {
|
|
|
|
twbtRelease = "6.51";
|
|
|
|
sha256 = "1yclqmarjd97ch054h425a12r8a5ailmflsd7b39cg4qhdr1nii5";
|
|
|
|
prerelease = true;
|
|
|
|
};
|
|
|
|
"0.44.12" = {
|
|
|
|
twbtRelease = "6.54";
|
|
|
|
sha256 = "10gfd6vv0vk4v1r5hjbz7vf1zqys06dsad695gysc7fbcik2dakh";
|
|
|
|
prerelease = false;
|
|
|
|
};
|
|
|
|
"0.47.02" = {
|
|
|
|
twbtRelease = "6.61";
|
|
|
|
sha256 = "07bqy9rkd64h033sxdpigp5zq4xrr0xd36wdr1b21g649mv8j6yw";
|
|
|
|
prerelease = false;
|
|
|
|
};
|
|
|
|
"0.47.04" = {
|
2020-09-25 04:45:31 +00:00
|
|
|
twbtRelease = "6.xx";
|
2022-12-02 08:20:57 +00:00
|
|
|
dfhackRelease = "0.47.04-r5";
|
|
|
|
sha256 = "sha256-+C3g4KJShCb2VXGQ4mtkDOufXZQ1P+ebDTmUzL3tNyU=";
|
2020-09-25 04:45:31 +00:00
|
|
|
prerelease = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2021-07-14 22:03:04 +00:00
|
|
|
"0.47.05" = {
|
|
|
|
twbtRelease = "6.xx";
|
2022-12-02 08:20:57 +00:00
|
|
|
dfhackRelease = "0.47.05-r7";
|
|
|
|
sha256 = "sha256-4xMKuSP5J6pMK+hwjTAcTI0gsLJfw+Xt+vh9CopR4tk=";
|
2021-07-14 22:03:04 +00:00
|
|
|
prerelease = true;
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-07-03 03:11:41 +00:00
|
|
|
release =
|
|
|
|
if hasAttr dfVersion twbt-releases
|
|
|
|
then getAttr dfVersion twbt-releases
|
|
|
|
else throw "[TWBT] Unsupported Dwarf Fortress version: ${dfVersion}";
|
2020-04-24 23:36:52 +00:00
|
|
|
in
|
|
|
|
|
|
|
|
stdenvNoCC.mkDerivation rec {
|
|
|
|
pname = "twbt";
|
|
|
|
version = release.twbtRelease;
|
|
|
|
|
|
|
|
src = fetchurl {
|
2020-09-25 04:45:31 +00:00
|
|
|
url =
|
|
|
|
if version == "6.xx" then
|
|
|
|
"https://github.com/thurin/df-twbt/releases/download/${release.dfhackRelease}/twbt-${version}-linux64-${release.dfhackRelease}.zip"
|
|
|
|
else
|
|
|
|
"https://github.com/mifki/df-twbt/releases/download/v${version}/twbt-${version}-linux.zip";
|
2020-04-24 23:36:52 +00:00
|
|
|
sha256 = release.sha256;
|
|
|
|
};
|
|
|
|
|
|
|
|
sourceRoot = ".";
|
|
|
|
|
|
|
|
outputs = [ "lib" "art" "out" ];
|
|
|
|
|
2021-03-19 17:17:44 +00:00
|
|
|
nativeBuildInputs = [ unzip ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $lib/hack/{plugins,lua} $art/data/art
|
|
|
|
cp -a */twbt.plug.so $lib/hack/plugins/
|
|
|
|
cp -a *.lua $lib/hack/lua/
|
|
|
|
cp -a *.png $art/data/art/
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A plugin for Dwarf Fortress / DFHack that improves various aspects the game interface.";
|
|
|
|
maintainers = with maintainers; [ Baughn numinit ];
|
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
homepage = "https://github.com/mifki/df-twbt";
|
|
|
|
};
|
|
|
|
}
|