2021-01-17 14:51:41 +01:00
|
|
|
{ lib, stdenvNoCC, buildEnv, writeShellScriptBin, fetchurl, jre }:
|
2018-07-04 22:04:19 +02:00
|
|
|
|
2018-07-05 01:06:00 +02:00
|
|
|
let
|
2018-07-04 22:04:19 +02:00
|
|
|
name = "legends-browser-${version}";
|
|
|
|
version = "1.17.1";
|
|
|
|
|
2018-07-05 01:06:00 +02:00
|
|
|
jar = fetchurl {
|
2018-07-04 22:04:19 +02:00
|
|
|
url = "https://github.com/robertjanetzko/LegendsBrowser/releases/download/${version}/legendsbrowser-${version}.jar";
|
|
|
|
sha256 = "05b4ksbl4481rh3ykfirbp6wvxhppcd5mvclhn9995gsrcaj8gx9";
|
|
|
|
};
|
2018-07-05 01:06:00 +02: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 22:04:19 +02:00
|
|
|
'';
|
2018-07-05 01:06:00 +02:00
|
|
|
in
|
|
|
|
|
|
|
|
buildEnv {
|
|
|
|
inherit name;
|
|
|
|
paths = [ script ];
|
2018-07-04 22:04:19 +02:00
|
|
|
|
2021-01-17 14:51:41 +01:00
|
|
|
meta = with lib; {
|
2018-07-04 22:04:19 +02:00
|
|
|
description = "A multi-platform, open source, java-based legends viewer for dwarf fortress";
|
|
|
|
maintainers = with maintainers; [ Baughn ];
|
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.all;
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://github.com/robertjanetzko/LegendsBrowser";
|
2018-07-04 22:04:19 +02:00
|
|
|
};
|
|
|
|
}
|