From 54510b713ebdb10acc7bd1f3e8e9eae2797901b5 Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Sun, 6 Feb 2022 19:10:04 -0700 Subject: [PATCH] migrate raku to nix --- packages/raku/6.100.0/build.sh | 5 --- packages/raku/6.100.0/environment | 4 -- packages/raku/6.100.0/metadata.json | 5 --- packages/raku/6.100.0/run | 3 -- packages/raku/6.100.0/test.raku | 1 - runtimes/default.nix | 1 + runtimes/raku.nix | 58 +++++++++++++++++++++++++++++ 7 files changed, 59 insertions(+), 18 deletions(-) delete mode 100644 packages/raku/6.100.0/build.sh delete mode 100644 packages/raku/6.100.0/environment delete mode 100644 packages/raku/6.100.0/metadata.json delete mode 100644 packages/raku/6.100.0/run delete mode 100644 packages/raku/6.100.0/test.raku create mode 100644 runtimes/raku.nix diff --git a/packages/raku/6.100.0/build.sh b/packages/raku/6.100.0/build.sh deleted file mode 100644 index 20be2fc..0000000 --- a/packages/raku/6.100.0/build.sh +++ /dev/null @@ -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 \ No newline at end of file diff --git a/packages/raku/6.100.0/environment b/packages/raku/6.100.0/environment deleted file mode 100644 index 12ab624..0000000 --- a/packages/raku/6.100.0/environment +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -# Path to raku binary -export PATH=$PWD/bin:$PATH \ No newline at end of file diff --git a/packages/raku/6.100.0/metadata.json b/packages/raku/6.100.0/metadata.json deleted file mode 100644 index e1fbad8..0000000 --- a/packages/raku/6.100.0/metadata.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "language": "raku", - "version": "6.100.0", - "aliases": ["raku", "rakudo", "perl6", "p6", "pl6"] -} diff --git a/packages/raku/6.100.0/run b/packages/raku/6.100.0/run deleted file mode 100644 index 6c2c077..0000000 --- a/packages/raku/6.100.0/run +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -raku "$@" \ No newline at end of file diff --git a/packages/raku/6.100.0/test.raku b/packages/raku/6.100.0/test.raku deleted file mode 100644 index f863fac..0000000 --- a/packages/raku/6.100.0/test.raku +++ /dev/null @@ -1 +0,0 @@ -say "OK" \ No newline at end of file diff --git a/runtimes/default.nix b/runtimes/default.nix index 9aad700..5131bb6 100644 --- a/runtimes/default.nix +++ b/runtimes/default.nix @@ -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; } diff --git a/runtimes/raku.nix b/runtimes/raku.nix new file mode 100644 index 0000000..2f92b54 --- /dev/null +++ b/runtimes/raku.nix @@ -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"; + }) + ]; +} \ No newline at end of file