Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix setup.sh #174

Merged
merged 4 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ jobs:
run: |
PATH="~/.roswell/bin:$PATH"
rove qlot.asd
- name: Run setup.sh
run: scripts/setup.sh
33 changes: 19 additions & 14 deletions proxy.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,28 @@
;; For some reason, a separate function definition
;; works as expected.
(defun qlot-http-fetch (url &rest rest)
(let ((ql:*proxy-url*
(if (eql (search #1="qlot://localhost/" url
:end2 (length #1#))
0)
nil
ql:*proxy-url*)))
(apply #'orig-http-fetch url rest))))
(if (find :quicklisp *features*)
(progv (list (intern (string '#:*proxy-utl*) '#:ql))
(list
;; do not use proxy if connect localhost
(if (eql (search #1="qlot://localhost/" url
:end2 (length #1#))
0)
nil
(symbol-value (intern (string '#:*proxy-utl*) '#:ql))))
(apply #'orig-http-fetch url rest))
(apply #'orig-http-fetch url rest))))

#+quicklisp
(eval-when (:compile-toplevel :load-toplevel :execute)
(unless (fboundp 'orig-http-fetch)
;; dummy for suppress style warning
(defun orig-http-fetch (&rest args)
(declare (ignore args)))
(setf (symbol-function 'orig-http-fetch)
(fdefinition
(find-symbol (string '#:http-fetch) '#:ql-http)))
;; do not use proxy if connect localhost
(setf (fdefinition (find-symbol (string '#:http-fetch) '#:ql-http))
#'qlot-http-fetch)))
(declare (ignore args))
(error "A dummy function is called"))
(when (find-package '#:ql-http)
(setf (symbol-function 'orig-http-fetch)
(fdefinition
(find-symbol (string '#:http-fetch) '#:ql-http)))
(setf (fdefinition (find-symbol (string '#:http-fetch) '#:ql-http))
#'qlot-http-fetch))))
2 changes: 1 addition & 1 deletion scripts/fetch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ QLOT_SOURCE_DIR=$(cd "$(dirname "$0")/../" 2>&1 && pwd -P)

errmsg() { echo -e "\e[31mError: $1\e[0m" >&2; }
if [ "$(which ros 2>/dev/null)" != "" ]; then
lisp="ros without-roswell=t -L sbcl-bin run --"
lisp="ros +Q -L sbcl-bin run --"
elif [ "$(which sbcl 2>/dev/null)" != "" ]; then
lisp="sbcl"
else
Expand Down
2 changes: 1 addition & 1 deletion scripts/qlot-installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ check_requirement "which"
if [ "$(which sbcl 2>/dev/null)" != "" ]; then
lisp="sbcl"
elif [ "$(which ros 2>/dev/null)" != "" ]; then
lisp="ros without-roswell=t -L sbcl-bin run --"
lisp="ros +Q -L sbcl-bin run --"
else
errmsg "sbcl is required to setup Qlot."
exit 1
Expand Down
2 changes: 1 addition & 1 deletion scripts/qlot-uninstaller.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ fi
if [ "$(which sbcl 2>/dev/null)" != "" ]; then
lisp="sbcl"
elif [ "$(which ros 2>/dev/null)" != "" ]; then
lisp="ros without-roswell=t -L sbcl-bin run --"
lisp="ros +Q -L sbcl-bin run --"
else
exit
fi
Expand Down
2 changes: 1 addition & 1 deletion scripts/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ check_qlot_directory() {
errmsg() { echo -e "\e[31mError: $1\e[0m" >&2; }

if [ "$(which ros 2>/dev/null)" != "" ]; then
lisp="ros without-roswell=t -L sbcl-bin run --"
lisp="ros +Q -L sbcl-bin run --"
elif [ "$(which sbcl 2>/dev/null)" != "" ]; then
lisp="sbcl"
else
Expand Down
7 changes: 6 additions & 1 deletion scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ QLOT_SOURCE_DIR=$(cd "$(dirname "$0")/../" 2>&1 >/dev/null && pwd -P)

errmsg() { echo -e "\e[31mError: $1\e[0m" >&2; }
if [ "$(which ros 2>/dev/null)" != "" ]; then
lisp="ros without-roswell=t -L sbcl-bin run --"
lisp="ros +Q -L sbcl-bin run --"
elif [ "$(which sbcl 2>/dev/null)" != "" ]; then
lisp="sbcl"
else
Expand All @@ -23,6 +23,11 @@ if [ ! -f "$QLOT_SOURCE_DIR/.bundle-libs/bundle.lisp" ]; then
--eval "(asdf:load-asd #P\"$QLOT_SOURCE_DIR/qlot.asd\")" \
--eval '(asdf:load-system :qlot/install/quicklisp)' \
--eval "(qlot/install/quicklisp:install-quicklisp \"$QLOT_SOURCE_DIR/.qlot/\")"
if [ ! -d "$QLOT_SOURCE_DIR/.qlot/dists/quicklisp" ]; then
$lisp --noinform --no-sysinit --no-userinit --non-interactive \
--load "$QLOT_SOURCE_DIR/.qlot/setup.lisp" \
--eval '(ql-dist:install-dist "https://beta.quicklisp.org/dist/quicklisp.txt" :prompt nil)'
fi
else
$lisp --noinform --no-sysinit --no-userinit --non-interactive \
--load $QLOT_SOURCE_DIR/.qlot/setup.lisp \
Expand Down