9 stdenv.mkDerivation rec {
11 version = "2023-07-31";
14 # Upstream does not provide versioned download links
15 url = "https://web.archive.org/web/20230806114836/https://frinklang.org/frinkjar/frink.jar";
16 sha256 = "sha256-u44g/pM4ie3NcBh6MZpN8+oWZLYz0LN5ozetee1iXNk=";
21 nativeBuildInputs = [ jdk ];
23 buildInputs = [ jdk rlwrap ];
28 mkdir -p $out/bin $out/lib
30 cp ${src} $out/lib/frink.jar
32 # Generate rlwrap helper files.
33 # See https://frinklang.org/fsp/colorize.fsp?f=listUnits.frink
34 # and https://frinklang.org/fsp/colorize.fsp?f=listFunctions.frink
35 java -classpath "$out/lib/frink.jar" frink.gui.FrinkStarter -e 'joinln[lexicalSort[units[]]]' > $out/lib/unitnames.txt
36 java -classpath "$out/lib/frink.jar" frink.gui.FrinkStarter -e 'joinln[map[{|f|
39 }, lexicalSort[functions[]]]]' > $out/lib/functionnames.txt
41 cat > "$out/bin/frink" << EOF
43 exec ${rlwrap}/bin/rlwrap -f $out/lib/unitnames.txt -b '$' -f $out/lib/functionnames.txt ${jdk}/bin/java -classpath "$out/lib/frink.jar" frink.gui.FrinkStarter "\$@"
46 chmod a+x "$out/bin/frink"
52 description = "A practical calculating tool and programming language";
53 homepage = "https://frinklang.org/";
54 license = licenses.unfree;
55 sourceProvenance = [ sourceTypes.binaryBytecode ];
56 maintainers = [ maintainers.stefanfehrenbach ];
60 callFrinkVersion = testers.testVersion {
62 command = "frink -e 'FrinkVersion[]'";