depot/third_party/nixpkgs/pkgs/development/tools/frink/default.nix
Default email 4bac34ead1 Project import generated by Copybara.
GitOrigin-RevId: 724bfc0892363087709bd3a5a1666296759154b1
2023-02-09 12:40:11 +01:00

54 lines
1.2 KiB
Nix

{ fetchurl
, frink
, jdk
, lib
, rlwrap
, stdenv
, testers
}:
stdenv.mkDerivation rec {
pname = "frink";
version = "2023-01-31";
src = fetchurl {
# Upstream does not provide versioned download links
url = "https://web.archive.org/web/20230202134810/https://frinklang.org/frinkjar/frink.jar";
sha256 = "sha256-xs1FQvFPgeAxscAiwBBP8N8aYe0OlsYbH/vbzzCbYZc=";
};
dontUnpack = true;
buildInputs = [ jdk rlwrap ];
installPhase = ''
runHook preInstall
mkdir -p $out/bin $out/lib
cp ${src} $out/lib/frink.jar
cat > "$out/bin/frink" << EOF
#!${stdenv.shell}
exec ${rlwrap}/bin/rlwrap ${jdk}/bin/java -classpath "$out/lib/frink.jar" frink.gui.FrinkStarter "\$@"
EOF
chmod a+x "$out/bin/frink"
runHook postInstall
'';
meta = with lib; {
description = "A practical calculating tool and programming language";
homepage = "https://frinklang.org/";
license = licenses.unfree;
sourceProvenance = [ sourceTypes.binaryBytecode ];
maintainers = [ maintainers.stefanfehrenbach ];
};
passthru.tests = {
callFrinkVersion = testers.testVersion {
package = frink;
command = "frink -e 'FrinkVersion[]'";
};
};
}