convert perl to nix

This commit is contained in:
Dan Vargas 2022-02-06 21:17:38 -07:00
parent 3530a79a57
commit 66af61c2cb
7 changed files with 30 additions and 29 deletions

View File

@ -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

View File

@ -1 +0,0 @@
export PATH=$PWD/bin:$PATH

View File

@ -1,5 +0,0 @@
{
"language": "perl",
"version": "5.26.1",
"aliases": ["perl", "pl"]
}

View File

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

View File

@ -1 +0,0 @@
print("OK")

View File

@ -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;
}

29
runtimes/perl.nix Normal file
View File

@ -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";
})
];
}