Merge pull request #234221 from fehrenbach/frink-2023-05-22

frink: 2023-01-31 -> 2023-05-22
This commit is contained in:
Weijia Wang 2023-06-14 15:27:38 +03:00 committed by GitHub
commit 8065b7d6dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,16 +8,18 @@
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "frink"; pname = "frink";
version = "2023-01-31"; version = "2023-05-22";
src = fetchurl { src = fetchurl {
# Upstream does not provide versioned download links # Upstream does not provide versioned download links
url = "https://web.archive.org/web/20230202134810/https://frinklang.org/frinkjar/frink.jar"; url = "https://web.archive.org/web/20230526123219/https://frinklang.org/frinkjar/frink.jar";
sha256 = "sha256-xs1FQvFPgeAxscAiwBBP8N8aYe0OlsYbH/vbzzCbYZc="; sha256 = "sha256-IgINJvt9G5f1HELKhV5BHIu9NoA8STDqNg/dVTFzK0Y=";
}; };
dontUnpack = true; dontUnpack = true;
nativeBuildInputs = [ jdk ];
buildInputs = [ jdk rlwrap ]; buildInputs = [ jdk rlwrap ];
installPhase = '' installPhase = ''
@ -27,9 +29,18 @@ stdenv.mkDerivation rec {
cp ${src} $out/lib/frink.jar cp ${src} $out/lib/frink.jar
# Generate rlwrap helper files.
# See https://frinklang.org/fsp/colorize.fsp?f=listUnits.frink
# and https://frinklang.org/fsp/colorize.fsp?f=listFunctions.frink
java -classpath "$out/lib/frink.jar" frink.gui.FrinkStarter -e 'joinln[lexicalSort[units[]]]' > $out/lib/unitnames.txt
java -classpath "$out/lib/frink.jar" frink.gui.FrinkStarter -e 'joinln[map[{|f|
f =~ %s/\s+//g
return "$f$"
}, lexicalSort[functions[]]]]' > $out/lib/functionnames.txt
cat > "$out/bin/frink" << EOF cat > "$out/bin/frink" << EOF
#!${stdenv.shell} #!${stdenv.shell}
exec ${rlwrap}/bin/rlwrap ${jdk}/bin/java -classpath "$out/lib/frink.jar" frink.gui.FrinkStarter "\$@" 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 "\$@"
EOF EOF
chmod a+x "$out/bin/frink" chmod a+x "$out/bin/frink"