riju/langs/dylan.yaml

59 lines
1.4 KiB
YAML

id: "dylan"
aliases:
- "opendylan"
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/skel/* ./
main: "main.dylan"
template: |
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());
compile: |
dylan-compiler -build main.lid && echo
run: |
_build/bin/main