Everything through MongoDB

This commit is contained in:
Radon Rosborough 2021-01-10 15:52:23 -08:00
parent ac39b15e16
commit 5895b5f3e4
55 changed files with 641 additions and 58 deletions

View File

@ -30,6 +30,7 @@ EOF
packages="
apt-file
docker-ce-cli
g++
git

View File

@ -2,15 +2,26 @@
set -euxo pipefail
mkdir /tmp/riju-work
pushd /tmp/riju-work
export DEBIAN_FRONTEND=noninteractive
dpkg --add-architecture i386
apt-get update
(yes || true) | unminimize
apt-get install -y curl gnupg lsb-release
apt-get install -y curl gnupg lsb-release wget
curl -sSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -
curl -sSL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
wget https://cacerts.digicert.com/DigiCertTLSRSASHA2562020CA1.crt.pem -O /usr/local/share/ca-certificates/DigiCertTLSRSASHA2562020CA1.crt
wget https://letsencrypt.org/certs/lets-encrypt-r3.pem -O /usr/local/share/ca-certificates/lets-encrypt-r3.crt
update-ca-certificates
curl -fsSL https://downloads.ceylon-lang.org/apt/ceylon-debian-repo.gpg.key | apt-key add -
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -
curl -fsSL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
ubuntu_ver="$(lsb_release -rs)"
ubuntu_name="$(lsb_release -cs)"
@ -18,26 +29,31 @@ ubuntu_name="$(lsb_release -cs)"
node_repo="$(curl -sS https://deb.nodesource.com/setup_current.x | grep NODEREPO= | grep -Eo 'node_[0-9]+\.x' | head -n1)"
tee -a /etc/apt/sources.list.d/custom.list >/dev/null <<EOF
deb https://deb.nodesource.com/${node_repo} ${ubuntu_name} main
deb https://dl.yarnpkg.com/debian/ stable main
deb [arch=amd64] https://downloads.ceylon-lang.org/apt/ unstable main
deb [arch=amd64] https://deb.nodesource.com/${node_repo} ${ubuntu_name} main
deb [arch=amd64] https://dl.yarnpkg.com/debian/ stable main
EOF
packages="
apt-file
dctrl-tools
fakeroot
git
jq
less
make
man
nodejs
perl
python3-pip
ripgrep
strace
sudo
tmux
tree
unzip
vim
wget
yarn
"
@ -47,8 +63,14 @@ apt-get install -y $(sed 's/#.*//' <<< "${packages}")
rm -rf /var/lib/apt/lists/*
PERL_MM_USE_DEFAULT=1 cpan App::cpanminus
rm -rf /tmp/cpan_install_*.txt
tee /etc/sudoers.d/90-riju >/dev/null <<"EOF"
%sudo ALL=(ALL:ALL) NOPASSWD: ALL
EOF
popd
rm -rf /tmp/riju-work
rm "$0"

View File

@ -15,7 +15,15 @@ dpkg --add-architecture i386
apt-get update
(yes || true) | unminimize
apt-get install -y curl gnupg lsb-release
apt-get install -y curl gnupg lsb-release wget
# Ceylon
wget https://cacerts.digicert.com/DigiCertTLSRSASHA2562020CA1.crt.pem -O /usr/local/share/ca-certificates/DigiCertTLSRSASHA2562020CA1.crt
# D
wget https://letsencrypt.org/certs/lets-encrypt-r3.pem -O /usr/local/share/ca-certificates/lets-encrypt-r3.crt
update-ca-certificates
# Ceylon
curl -fsSL https://downloads.ceylon-lang.org/apt/ceylon-debian-repo.gpg.key | apt-key add -
@ -29,6 +37,9 @@ curl -fsSL https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
# Hack
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B4112585D386EB94
# MongoDB
curl -fsSL https://www.mongodb.org/static/pgp/server-4.4.asc | apt-key add -
# Node.js
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -
@ -57,6 +68,9 @@ deb [arch=amd64] https://storage.googleapis.com/download.dartlang.org/linux/debi
# Hack
deb [arch=amd64] https://dl.hhvm.com/ubuntu ${ubuntu_name} main
# MongoDB
deb [arch=amd64] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse
# Node.js
deb [arch=amd64] https://deb.nodesource.com/${node_repo} ${ubuntu_name} main
@ -74,6 +88,7 @@ libicu="$(grep-aptavail -wF Package 'libicu[0-9]+' -s Package -n | head -n1)"
packages="
apt-file
less
clang
jq
@ -81,10 +96,10 @@ ${libicu}
make
man
nodejs
strace
sudo
tmux
vim
wget
yarn
"

View File

@ -28,7 +28,8 @@ install:
apt:
- libtinfo5
manual: |
wget "ftp://ftp.gnu.org/gnu/apl/$(curl -sS ftp://ftp.gnu.org/gnu/apl/ | grep -Eo 'apl_[-0-9.]+_amd64.deb$' | sort -rV | head -n1)" -O apl.deb
path="$(curl -sS ftp://ftp.gnu.org/gnu/apl/ | grep -Eo 'apl_[-0-9.]+_amd64.deb$' | sort -rV | head -n1)"
wget "ftp://ftp.gnu.org/gnu/apl/${path}" -O apl.deb
deb:
- apl.deb

View File

@ -21,7 +21,8 @@ info:
usage: []
install:
cpan: Acme::Chef
cpan:
- Acme::Chef
main: "main.chef"
template: |

View File

@ -26,6 +26,24 @@ info:
- functional
usage: []
install:
apt:
- gcc
manual: |
install -d "${pkg}/opt/clean"
install -d "${pkg}/usr/local/bin"
url="$(curl -fsSL https://clean.cs.ru.nl/Download_Clean | grep linux/clean | grep -F 64.tar.gz | grep -Eo "https://[^>]+\.tar\.gz")"
wget "${url}"
tar -xf clean*_64.tar.gz -C "${pkg}/opt/clean" --strip-components=1
pushd "${pkg}/opt/clean"
make
popd
ln -s /opt/clean/bin/clm "${pkg}/usr/local/bin/"
sleep 2
find "${pkg}/opt/clean" -name '*.o' -exec touch '{}' ';'
main: "main.icl"
template: |
module main

View File

@ -33,6 +33,12 @@ info:
install:
apt:
- clojure
manual: |
install -d "${pkg}/usr/local/bin"
ver="$(latest_release snoe/clojure-lsp)"
wget "https://github.com/snoe/clojure-lsp/releases/download/${ver}/clojure-lsp"
chmod +x clojure-lsp
mv clojure-lsp "${pkg}/usr/local/bin/"
repl: |
clojure

View File

@ -23,12 +23,21 @@ info:
usage: []
install:
prepare:
apt:
- wine
- wine32
apt:
- wine
- wine32
manual: |
install -d "${pkg}/opt/cmd/skel"
wine cmd < /dev/null
cp -R "$HOME/.wine" "${pkg}/opt/cmd/skel/"
chmod -R a=u,go-w "${pkg}/opt/cmd/skel"
setup: |
shopt -s dotglob; cp -R /opt/cmd/home-template/* ./
shopt -s dotglob; cp -R /opt/cmd/skel/* ./
repl: |
wine cmd

View File

@ -46,7 +46,7 @@ compile: |
run: |
node -e '
eval.apply(this, [require("fs").readFileSync("main.js", {encoding: "utf-8"})])
require("/usr/lib/node_modules/coffeescript/repl").start()
require("/opt/coffeescript/lib/node_modules/coffeescript/repl").start()
'
scope:

View File

@ -9,7 +9,7 @@ install:
- pakcs
repl: |
pakcs
SWIPL=swipl pakcs
main: "main.curry"
template: |
@ -17,7 +17,7 @@ template: |
main = putStrLn "Hello, world!"
run: |
pakcs :load main.curry :eval main
SWIPL=swipl pakcs :load main.curry :eval main
scope:
code: |

View File

@ -3,6 +3,20 @@ aliases:
- "dmd"
name: "D"
install:
prepare:
manual: |
file="$(curl -fsSL https://dlang.org/download.html | grep -Eo '"http://[^"]+amd64.deb"' | grep -v pre-release | tr -d '"')"
wget "${file}" -O dmd.deb
sudo apt-get install -y ./dmd.deb
manual: |
install -d "${pkg}/usr/local/bin"
dub fetch dfmt@~master
dub run dfmt -- --version
cp "$HOME/.dub/packages/dfmt-master/dfmt/bin/dfmt" "${pkg}/usr/local/bin/"
deb:
- dmd.deb
main: "main.d"
template: |
import std.stdio;

View File

@ -4,6 +4,14 @@ name: "Dhall"
install:
apt:
- dhall
manual: |
install -d "${pkg}/usr/local/bin"
ver="$(latest_release dhall-lang/dhall-haskell)"
file="$(curl -sSL "https://api.github.com/repos/dhall-lang/dhall-haskell/releases/tags/${ver}" | jq -r '.assets | map(select(.name | (contains("dhall-json") and contains("x86_64-linux.tar.bz2")))) | .[0].name')"
wget "https://github.com/dhall-lang/dhall-haskell/releases/download/${ver}/${file}"
mkdir dhall-json
tar -xf dhall-json-*-x86_64-linux.tar.bz2 -C dhall-json
cp dhall-json/bin/dhall-to-json dhall-json/bin/json-to-dhall "${pkg}/usr/local/bin/"
main: "main.dhall"
template: |

View File

@ -6,9 +6,39 @@ name: "Dylan"
install:
apt:
- libunwind-dev
manual: |
install -d "${pkg}/opt/dylan"
install -d "${pkg}/usr/local/bin"
ver="$(latest_release dylan-lang/opendylan)"
wget "https://github.com/dylan-lang/opendylan/releases/download/${ver}/opendylan-$(grep -Eo '[0-9]+\.[0-9]+' <<< "$ver")-x86_64-linux.tar.bz2" -O opendylan.tar.bz2
tar -xf opendylan.tar.bz2 -C "${pkg}/opt/dylan" --strip-components=1
ln -s /opt/dylan/bin/dylan-compiler /opt/dylan/bin/make-dylan-app "${pkg}/usr/local/bin/"
export PATH="${pkg}/opt/dylan/bin:$PATH"
pushd "${pkg}/opt/dylan"
make-dylan-app main
mv main skel
pushd skel
cat <<"EOF" > main.dylan
Module: main
define function main
(name :: <string>, arguments :: <vector>)
format-out("Hello, world!\n");
exit-application(0);
end function main;
main(application-name(), application-arguments());
EOF
dylan-compiler -build main.lid
rm main.dylan
popd
popd
setup: |
cp -R /opt/dylan/project-template/* ./
cp -R /opt/dylan/skel/* ./
main: "main.dylan"
template: |

View File

@ -7,8 +7,12 @@ aliases:
name: "eC"
install:
apt:
- ecere-dev
manual: |
ver="$(latest_release ecere/ecere-sdk)"
git clone https://github.com/ecere/ecere-sdk.git -b "${ver}"
pushd ecere-sdk
make
popd
main: "main.ec"
template: |

View File

@ -7,6 +7,15 @@ name: "Elixir"
install:
apt:
- elixir
- erlang-edoc
manual: |
install -d "${pkg}/opt/elixir-ls"
install -d "${pkg}/usr/local/bin"
ver="$(latest_release elixir-lsp/elixir-ls)"
wget "https://github.com/elixir-lsp/elixir-ls/releases/download/${ver}/elixir-ls.zip"
unzip -d "${pkg}/opt/elixir-ls" elixir-ls.zip
ln -s /opt/elixir-ls/language_server.sh "${pkg}/usr/local/bin/elixir-ls"
repl: |
iex

View File

@ -5,6 +5,21 @@ install:
npm:
- "@kachkaev/run-elm"
- "@elm-tooling/elm-language-server"
manual: |
install -d "${pkg}/opt/elm"
install -d "${pkg}/usr/local/bin"
ver="$(latest_release elm/compiler)"
wget "https://github.com/elm/compiler/releases/download/${ver}/binary-for-linux-64-bit.gz"
gunzip binary-for-linux-64-bit.gz
chmod +x binary-for-linux-64-bit
cp binary-for-linux-64-bit "${pkg}/usr/local/bin/elm"
mkdir elm-project
pushd elm-project
(yes || true) | "${pkg}/usr/local/bin/elm" init
cat elm.json | jq '."source-directories" = ["."]' > "${pkg}/opt/elm/elm".json
popd
repl: |
elm repl

View File

@ -5,6 +5,23 @@ aliases:
- "emojicodec"
name: "Emojicode"
install:
apt:
- libtinfo5
manual: |
install -d "${pkg}/usr/local/bin"
install -d "${pkg}/usr/local/include/emojicode"
install -d "${pkg}/usr/local/EmojicodePackages"
ver="$(latest_release emojicode/emojicode)"
wget "https://github.com/emojicode/emojicode/releases/download/${ver}/Emojicode-$(sed 's/^v//' <<< "$ver")-Linux-x86_64.tar.gz"
tar -xf Emojicode-*-Linux-x86_64.tar.gz
pushd Emojicode-*-Linux-x86_64
cp emojicodec "${pkg}/usr/local/bin/"
cp -R include/* "${pkg}/usr/local/include/emojicode/"
cp -R packages/* "${pkg}/usr/local/EmojicodePackages/"
popd
main: "main.emojic"
template: |
🏁 🍇

View File

@ -5,6 +5,15 @@ aliases:
- "vge"
name: "Entropy"
install:
apt:
- mono-runtime
manual: |
install -d "${pkg}/opt/entropy"
wget http://danieltemkin.com/Content/Entropy/Entropy.zip
unzip -d "${pkg}/opt/entropy" Entropy.zip
main: "main.vge"
template: |
Program MyNamespace MyProgram [

View File

@ -4,10 +4,25 @@ aliases:
name: "Erlang"
install:
prepare:
apt:
- erlang-nox
- erlang-dev
apt:
- erlang
- erlang-nox
- libodbc1 # workaround bug in APT
- rebar
manual: |
install -d "${pkg}/usr/local/bin"
wget https://s3.amazonaws.com/rebar3/rebar3
chmod +x rebar3
export PATH="$PWD:$PATH"
git clone https://github.com/erlang-ls/erlang_ls.git
pushd erlang_ls
make
cp _build/default/bin/erlang_ls "${pkg}/usr/local/bin/erlang_ls"
popd
repl: |
erl

View File

@ -8,6 +8,15 @@ aliases:
- "eub"
name: "Euphoria"
install:
manual: |
install -d "${pkg}/opt/euphoria"
install -d "${pkg}/usr/local/bin"
wget http://www.rapideuphoria.com/31/euphor31.tar
tar -xf euphor*.tar -C "${pkg}/opt/euphoria" --strip-components=1
ln -s /opt/euphoria/bin/exu "${pkg}/usr/local/bin/"
main: "main.exu"
template: |
puts(1, "Hello, world!\n")

View File

@ -3,6 +3,16 @@ aliases:
- "fact"
name: "Factor"
install:
manual: |
install -d "${pkg}/opt/factor"
install -d "${pkg}/usr/local/bin"
ver="$(curl -sSL https://factorcode.org/ | grep -Eo 'release\?os=linux[^>]+>[^<]+' | sed -E 's/[^>]+>//' | head -n1)"
wget "https://downloads.factorcode.org/releases/${ver}/factor-linux-x86-64-${ver}.tar.gz" -O factor.tar.gz
tar -xf factor.tar.gz -C "${pkg}/opt/factor" --strip-components=1
ln -sT /opt/factor/factor "${pkg}/usr/local/bin/factor-lang"
repl: |
factor-lang
input: |

View File

@ -3,6 +3,16 @@ aliases:
- "falselang"
name: "FALSE"
install:
apt:
- ruby
manual: |
install -d "${pkg}/usr/local/bin"
wget https://github.com/mame/quine-relay/raw/master/vendor/false.rb
cat <(echo '#!/usr/bin/env ruby') false.rb > "${pkg}/usr/local/bin/false-lang"
chmod +x "${pkg}/usr/local/bin/false-lang"
main: "main.false"
template: |
"Hello, world!"

View File

@ -11,18 +11,18 @@ name: "FORTRAN"
install:
apt:
- flang
- gfortran
pip:
- fortran-language-server
main: "main.f"
main: "main.f95"
template: |2
program hello
print *, "Hello, world!"
end program hello
PROGRAM hello
PRINT *, "Hello, world!"
END PROGRAM hello
compile: |
flang main.f -o main
gfortran main.f95 -o main
run: |
./main

View File

@ -3,7 +3,7 @@ name: "Gnuplot"
install:
apt:
- gnuplot
- gnuplot-nox
repl: |
gnuplot

View File

@ -5,8 +5,18 @@ name: "Go"
monacoLang: go
install:
prepare:
apt:
- golang
apt:
- golang
manual: |
install -d "${pkg}/usr/local/bin"
export GO111MODULE=on
export GOPATH="$PWD/go"
go get golang.org/x/tools/gopls@latest
cp go/bin/gopls "${pkg}/usr/local/bin/"
main: "main.go"
template: |

View File

@ -3,6 +3,16 @@ aliases:
- "golf"
name: "GolfScript"
install:
apt:
- ruby
manual: |
install -d "${pkg}/usr/local/bin"
wget http://www.golfscript.com/golfscript/golfscript.rb
chmod +x golfscript.rb
cp -T golfscript.rb "${pkg}/usr/local/bin/golfscript"
main: "main.gs"
template: |
'Hello, world!'

View File

@ -1,6 +1,16 @@
id: "grass"
name: "Grass"
install:
apt:
- ruby
manual: |
install -d "${pkg}/usr/local/bin"
wget http://www.blue.sky.or.jp/grass/grass.rb
chmod +x grass.rb
cp -T grass.rb "${pkg}/usr/local/bin/grass"
main: "main.grass"
template: |
wWWwwww

View File

@ -9,8 +9,30 @@ install:
prepare:
apt:
- cabal-install
manual: |
cabal update
apt:
- ghc
manual: |
install -d "${pkg}/usr/local/bin"
install -d "${pkg}/opt/brittany"
cabal install brittany --installdir "$PWD"
cp -L brittany "${pkg}/usr/local/bin/"
mkdir haskell-language-server
pushd haskell-language-server
ver="$(latest_release haskell/haskell-language-server)"
release="$(curl -fsSL "https://api.github.com/repos/haskell/haskell-language-server/releases/tags/${ver}")"
echo "${release}" | jq '.assets[].name' -r | grep Linux | grep -vF .tar | while read asset; do
wget "https://github.com/haskell/haskell-language-server/releases/download/${ver}/${asset}"
gunzip "${asset}"
done
chmod +x *
for binary in *; do
cp -T "${binary}" "${pkg}/usr/local/bin/${binary//-Linux/}"
done
popd
repl: |
rm -f .ghci && ghci
@ -40,10 +62,8 @@ format:
putStrLn "Hello, world!"
lsp:
setup: |
cp /opt/haskell/hie.yaml hie.yaml
start: |
HIE_HOOGLE_DATABASE=/opt/haskell/hoogle.hoo hie --lsp
haskell-language-server-wrapper --lsp
init:
languageServerHaskell: {}

View File

@ -6,6 +6,7 @@ name: "Haxe"
install:
apt:
- haxe
- nodejs
main: "Main.hx"
template: |

View File

@ -6,6 +6,10 @@ aliases:
- "hc"
name: "HCL"
install:
riju:
- yj
main: "main.hcl"
template: |
output = "Hello, world!"

View File

@ -4,6 +4,14 @@ aliases:
- "hex"
name: "Hexagony"
install:
manual: |
install -d "${pkg}/usr/local/bin"
install -d "${pkg}/opt"
git clone https://github.com/m-ender/hexagony.git "${pkg}/opt/hexagony"
ln -sT /opt/hexagony/interpreter.rb "${pkg}/usr/local/bin/hexagony"
main: "main.hxg"
template: |2
H ; e ;
@ -15,4 +23,4 @@ template: |2
4 ; * /
run: |
/opt/hexagony/interpreter.rb main.hxg
hexagony main.hxg

View File

@ -1,6 +1,14 @@
id: "hmmm"
name: "HMMM"
install:
manual: |
install -d "${pkg}/usr/local/bin"
wget https://www.cs.hmc.edu/~cs5grad/cs5/hmmm/code/hmmm
chmod +x hmmm
cp hmmm "${pkg}/usr/local/bin/"
main: "main.hmmm"
template: |2
0 setn r1, 72

View File

@ -9,6 +9,17 @@ install:
apt:
- chezscheme
- gcc
apt:
- chezscheme
manual: |
wget https://www.idris-lang.org/idris2-src/idris2-latest.tgz
mkdir idris
tar -xf idris2-latest.tgz -C idris --strip-components=1
pushd idris
make bootstrap-build SCHEME=chezscheme PREFIX="${pkg}/usr/local"
make install PREFIX="${pkg}/usr/local"
chmod -R a=u,go-w "${pkg}/usr/local"/idris2-*
popd
repl: |
rm -f .idris/repl/init; idris2

View File

@ -1,6 +1,19 @@
id: "ink"
name: "Ink"
install:
manual: |
install -d "${pkg}/opt/ink"
install -d "${pkg}/usr/local/bin"
ver="$(latest_release thesephist/ink)"
wget "https://github.com/thesephist/ink/releases/download/${ver}/ink-linux"
wget "https://github.com/thesephist/ink/releases/download/${ver}/std.ink"
wget "https://github.com/thesephist/ink/releases/download/${ver}/str.ink"
chmod +x ink-linux
cp -T ink-linux "${pkg}/usr/local/bin/ink"
cp std.ink str.ink "${pkg}/opt/ink/"
repl: |
ink

View File

@ -3,6 +3,17 @@ aliases:
- "ik"
name: "Ioke"
install:
apt:
- default-jdk
manual: |
install -d "${pkg}/opt/ioke"
install -d "${pkg}/usr/local/bin"
wget https://ioke.org/dist/ioke-ikj-latest.tar.gz -O ioke.tar.gz
tar -xf ioke.tar.gz -C "${pkg}/opt/ioke" --strip-components=1
ln -s /opt/ioke/bin/ioke "${pkg}/usr/local/bin/ioke"
repl: |
JAVA_OPTS="-Duser.home=$PWD" ioke

View File

@ -4,6 +4,12 @@ aliases:
- "ijconsole"
name: "J"
install:
manual: |
wget "$(curl -sSL https://code.jsoftware.com/wiki/System/Installation/J901/Debian | grep -F '<a' | grep 'amd64\.deb' | grep -Eo 'http://.+?\.deb')" -O j.deb
deb:
- j.deb
repl: |
echo 'ijconsole:' && ijconsole

View File

@ -8,6 +8,11 @@ install:
apt:
- default-jdk
- clang-format
manual: |
install -d "${pkg}/opt/jdt"
wget https://download.eclipse.org/jdtls/snapshots/jdt-language-server-latest.tar.gz
tar -xf jdt-language-server-latest.tar.gz -C "${pkg}/opt/jdt"
main: "Main.java"
template: |

View File

@ -1,6 +1,10 @@
id: "jsf"
name: "JSF***"
install:
apt:
- nodejs
main: "main.js"
template: |
[][(![]+[])[+[]]+(![]+[])[!![]+!![]]+(![]+[])[+!![]]+(!![]+[])[+[]]][([]+[][(![]

View File

@ -4,8 +4,16 @@ aliases:
name: "Julia"
install:
prepare:
apt:
- julia
apt:
- julia
manual: |
install -d "${pkg}/opt/julia-language-server"
export JULIA_DEPOT_PATH="${pkg}/opt/julia-language-server"
julia -e 'using Pkg; Pkg.add("LanguageServer")'
repl: |
julia
@ -23,7 +31,7 @@ scope:
lsp:
start: |
JULIA_DEPOT_PATH=:/opt/julia julia -e 'using LanguageServer; run(LanguageServerInstance(stdin, stdout))'
JULIA_DEPOT_PATH=:/opt/julia-language-server julia -e 'using LanguageServer; run(LanguageServerInstance(stdin, stdout))'
config: null
skip:

View File

@ -1,6 +1,21 @@
id: "kalyn"
name: "Kalyn"
install:
prepare:
apt:
- haskell-stack
manual: |
install -d "${pkg}/opt/kalyn"
install -d "${pkg}/usr/local/bin"
git clone https://github.com/raxod502/kalyn.git
pushd kalyn
stack build kalyn
cp "$(stack exec which kalyn)" "${pkg}/usr/local/bin/"
cp -R src-kalyn/Stdlib src-kalyn/Stdlib.kalyn "${pkg}/opt/kalyn/"
popd
main: "src-kalyn/Main.kalyn"
template: |
(import "/opt/kalyn/Stdlib.kalyn")

View File

@ -3,6 +3,22 @@ aliases:
- "ktn"
name: "Kitten"
install:
prepare:
apt:
- haskell-stack
manual: |
install -d "${pkg}/opt/kitten"
install -d "${pkg}/usr/local/bin"
git clone https://github.com/evincarofautumn/kitten.git
pushd kitten
stack setup
stack build
cp "$(stack exec which kitten)" "${pkg}/usr/local/bin/"
cp common.ktn "${pkg}/opt/kitten/"
popd
repl: |
kitten
input: |

View File

@ -5,6 +5,25 @@ aliases:
name: "Kotlin"
monacoLang: kotlin
install:
manual: |
install -d "${pkg}/opt"
install -d "${pkg}/usr/local/bin"
install -d "${pkg}/usr/local/lib"
ver="$(latest_release JetBrains/kotlin)"
wget "https://github.com/JetBrains/kotlin/releases/download/${ver}/kotlin-compiler-$(sed 's/^v//' <<< "$ver").zip" -O kotlin.zip
unzip kotlin.zip
cp -RT kotlinc "${pkg}/opt/kotlin"
ls "${pkg}/opt/kotlin/bin" | while read name; do
ln -s "/opt/kotlin/bin/${name}" "${pkg}/usr/local/bin/"
done
ls "${pkg}/opt/kotlin/lib" | while read name; do
ln -s "/opt/kotlin/lib/${name}" "${pkg}/usr/local/lib/"
done
repl: |
JAVA_OPTS="-Duser.home=$PWD" kotlinc

View File

@ -1,6 +1,19 @@
id: "lazyk"
name: "Lazy K"
install:
prepare:
apt:
- gcc
manual: |
install -d "${pkg}/usr/local/bin"
git clone https://github.com/irori/lazyk.git
pushd lazyk
make
mv lazyk "${pkg}/usr/local/bin/"
popd
main: "main.lazy"
template: |
K(S(S(S(S(S(S(SI`S`K(S(S`KS(S`KK(S`KS(S(S`KS(S`K`S(SI`KK)(S`KKK)))`K`K(SI`K0))))

View File

@ -7,14 +7,27 @@ name: "Limbo"
install:
prepare:
apt:
- gcc
- libc6-dev:i386
- gcc-multilib
- libc6-dev-i386
- libx11-dev:i386
- libxext-dev:i386
- linux-libc-dev:i386
manual: |
install -d "${pkg}/opt/inferno"
install -d "${pkg}/usr/local/bin"
wget "$(curl -sSL http://www.vitanuova.com/inferno/downloads.html | grep -E 'inferno-[0-9]+\.tgz' | grep -Eo 'http://[^"]+')" -O inferno.tgz
tar -xf inferno.tgz -C "${pkg}/opt/inferno" --strip-components=1
chmod -R u+w,a=u,go-w "${pkg}/opt/inferno"
pushd "${pkg}/opt/inferno"
sed -i 's/gcc/gcc -m32/g' makemk.sh
sed -i "s#ROOT=.*#ROOT=${PWD}#" mkconfig
./makemk.sh
PATH="$PWD/Linux/386/bin:$PATH" mk install
ln -s "/opt/inferno/Linux/386/bin/emu" "/opt/inferno/Linux/386/bin/limbo" "${pkg}/usr/local/bin/"
popd
setup: |
ln -s /usr/local/inferno/* ./
ln -s /opt/inferno/* ./
main: "riju/main.b"
template: |

View File

@ -8,6 +8,12 @@ install:
prepare:
apt:
- cmake
- python3
manual: |
git clone https://github.com/justinmeza/lci.git
pushd lci
python3 install.py --prefix="${pkg}/usr/local"
popd
main: "main.lol"
template: |

View File

@ -5,6 +5,12 @@ monacoLang: lua
install:
apt:
- $(grep-aptavail -XF Provides lua -a -XF Version "$(grep-aptavail -XF Provides lua -s Version -n | sort -Vr | head -n1)" -s Package -n | head -n1)
manual: |
install -d "${pkg}/opt/emmylua"
ver="$(latest_release EmmyLua/EmmyLua-LanguageServer)"
wget "https://github.com/EmmyLua/EmmyLua-LanguageServer/releases/download/${ver}/EmmyLua-LS-all.jar"
cp EmmyLua-LS-all.jar "${pkg}/opt/emmylua/EmmyLua.jar"
repl: |
lua
@ -22,7 +28,7 @@ scope:
lsp:
start: |
java -cp /usr/lib/EmmyLua-LS.jar com.tang.vscode.MainKt
java -cp /opt/emmylua/EmmyLua.jar com.tang.vscode.MainKt
skip:
- lsp

View File

@ -8,6 +8,10 @@ aliases:
- "bsdmake"
name: "Make"
install:
apt:
- make
main: "Makefile"
template: |
.PHONY: all

View File

@ -3,6 +3,16 @@ aliases:
- "mb"
name: "Malbolge"
install:
prepare:
apt:
- clang
manual: |
install -d "${pkg}/usr/local/bin"
git clone https://github.com/bipinu/malbolge.git
clang malbolge/malbolge.c -o "${pkg}/usr/local/bin/malbolge"
main: "main.mb"
template: |2
(=<`#9]~6ZY32Vx/4Rs+0No-&Jk)"Fh}|Bcy?`=*z]Kw%oG4UUS0/@-ejc(:'8dc

View File

@ -5,10 +5,27 @@ name: "MariaDB"
install:
apt:
- libaio1
- libtinfo5
- mysql-client
riju:
- sqls
files:
"/opt/mariadb/sqls.yml": |
connections:
- driver: mysql
dataSourceName: socket/mysql
manual: |
install -d "${pkg}/opt/mariadb"
ver="$(curl -sSL https://downloads.mariadb.org/ | grep 'href="/mariadb/[0-9]' | grep -Eo '[0-9][^/]+' | sort -rV | head -n1)"
wget "https://downloads.mariadb.org/f/mariadb-${ver}/bintar-linux-x86_64/mariadb-${ver}-linux-x86_64.tar.gz/from/http%3A//sfo1.mirrors.digitalocean.com/mariadb/?serve" -O mariadb.tar.gz
tar -xf mariadb.tar.gz -C "${pkg}/opt/mariadb" --strip-components=1
chmod a=rx,u=rwx "${pkg}/opt/mariadb/lib/plugin/auth_pam_tool_dir"
chmod a=rx,u=rwxs "${pkg}/opt/mariadb/lib/plugin/auth_pam_tool_dir/auth_pam_tool"
repl: |
rm -rf data && /opt/mariadb/scripts/mariadb-install-db --user="$(id -un)" && (/opt/mariadb/bin/mysqld --datadir="$PWD/data" --socket="$PWD/socket" --skip-networking &) && until [[ -e socket ]]; do sleep 0.01; done && mysql --socket="$PWD/socket"
rm -rf data && /opt/mariadb/scripts/mariadb-install-db --user="$(id -un)" && (/opt/mariadb/bin/mysqld --datadir="$PWD/data" --socket="$PWD/socket" --skip-networking &) && until [[ -e socket ]]; do sleep 0.01; done && mysql --socket=socket
input: |
SELECT 123 * 234;
@ -17,11 +34,11 @@ template: |
SELECT 'Hello, world!';
run: |
rm -rf data && /opt/mariadb/scripts/mariadb-install-db --user="$(id -un)" && (/opt/mariadb/bin/mysqld --datadir="$PWD/data" --socket="$PWD/socket" --skip-networking &) && until [[ -e socket ]]; do sleep 0.01; done && (mysql --socket="$PWD/socket" < main.sql; mysql --socket="$PWD/socket")
rm -rf data && /opt/mariadb/scripts/mariadb-install-db --user="$(id -un)" && (/opt/mariadb/bin/mysqld --datadir="$PWD/data" --socket="$PWD/socket" --skip-networking &) && until [[ -e socket ]]; do sleep 0.01; done && (mysql --socket=socket < main.sql; mysql --socket=socket)
lsp:
start: |
sqls
sleep 5 && sqls -config /opt/mariadb/sqls.yml
skip:
- lsp

View File

@ -5,8 +5,27 @@ aliases:
name: "MongoDB"
install:
apt:
- mongodb
prepare:
manual: |
sudo tee -a /etc/apt/sources.list.d/focal.list >/dev/null <<EOF
deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ focal main universe
EOF
sudo apt-get update
for name in mongodb mongodb-clients mongodb-server mongodb-server-core; do
apt-get download "${name}"
mv "${name}"_*.deb "${name}.deb"
done
deb:
- mongodb.deb
- mongodb-clients.deb
- mongodb-server.deb
- mongodb-server-core.deb
stripDepends:
- mongodb-clients
- mongodb-server
- mongodb-server-core
repl: |
while ps -u "$(id -un)" -o comm | grep -q mongod; do sleep 0.01; done && rm -rf data && mkdir data && (mongod --dbpath=data --unixSocketPrefix="$PWD" --bind_ip=, &) && until mongo --host "$PWD/mongodb-27017.sock" --eval ' ' &>/dev/null; do sleep 0.01; done && mongo --host "$PWD/mongodb-27017.sock"

View File

@ -44,7 +44,9 @@ install:
manual: |
install -d "${pkg}/opt/mspyls"
install -d "${pkg}/usr/local/bin"
wget "$(curl -fsSL "https://pvsc.blob.core.windows.net/python-language-server-stable?restype=container&comp=list&prefix=Python-Language-Server-linux-x64" | grep -Eo 'https://[^<]+\.nupkg' | tail -n1)"
url="$(curl -fsSL "https://pvsc.blob.core.windows.net/python-language-server-stable?restype=container&comp=list&prefix=Python-Language-Server-linux-x64" | grep -Eo 'https://[^<]+\.nupkg' | tail -n1)"
wget "${url}"
unzip -d "${pkg}/opt/mspyls" Python-Language-Server-linux-x64.*.nupkg
chmod +x "${pkg}/opt/mspyls/Microsoft.Python.LanguageServer"
ln -s "/opt/mspyls/Microsoft.Python.LanguageServer" "${pkg}/usr/local/bin/Microsoft.Python.LanguageServer"

9
shared/sqls.yaml Normal file
View File

@ -0,0 +1,9 @@
id: "sqls"
install:
manual: |
install -d "${pkg}/usr/local/bin"
ver="$(latest_release lighttiger2505/sqls | sed 's/^v//')"
wget "https://github.com/lighttiger2505/sqls/releases/download/v${ver}/sqls_${ver}_Linux_x86_64.tar.gz" -O sqls.tar.gz
tar -xf sqls.tar.gz -C "${pkg}/usr/local/bin"

10
shared/yj.yaml Normal file
View File

@ -0,0 +1,10 @@
id: "yj"
install:
manual: |
install -d "${pkg}/usr/local/bin"
ver="$(latest_release sclevine/yj)"
wget "https://github.com/sclevine/yj/releases/download/${ver}/yj-linux"
chmod +x yj-linux
cp yj-linux "${pkg}/usr/local/bin/yj"

View File

@ -61,11 +61,11 @@ export async function getPackages() {
// Correct whitespace problems in a language configuration,
// destructively. Return the fixed configuration.
//
// This basically removes leading and trailing whitespace from all
// values in the configuration recursively.
// This basically removes trailing whitespace from all values in the
// configuration recursively.
function fixupLangConfig(langConfig) {
if (typeof langConfig === "string") {
return langConfig.trim();
return langConfig.trimRight();
} else if (typeof langConfig === "object") {
for (const key in langConfig) {
if (langConfig.id === "whitespace" && key === "template") {

View File

@ -18,19 +18,36 @@ import { readLangConfig, readSharedDepConfig } from "./config.js";
function makeLangScript(langConfig, isShared) {
const { id, name, install } = langConfig;
let parts = [];
parts.push(`\
#!/usr/bin/env bash
set -euxo pipefail`);
let depends = [];
if (
install &&
((install.prepare &&
((install.prepare.manual && install.prepare.manual.includes("apt-get")) ||
(install.prepare.apt && install.prepare.apt.length > 0))) ||
(install.apt &&
install.apt.filter((pkg) => pkg.includes("$")).length > 0))
) {
parts.push(`\
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update`);
}
if (install) {
const { prepare, apt, riju, npm, pip, deb, scripts, manual } = install;
const {
prepare,
apt,
riju,
npm,
pip,
cpan,
files,
scripts,
manual,
deb,
} = install;
if (prepare) {
const { apt, manual } = prepare;
if (apt && apt.length > 0) {
parts.push(`\
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update
sudo apt-get install -y ${apt.join(" ")}`);
}
if (manual) {
@ -51,6 +68,7 @@ sudo apt-get install -y ${apt.join(" ")}`);
install -d "\${pkg}/usr/local/bin"
install -d "\${pkg}/opt/${basename}/lib"
npm install ${arg} -g --prefix "\${pkg}/opt/${basename}"
if [[ -d "$\{pkg}/opt/${basename}/bin" ]]; then
ls "$\{pkg}/opt/${basename}/bin" | while read name; do
if readlink "\${pkg}/opt/${basename}/bin/\${name}" | grep -q '/${fullname}/'; then
@ -65,6 +83,7 @@ fi`);
parts.push(`\
install -d "\${pkg}/usr/local/bin"
pip3 install "${basename}" --prefix "\${pkg}/opt/${basename}"
if [[ -d "\${pkg}/opt/${basename}/bin" ]]; then
ls "\${pkg}/opt/${basename}/bin" | while read name; do
version="$(ls "\${pkg}/opt/${basename}/lib" | head -n1)"
@ -86,15 +105,47 @@ if [[ -d "\${pkg}/opt/${basename}/man" ]]; then
fi`);
}
}
if (deb) {
parts.push(
deb.map((deb) => `dpkg-deb --extract "${deb}" "\${pkg}"`).join("\n")
);
if (cpan) {
for (const fullname of cpan) {
const basename = fullname.replace(/^.+:/, "").toLowerCase();
parts.push(`\
install -d "\${pkg}/usr/local/bin"
cpanm -l "\${pkg}/opt/${basename}" -n "${fullname}"
if [[ -d "\${pkg}/opt/${basename}/bin" ]]; then
ls "\${pkg}/opt/${basename}/bin" | while read name; do
version="$(ls "\${pkg}/opt/${basename}/lib" | head -n1)"
cat <<EOF > "\${pkg}/usr/local/bin/\${name}"
#!/usr/bin/env bash
exec env PERL5LIB="/opt/${basename}/lib/\${version}" "/opt/${basename}/bin/\${name}" "\\\$@"
EOF
chmod +x "\${pkg}/usr/local/bin/\${name}"
done
fi
if [[ -d "\${pkg}/opt/${basename}/man" ]]; then
ls "\${pkg}/opt/${basename}/man" | while read dir; do
install -d "\${pkg}/usr/local/man/\${dir}"
ls "\${pkg}/opt/${basename}/man/\${dir}" | while read name; do
ln -s "/opt/${basename}/man/\${dir}/\${name}" "\${pkg}/usr/local/man/\${dir}/\${name}"
done
done
fi`);
}
}
if (files) {
for (const [file, contents] of Object.entries(files)) {
const path = "${pkg}" + file;
parts.push(`install -d "${nodePath.dirname(path)}"
cat <<"RIJU-EOF" > "${path}"
${contents}
RIJU-EOF`);
}
}
if (scripts) {
for (const [script, contents] of Object.entries(scripts)) {
const path = "${pkg}" + nodePath.resolve("/usr/local/bin", script);
parts.push(`install -d "\${pkg}/usr/local/bin"
parts.push(`install -d "${nodePath.dirname(path)}"
cat <<"RIJU-EOF" > "${path}"
${contents}
RIJU-EOF
@ -104,6 +155,11 @@ chmod +x "${path}"`);
if (manual) {
parts.push(manual);
}
if (deb) {
parts.push(
deb.map((deb) => `dpkg-deb --extract "${deb}" "\${pkg}"`).join("\n")
);
}
if (apt) {
depends = depends.concat(apt);
}
@ -117,6 +173,12 @@ chmod +x "${path}"`);
}
}
parts.push(`depends=(${depends.map((dep) => `"${dep}"`).join(" ")})`);
let stripDependsFilter = "";
if (install && install.stripDepends && install.stripDepends.length > 0) {
stripDependsFilter = ` | sed -E 's/(^| )(${install.stripDepends.join(
"|"
)}) *(\\([^)]*\\))? *(,|$)/\\1/g' | sed -E 's/^ *//g'`;
}
let debianControlData = `\
Package: riju-${isShared ? "shared" : "lang"}-${id}
Version: \$(date +%s%3N)
@ -125,13 +187,23 @@ Maintainer: Radon Rosborough <radon.neon@gmail.com>
Description: The ${name} ${
isShared ? "shared dependency" : "language"
} packaged for Riju
Depends: \$(IFS=,; echo "\${depends[*]}")
Depends: \$(IFS=,; echo "\${depends[*]}" | sed -E 's/,([^ ])/, \\1/g'${stripDependsFilter} | sed -E 's/ +/ /g')
Riju-Script-Hash: \$(sha1sum "\$0" | awk '{ print \$1 }')`;
parts.push(`\
install -d "\${pkg}/DEBIAN"
cat <<EOF > "\${pkg}/DEBIAN/control"
${debianControlData}
EOF`);
if (parts.join("\n\n").includes("latest_release")) {
parts.unshift(`\
latest_release() {
curl -sSL "https://api.github.com/repos/\$1/releases/latest" | jq -r .tag_name
}`);
}
parts.unshift(`\
#!/usr/bin/env bash
set -euxo pipefail`);
return parts.join("\n\n");
}