migrate racket to nix
This commit is contained in:
parent
54510b713e
commit
f16eb5fa42
|
@ -1,10 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# curl racket 8.3 linux installation shell file
|
||||
curl -L 'https://download.racket-lang.org/installers/8.3/racket-8.3-x86_64-linux-cs.sh' -o racket.sh
|
||||
|
||||
# provide settings "no" "4" and "<CR>" to racket.sh
|
||||
echo "no
|
||||
4
|
||||
" | sh racket.sh
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Path to racket binary
|
||||
export PATH=$PWD/bin:$PATH
|
||||
export RACKET_PATH=$PWD/racket
|
|
@ -1,5 +0,0 @@
|
|||
{
|
||||
"language": "racket",
|
||||
"version": "8.3.0",
|
||||
"aliases": ["rkt"]
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
"$RACKET_PATH"/bin/racket "$@"
|
|
@ -1,3 +0,0 @@
|
|||
#lang racket
|
||||
|
||||
(display "OK")
|
|
@ -22,4 +22,5 @@ args: {
|
|||
"sqlite3" = import ./sqlite3.nix args;
|
||||
"rscript" = import ./rscript.nix args;
|
||||
"raku" = import ./raku.nix args;
|
||||
"racket" = import ./racket.nix args;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,61 @@
|
|||
{pkgs, piston, ...}:
|
||||
let
|
||||
pkg = pkgs.racket-minimal;
|
||||
in piston.mkRuntime {
|
||||
language = "racket";
|
||||
version = pkg.version;
|
||||
|
||||
aliases = [
|
||||
"rkt"
|
||||
];
|
||||
|
||||
run = ''
|
||||
${pkg}/bin/racket "$@"
|
||||
'';
|
||||
|
||||
tests = [
|
||||
# test different file extension
|
||||
(piston.mkTest {
|
||||
files = {
|
||||
"file.code" = ''
|
||||
#lang racket
|
||||
(display "OK")
|
||||
'';
|
||||
};
|
||||
args = [];
|
||||
stdin = "";
|
||||
packages = [];
|
||||
main = "file.code";
|
||||
})
|
||||
#test argv
|
||||
(piston.mkTest {
|
||||
files = {
|
||||
"test.rkt" = ''
|
||||
#lang racket
|
||||
(for ([arg (current-command-line-arguments)]) (displayln arg))
|
||||
'';
|
||||
};
|
||||
args = ["OK"];
|
||||
stdin = "";
|
||||
packages = [];
|
||||
main = "test.rkt";
|
||||
})
|
||||
# test stdin
|
||||
(piston.mkTest {
|
||||
files = {
|
||||
"test.rkt" = ''
|
||||
#lang racket
|
||||
(let loop ()
|
||||
(match (read-char)
|
||||
[(? eof-object?) (void)]
|
||||
[c (display c)
|
||||
(loop)]))
|
||||
'';
|
||||
};
|
||||
args = [];
|
||||
stdin = "OK";
|
||||
packages = [];
|
||||
main = "test.rkt";
|
||||
})
|
||||
];
|
||||
}
|
Loading…
Reference in New Issue