From 899a88a72738425c42bc467c4e4ffcb7e0dcae93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Kochma=C5=84ski?= Date: Fri, 23 Oct 2015 17:33:50 +0200 Subject: [PATCH] android/example: clean up the init scripts Move the ASDF cache initialization below it's inclusion and don't be so noisy with swank. Also add the function sysinit which downloads and installs the Quicklisp and replaces it's interpreted gunzip with our precompiled deflate. --- examples/android/assets/lisp/etc/init.lisp | 16 +++++----------- examples/android/assets/lisp/etc/user.lisp | 12 +++++++++++- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/examples/android/assets/lisp/etc/init.lisp b/examples/android/assets/lisp/etc/init.lisp index 015e2094d..9f4a26b0a 100644 --- a/examples/android/assets/lisp/etc/init.lisp +++ b/examples/android/assets/lisp/etc/init.lisp @@ -7,17 +7,13 @@ (setq *default-directory* *default-pathname-defaults*) (defvar *ecl-home* *default-directory*) -(ext:setenv "USER-CACHE" - (namestring (merge-pathnames #P"../cache/" *ecl-home*))) -(setf asdf:*user-cache* (merge-pathnames #P"../cache/" *default-pathname-defaults*)) (format t "Loading the modules~%") -(require :ASDF) -(require :SOCKETS) -(require :SERVE-EVENT) +(require '#:asdf) +(require '#:sockets) +(require '#:serve-event) -;; swank probes sys:serve-event.fas (which doesn't exist) -;; (pushnew :SERVE-EVENT *features*) +(setf asdf:*user-cache* (merge-pathnames #P"../cache/" *default-pathname-defaults*)) (pushnew (namestring *default-pathname-defaults*) asdf:*central-registry*) @@ -50,7 +46,6 @@ (let* ((socket (connection.socket-io connection)) (inputs (list socket #+(or) stdin)) (ready (wait-for-input inputs))) - (describe (list 'hobaa connection stdin socket inputs ready)) (cond ((eq ready :interrupt) (check-slime-interrupts)) ((member socket ready) @@ -86,8 +81,7 @@ (swank:create-server :port 4005 :dont-close t ;; :style nil #|:spawn|# - )) - )) + )))) (format t "Initialization done~%") (force-output) diff --git a/examples/android/assets/lisp/etc/user.lisp b/examples/android/assets/lisp/etc/user.lisp index 553e0bd0a..3cc490ee1 100644 --- a/examples/android/assets/lisp/etc/user.lisp +++ b/examples/android/assets/lisp/etc/user.lisp @@ -3,7 +3,6 @@ (setq *default-directory* *default-pathname-defaults*) -(format t "user.lisp 1~%") (defun sysinfo (&optional (out *standard-output*)) "Print the current environment to a stream." (declare (stream out)) @@ -49,4 +48,15 @@ Current time:~25t" (/ internal-time-units-per-second) *gensym-counter*) (format out "~a" (get-universal-time)) (format out "~%~75~~%") (room) (values)) +(defun sysinit () + (format t "Loading the quicklisp subsystem~%") + (require '#:ecl-quicklisp) + (require '#:deflate) + (require '#:ql-minitar) + ;; Replace the interpreted function with the precompiled equivalent + ;; from DEFLATE + (eval (read-from-string + "(setf (symbol-function 'ql-gunzipper:gunzip) #'deflate:gunzip))"))) + (sysinfo) +;; (sysinit)