From 6c954007ed45aead42719a76ab38333f989f759e Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Thu, 21 Jul 2022 09:11:15 -0400 Subject: Add sysdeps to repl environments --- Biz/Ide/repl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'Biz') diff --git a/Biz/Ide/repl b/Biz/Ide/repl index 2ddbc4b..cf800aa 100755 --- a/Biz/Ide/repl +++ b/Biz/Ide/repl @@ -20,28 +20,34 @@ fi targets=${@:?} json=$(bild --json ${targets[@]}) langdeps=$(jq --raw-output '.langdeps | join(" ")' <<< $json) + sysdeps=$(jq --raw-output '.sysdeps | join(" ")' <<< $json) exts=$(jq --raw-output '.namespace.ext' <<< $json | sort | uniq) + flags=() + for lib in ${sysdeps[@]}; do + flags+=(--packages "(import $BIZ_ROOT/Biz/Bild.nix {}).private.nixpkgs.${lib}") + done case $exts in Hs) if [ -z ${var+PORT} ]; then echo "warn: repl: ghci does not support binding to a port" fi nix-shell \ + "${flags[@]}" \ --packages "(import $BIZ_ROOT/Biz/Bild.nix {}).private.ghcWith (h: with h; [$langdeps])" \ --command "ghci -i$BIZ_ROOT -ghci-script $BIZ_ROOT/.ghci ${targets[@]}" ;; Scm) - flags=() for lib in ${langdeps[@]}; do flags+=(--packages "(import $BIZ_ROOT/Biz/Bild.nix {}).private.nixpkgs.guile-${lib}") done nix-shell \ + "${flags[@]}" \ --packages "(import $BIZ_ROOT/Biz/Bild.nix {}).private.nixpkgs.guile_3_0" \ - ${flags[@]} \ --command "guile -L $BIZ_ROOT -C $BIZ_ROOT/_/int --r7rs --listen=${PORT:-37146}" ;; Lisp) nix-shell \ + "${flags[@]}" \ --packages "(import $BIZ_ROOT/Biz/Bild.nix {}).private.sbclWith (p: with p; [asdf swank $langdeps])" \ --command "sbcl --eval '(require :asdf)' --eval '(require :swank)' --eval '(swank:create-server :port ${PORT:-4005})' --load $targets" ;; -- cgit v1.2.3