move prolog to nix
This commit is contained in:
parent
b94e99ac09
commit
a8adca3e18
|
@ -1,22 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
PREFIX=$(realpath $(dirname $0))
|
||||
|
||||
mkdir -p build
|
||||
|
||||
cd build
|
||||
|
||||
# Source compile
|
||||
curl -L "https://www.swi-prolog.org/download/stable/src/swipl-8.2.4.tar.gz" -o swipl.tar.gz
|
||||
tar xzf swipl.tar.gz --strip-components=1
|
||||
rm swipl.tar.gz
|
||||
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DCMAKE_INSTALL_PREFIX="$PREFIX" -DSWIPL_PACKAGES_JAVA=OFF -DSWIPL_PACKAGES_X=OFF -DMULTI_THREADED=OFF -DINSTALL_DOCUMENTATION=OFF ..
|
||||
make -j$(nproc)
|
||||
make install -j$(nproc)
|
||||
|
||||
cd ../../
|
||||
|
||||
rm -rf build
|
|
@ -1 +0,0 @@
|
|||
export PATH=$PWD/bin:$PATH
|
|
@ -1,5 +0,0 @@
|
|||
{
|
||||
"language": "prolog",
|
||||
"version": "8.2.4",
|
||||
"aliases": ["prolog", "plg"]
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Put instructions to run the runtime
|
||||
swipl -g true -t halt "$@"
|
|
@ -1 +0,0 @@
|
|||
:- write('OK'), nl.
|
|
@ -24,4 +24,5 @@ args: {
|
|||
"raku" = import ./raku.nix args;
|
||||
"racket" = import ./racket.nix args;
|
||||
"powershell" = import ./powershell.nix args;
|
||||
"prolog" = import ./prolog.nix args;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
{pkgs, piston, ...}:
|
||||
let
|
||||
pkg = pkgs.swiProlog;
|
||||
in piston.mkRuntime {
|
||||
language = "prolog";
|
||||
version = pkg.version;
|
||||
|
||||
aliases = [
|
||||
"plg"
|
||||
];
|
||||
|
||||
run = ''
|
||||
${pkg}/bin/swipl -g true -t halt "$@"
|
||||
'';
|
||||
|
||||
tests = [
|
||||
(piston.mkTest {
|
||||
files = {
|
||||
"test.pl" = ''
|
||||
:- write('OK'), nl.
|
||||
'';
|
||||
};
|
||||
args = [];
|
||||
stdin = "";
|
||||
packages = [];
|
||||
main = "test.pl";
|
||||
})
|
||||
];
|
||||
}
|
Loading…
Reference in New Issue