38 lines
907 B
YAML
38 lines
907 B
YAML
id: "kitten"
|
|
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
|
|
|
|
pat="$(strings "${pkg}/usr/local/bin/kitten" | grep share | tr -d '\n' | xxd -p | tr -d '\n')"
|
|
repl="$(echo -n /opt/kitten | xxd -p | tr -d '\n')"
|
|
repl="$(printf "%-$(echo -n "${pat}" | wc -c)s" "${repl}" | sed 's/ /0/g')"
|
|
cat "${pkg}/usr/local/bin/kitten" | xxd -p | tr -d '\n' | sed "s/${pat}/${repl}/g" | xxd -p -r | sponge "${pkg}/usr/local/bin/kitten"
|
|
|
|
repl: |
|
|
kitten
|
|
input: |
|
|
(123 * 234) say
|
|
|
|
main: "main.ktn"
|
|
template: |
|
|
"Hello, world!" say
|
|
|
|
run: |
|
|
kitten main.ktn; kitten
|