1{
2 lib,
3 buildEnv,
4 writeShellScriptBin,
5 fetchurl,
6 jre,
7}:
8
9let
10 name = "legends-browser-${version}";
11 version = "1.19.2";
12
13 jar = fetchurl {
14 url = "https://github.com/robertjanetzko/LegendsBrowser/releases/download/${version}/legendsbrowser-${version}.jar";
15 hash = "sha256-jkv7InwaRn0K3VAa0LqkYpH6TnrT/tGYBtbvNGM6t98=";
16 };
17
18 script = writeShellScriptBin "legends-browser" ''
19 set -eu
20 BASE="$HOME/.local/share/df_linux/legends-browser/"
21 mkdir -p "$BASE"
22 cd "$BASE"
23 if [[ ! -e legendsbrowser.properties ]]; then
24 echo 'Creating initial configuration for legends-browser'
25 echo "last=$(cd ..; pwd)" > legendsbrowser.properties
26 fi
27 exec ${jre}/bin/java -jar ${jar}
28 '';
29in
30
31buildEnv {
32 inherit name;
33 paths = [ script ];
34
35 meta = with lib; {
36 description = "Multi-platform, open source, java-based legends viewer for dwarf fortress";
37 maintainers = with maintainers; [
38 Baughn
39 numinit
40 ];
41 sourceProvenance = with sourceTypes; [ binaryBytecode ];
42 license = licenses.mit;
43 platforms = platforms.all;
44 homepage = "https://github.com/robertjanetzko/LegendsBrowser";
45 };
46}