Skip to content
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
26 changes: 15 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,22 @@ jobs:
if: runner.os == 'Windows'
run: choco install sbcl

- name: Install Quicklisp and ql-https
run: ./install.sh

- name: Run tests
- name: Install ql-https and run tests
env:
CI: 1
run: |
sbcl <<EOF
(require 'asdf)
(push (uiop:getcwd) asdf:*central-registry*)
(ql:quickload "ql-https/test")
(asdf:test-system "ql-https")
(uiop:quit)
EOF
mkdir quicklisp
echo "Downloading quicklisp client..."
curl -s 'http://beta.quicklisp.org/client/2021-02-13/quicklisp.tar' -o quicklisp/quicklisp.tar
tar xf quicklisp/quicklisp.tar -C quicklisp
sbcl --non-interactive \
--eval "(require 'asdf)" \
--eval '(push (uiop:getcwd) asdf:*central-registry*)' \
--eval '(push (merge-pathnames "quicklisp/quicklisp/" (uiop:getcwd)) asdf:*central-registry*)' \
--load ql-setup.lisp \
--load install.lisp \
--eval '(setf ql-https:*quietly-use-https* t)' \
--eval '(ql:quickload "ql-https/test")' \
--eval '(asdf:test-system "ql-https")'


31 changes: 17 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,44 +20,48 @@ ql-https &#x2014; HTTPS support for Quicklisp via curl

## AUTOMATIC INSTALLATION

The default implementation is sbcl, if you are using another then set the `LISP`
environment variable, for example to use Clozure common lisp:
The default implementation is SBCL, if you are using another then set the `LISP`
environment variable, for example to use Clozure Common Lisp:

export LISP=ccl

now run the installer script:
If you change the implementation, adjusting the `CLFLAGS` is almost
always necessary as well, for example for CCL:

export CLFLAGS=-Q -b -n

Now run the installer script:

curl https://raw.githubusercontent.com/rudolfochrist/ql-https/master/install.sh | bash


## MANUAL INSTALLATION

1. `mkdir ~/quicklisp` and `cd ~/quicklisp`
2. Go to <https://beta.quicklisp.org/client/quicklisp.sexp> and lookup `:client-tar` URL, download it, verify
hash and untar.
3. Clone ql-https from <https://github.com/rudolfochrist/ql-https.git> to
to `~/common-lisp/ql-https`
2. Go to <https://beta.quicklisp.org/client/quicklisp.sexp> and lookup
`:client-tar` URL, download it, verify hash and untar.
3. Clone ql-https from <https://github.com/rudolfochrist/ql-https.git>
to to `~/common-lisp/ql-https`
4. Start a fresh REPL and (require 'asdf)
5. Load `~/common-lisp/ql-https/ql-setup.lisp`
6. Eval `(uiop:symbol-call :ql-setup :setup)`
6. Eval `(uiop:symbol-call :ql-setup :setup)`. Invoke `ql-https`
restarts as necessary. If you use an alternative install location
for quicklisp eval `(uiop:symbol-call :ql-setup :setup
#p"/path/to/quicklisp")`

Removing the *Missing client-info.sexp, using mock info* warning.

1. Eval `(ql:update-client)`
2. move `~/quicklisp/tmp/client-info.sexp` to `~/quicklisp`

Watch ASCIInema:

[![asciicast](https://asciinema.org/a/585361.svg)](https://asciinema.org/a/585361)


## STARTUP

```lisp
(let ((quicklisp-init #p"~/common-lisp/ql-https/ql-setup.lisp"))
(when (probe-file quicklisp-init)
(load quicklisp-init)
;; Alternatively: (uiop:symbol-call :ql-setup :setup "/path/to/quicklisp/")
;; Alternatively: (uiop:symbol-call :ql-setup :setup #p"/path/to/quicklisp/")
(uiop:symbol-call :ql-setup :setup)))

;; optional
Expand All @@ -78,4 +82,3 @@ Copyright (c) 2022 Sebastian Christ (rudolfo.christ@pm.me)
# LICENSE

Released under the MIT license.

27 changes: 27 additions & 0 deletions install.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
;;; SPDX-License-Identifier: MPL-2.0
;;;
;;; This Source Code Form is subject to the terms of the Mozilla Public
;;; License, v. 2.0. If a copy of the MPL was not distributed with this
;;; file, You can obtain one at http://mozilla.org/MPL/2.0/.

(require 'asdf)

(handler-bind ((error (lambda (c)
(let ((restart
(find-if (lambda (restart-name)
(string-equal "USE-HTTPS-SESSION"
(symbol-name restart-name)))
(compute-restarts c)
:key #'restart-name)))
(cond
(restart
(invoke-restart restart))
(t
(format *error-output* "~%Installation failed~%~A~%" c)
(uiop:quit 1)))))))
(uiop:symbol-call :ql-setup :setup))

(assert (equalp ql-http:*fetch-scheme-functions* '(("http" . ql-https:fetcher) ("https" . ql-https:fetcher))))

(ql-util:without-prompting
(ql:add-to-init-file))
18 changes: 5 additions & 13 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
set -euo pipefail

LISP=${LISP=sbcl}
CLFLAGS=${CLFLAGS=--non-interactive --no-userinit}

# For testers
QL_TOPDIR="${QL_TOPDIR-$HOME/quicklisp}"
Expand Down Expand Up @@ -41,24 +42,15 @@ git clone https://github.com/rudolfochrist/ql-https "$CLDIR"/ql-https

if test "$SKIP_USERINIT" = no; then
echo "Running setup code..."
$LISP <<EOF
(require 'asdf)
(load "~/common-lisp/ql-https/ql-setup.lisp")
(asdf:load-system "ql-https")
(assert (equalp ql-http:*fetch-scheme-functions* '(("http" . ql-https:fetcher) ("https" . ql-https:fetcher))))
(setf ql-https:*quietly-use-https* t)
(quicklisp:setup)
(ql-util:without-prompting
(ql:add-to-init-file))
EOF

$LISP $CLFLAGS \
--load "$CLDIR/ql-https/ql-setup.lisp" \
--load "$CLDIR/ql-https/install.lisp"
cat > "$QL_TOPDIR"/setup.lisp <<EOF
(require 'asdf)
(let ((quicklisp-init #p"~/common-lisp/ql-https/ql-setup.lisp"))
(when (probe-file quicklisp-init)
(load quicklisp-init)
(asdf:load-system "ql-https")
(uiop:symbol-call :quicklisp :setup)))
(uiop:symbol-call :ql-setup :setup)))

;; optional
#+ql-https
Expand Down
Loading