migrate raku to nix

This commit is contained in:
Dan Vargas 2022-02-06 19:10:04 -07:00
parent a8c23ecd99
commit 54510b713e
7 changed files with 59 additions and 18 deletions

View File

@ -1,5 +0,0 @@
#!/usr/bin/env bash
curl -L "https://rakudo.org/dl/rakudo/rakudo-moar-2021.05-01-linux-x86_64-gcc.tar.gz" -o raku.tar.xz
tar xf raku.tar.xz --strip-components=1
rm raku.tar.xz

View File

@ -1,4 +0,0 @@
#!/bin/bash
# Path to raku binary
export PATH=$PWD/bin:$PATH

View File

@ -1,5 +0,0 @@
{
"language": "raku",
"version": "6.100.0",
"aliases": ["raku", "rakudo", "perl6", "p6", "pl6"]
}

View File

@ -1,3 +0,0 @@
#!/bin/bash
raku "$@"

View File

@ -1 +0,0 @@
say "OK"

View File

@ -21,4 +21,5 @@ args: {
"node-typescript" = import ./node-typescript.nix args;
"sqlite3" = import ./sqlite3.nix args;
"rscript" = import ./rscript.nix args;
"raku" = import ./raku.nix args;
}

58
runtimes/raku.nix Normal file
View File

@ -0,0 +1,58 @@
{pkgs, piston, ...}:
let
pkg = pkgs.rakudo;
in piston.mkRuntime {
language = "raku";
version = pkg.version;
aliases = [
"raku"
"rakudo"
"perl6"
"p6"
"pl6"
];
run = ''
${pkg}/bin/raku "$@"
'';
tests = [
# test different extension
(piston.mkTest {
files = {
"file.code" = ''
say "OK"
'';
};
args = [];
stdin = "";
packages = [];
main = "file.code";
})
# test argv
(piston.mkTest {
files = {
"test.raku" = ''
print @*ARGS
'';
};
args = ["OK"];
stdin = "";
packages = [];
main = "test.raku";
})
# test stdin
(piston.mkTest {
files = {
"test.raku" = ''
say prompt
'';
};
args = [];
stdin = "OK";
packages = [];
main = "test.raku";
})
];
}