Added Pascal
This commit is contained in:
parent
45ee625338
commit
88f2b5bed4
|
@ -1,25 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
PREFIX=$(realpath $(dirname $0))
|
||||
|
||||
mkdir -p build
|
||||
|
||||
cd build
|
||||
curl -L "https://sourceforge.net/projects/freepascal/files/Linux/3.2.0/fpc-3.2.0-x86_64-linux.tar/download" -o pascal.tar
|
||||
tar xf pascal.tar --strip-components=1
|
||||
|
||||
# FreePascal uses an interactive installer
|
||||
./install.sh << ANSWERS
|
||||
$PREFIX
|
||||
n
|
||||
n
|
||||
n
|
||||
ANSWERS
|
||||
|
||||
cd ..
|
||||
rm -rf build
|
||||
|
||||
# A sample config (needed for each "project") is written to /etc
|
||||
# We'll copy that into the local lib dir (fpc searches there too on compile)
|
||||
mkdir lib/fpc/etc
|
||||
cp -r /etc/fp* lib/fpc/etc/
|
|
@ -1,5 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Compile pascal files
|
||||
fpc -oout -v0 "$@"
|
||||
chmod +x out
|
|
@ -1 +0,0 @@
|
|||
export PATH=$PWD/bin:$PATH
|
|
@ -1,5 +0,0 @@
|
|||
{
|
||||
"language": "pascal",
|
||||
"version": "3.2.0",
|
||||
"aliases": ["pascal", "freepascal", "pp", "pas"]
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
shift # Filename is only used to compile
|
||||
./out "$@"
|
|
@ -1,5 +0,0 @@
|
|||
program test;
|
||||
|
||||
begin
|
||||
writeln('OK');
|
||||
end.
|
|
@ -57,4 +57,5 @@ args: {
|
|||
"dotnet-sdk-fsharp" = import ./dotnet-sdk-fsharp.nix args;
|
||||
"dotnet-sdk-fsharp-interactive" = import ./dotnet-sdk-fsharp-interactive.nix args;
|
||||
"dotnet-sdk-visual-basic" = import ./dotnet-sdk-visual-basic.nix args;
|
||||
"fpc-pascal" = import ./fpc-pascal.nix args;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
{pkgs, piston, ...}:
|
||||
let
|
||||
binutilsPkg = pkgs.binutils;
|
||||
pkg = pkgs.fpc;
|
||||
in piston.mkRuntime {
|
||||
language = "pascal";
|
||||
version = pkg.version;
|
||||
|
||||
runtime = "fpc";
|
||||
|
||||
aliases = [
|
||||
"freepascal"
|
||||
"pp"
|
||||
"pas"
|
||||
];
|
||||
|
||||
compile = ''
|
||||
export PATH="${binutilsPkg}/bin:$PATH"
|
||||
${pkg}/bin/fpc -oout -v0 "$@"
|
||||
chmod +x out
|
||||
'';
|
||||
|
||||
run = ''
|
||||
shift
|
||||
./out "$@"
|
||||
'';
|
||||
|
||||
tests = [
|
||||
(piston.mkTest {
|
||||
files = {
|
||||
"test.pp" = ''
|
||||
program test;
|
||||
begin
|
||||
writeln(paramStr(1));
|
||||
end.
|
||||
'';
|
||||
};
|
||||
args = ["OK"];
|
||||
stdin = "";
|
||||
packages = [];
|
||||
main = "test.pp";
|
||||
})
|
||||
];
|
||||
}
|
Loading…
Reference in New Issue