.local/bin/portable-sbcl-script-test: Init.

master
Pierre Neidhardt 2021-01-20 20:30:45 +01:00
parent 6b35571853
commit 881a517c9c
1 changed files with 27 additions and 0 deletions

View File

@ -0,0 +1,27 @@
#!/bin/sh
#|
SYSTEMS="sbcl-alexandria sbcl-cl-str"
name="$(basename "$0")"
root="$HOME/.guix-temp-profiles/$name/$name"
guix_checkout="/var/guix/profiles/per-user/$USER/current-guix"
mtime () { ## TODO: Portable version?
stat --printf=%Y "$1"
}
if [ ! -e "$root" ] || \
[ $(mtime "$guix_checkout") -gt $(mtime "$root") ]; then
echo build
mkdir -p "$(dirname "$root")"
exec guix environment --root="$root" --ad-hoc sbcl $SYSTEMS lisp-repl-core-dumper -- \
lisp-repl-core-dumper sbcl --script "$0" "$@"
else
exec "$root"/bin/lisp-repl-core-dumper sbcl --script "$0" "$@"
fi
|#
;; (require :asdf) ; No need if using lisp-repl-core-dumper.
(asdf:load-system :alexandria)
(format t "Args ~s!~%" (uiop:command-line-arguments))
(format t "Hello ~a!~%" (alexandria:iota 1))