From 66af61c2cb73a7084535a66ce70074bd96eb5cd7 Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Sun, 6 Feb 2022 21:17:38 -0700 Subject: [PATCH] convert perl to nix --- packages/perl/5.26.1/build.sh | 19 ------------------- packages/perl/5.26.1/environment | 1 - packages/perl/5.26.1/metadata.json | 5 ----- packages/perl/5.26.1/run | 3 --- packages/perl/5.26.1/test.pl | 1 - runtimes/default.nix | 1 + runtimes/perl.nix | 29 +++++++++++++++++++++++++++++ 7 files changed, 30 insertions(+), 29 deletions(-) delete mode 100755 packages/perl/5.26.1/build.sh delete mode 100644 packages/perl/5.26.1/environment delete mode 100644 packages/perl/5.26.1/metadata.json delete mode 100644 packages/perl/5.26.1/run delete mode 100644 packages/perl/5.26.1/test.pl create mode 100644 runtimes/perl.nix diff --git a/packages/perl/5.26.1/build.sh b/packages/perl/5.26.1/build.sh deleted file mode 100755 index 1aed9eb..0000000 --- a/packages/perl/5.26.1/build.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -PREFIX=$(realpath $(dirname $0)) - -mkdir -p build - -cd build - -curl "https://www.cpan.org/src/5.0/perl-5.26.1.tar.gz" -o perl.tar.gz -tar xzf perl.tar.gz --strip-components=1 -./Configure -des -Dprefix="$PREFIX" - -make -j$(nproc) -make install -j$(nproc) - -cd .. - -rm -rf build - diff --git a/packages/perl/5.26.1/environment b/packages/perl/5.26.1/environment deleted file mode 100644 index bd0ff98..0000000 --- a/packages/perl/5.26.1/environment +++ /dev/null @@ -1 +0,0 @@ -export PATH=$PWD/bin:$PATH \ No newline at end of file diff --git a/packages/perl/5.26.1/metadata.json b/packages/perl/5.26.1/metadata.json deleted file mode 100644 index 67a6624..0000000 --- a/packages/perl/5.26.1/metadata.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "language": "perl", - "version": "5.26.1", - "aliases": ["perl", "pl"] -} diff --git a/packages/perl/5.26.1/run b/packages/perl/5.26.1/run deleted file mode 100644 index 3b8d77c..0000000 --- a/packages/perl/5.26.1/run +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -perl "$@" \ No newline at end of file diff --git a/packages/perl/5.26.1/test.pl b/packages/perl/5.26.1/test.pl deleted file mode 100644 index 3f2688f..0000000 --- a/packages/perl/5.26.1/test.pl +++ /dev/null @@ -1 +0,0 @@ -print("OK") \ No newline at end of file diff --git a/runtimes/default.nix b/runtimes/default.nix index 910bc8d..c9050d2 100644 --- a/runtimes/default.nix +++ b/runtimes/default.nix @@ -27,4 +27,5 @@ args: { "prolog" = import ./prolog.nix args; "ponylang" = import ./ponylang.nix args; "php" = import ./php.nix args; + "perl" = import ./perl.nix args; } diff --git a/runtimes/perl.nix b/runtimes/perl.nix new file mode 100644 index 0000000..0f463bb --- /dev/null +++ b/runtimes/perl.nix @@ -0,0 +1,29 @@ +{pkgs, piston, ...}: +let + pkg = pkgs.perl; +in piston.mkRuntime { + language = "perl"; + version = pkg.version; + + aliases = [ + "pl" + ]; + + run = '' + ${pkg}/bin/perl "$@" + ''; + + tests = [ + (piston.mkTest { + files = { + "test.pl" = '' + print("OK") + ''; + }; + args = []; + stdin = ""; + packages = []; + main = "test.pl"; + }) + ]; +} \ No newline at end of file