From 8ce967744c3648658b5c3df2f61bcdb8540f642c Mon Sep 17 00:00:00 2001 From: Dimitri Fontaine Date: Wed, 21 Jan 2015 15:57:29 +0100 Subject: [PATCH] Add support for http_proxy environment variable to install quicklisp. See #153. --- Makefile | 6 ++++-- src/getenv.lisp | 16 ++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 src/getenv.lisp diff --git a/Makefile b/Makefile index ede62f6..784ce91 100644 --- a/Makefile +++ b/Makefile @@ -83,8 +83,10 @@ $(QLDIR)/local-projects/esrap: $(QLDIR)/setup.lisp: mkdir -p $(BUILDDIR) curl -o $(BUILDDIR)/quicklisp.lisp http://beta.quicklisp.org/quicklisp.lisp - $(CL) $(CL_OPTS) --load $(BUILDDIR)/quicklisp.lisp \ - --eval '(quicklisp-quickstart:install :path "$(BUILDDIR)/quicklisp")' \ + $(CL) $(CL_OPTS) --load $(BUILDDIR)/quicklisp.lisp \ + --load src/getenv.lisp \ + --eval '(quicklisp-quickstart:install :path "$(BUILDDIR)/quicklisp" \ + :proxy (getenv "http_proxy"))' \ --eval '(quit)' quicklisp: $(QLDIR)/setup.lisp ; diff --git a/src/getenv.lisp b/src/getenv.lisp new file mode 100644 index 0000000..dcb7987 --- /dev/null +++ b/src/getenv.lisp @@ -0,0 +1,16 @@ +;;; +;;; Export a getenv feature so that we can fetch http_proxy at build time. +;;; +;;; We can't rely on Quicklisp to have installed a modern ASDF with UIOP yet +;;; here: we need the feature to pass in the :proxy argument to +;;; quicklisp-quickstart:install. +;;; + +(in-package :cl-user) + +(defun getenv (name &optional default) + "Return the current value for the environment variable NAME, or default + when unset." + (or #+sbcl (sb-ext:posix-getenv name) + #+ccl (ccl:getenv name) + default))