2018-07-04 23:06:00 +00:00
|
|
|
{ stdenvNoCC, buildEnv, writeShellScriptBin, fetchurl, jre }:
|
2018-07-04 20:04:19 +00:00
|
|
|
|
2018-07-04 23:06:00 +00:00
|
|
|
let
|
2018-07-04 20:04:19 +00:00
|
|
|
name = "legends-browser-${version}";
|
|
|
|
version = "1.17.1";
|
|
|
|
|
2018-07-04 23:06:00 +00:00
|
|
|
jar = fetchurl {
|
2018-07-04 20:04:19 +00:00
|
|
|
url = "https://github.com/robertjanetzko/LegendsBrowser/releases/download/${version}/legendsbrowser-${version}.jar";
|
|
|
|
sha256 = "05b4ksbl4481rh3ykfirbp6wvxhppcd5mvclhn9995gsrcaj8gx9";
|
|
|
|
};
|
2018-07-04 23:06:00 +00:00
|
|
|
|
|
|
|
script = writeShellScriptBin "legends-browser" ''
|
|
|
|
set -eu
|
|
|
|
BASE="$HOME/.local/share/df_linux/legends-browser/"
|
|
|
|
mkdir -p "$BASE"
|
|
|
|
cd "$BASE"
|
|
|
|
if [[ ! -e legendsbrowser.properties ]]; then
|
|
|
|
echo 'Creating initial configuration for legends-browser'
|
|
|
|
echo "last=$(cd ..; pwd)" > legendsbrowser.properties
|
|
|
|
fi
|
|
|
|
${jre}/bin/java -jar ${jar}
|
2018-07-04 20:04:19 +00:00
|
|
|
'';
|
2018-07-04 23:06:00 +00:00
|
|
|
in
|
|
|
|
|
|
|
|
buildEnv {
|
|
|
|
inherit name;
|
|
|
|
paths = [ script ];
|
2018-07-04 20:04:19 +00:00
|
|
|
|
2018-07-04 23:06:00 +00:00
|
|
|
meta = with stdenvNoCC.lib; {
|
2018-07-04 20:04:19 +00:00
|
|
|
description = "A multi-platform, open source, java-based legends viewer for dwarf fortress";
|
|
|
|
maintainers = with maintainers; [ Baughn ];
|
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.all;
|
|
|
|
homepage = https://github.com/robertjanetzko/LegendsBrowser;
|
|
|
|
};
|
|
|
|
}
|