diff --git a/README.md b/README.md index 2f7dde4..03fed41 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ Easiest using QuickLisp: 4. Load everything: (ql:quickload "wuwei") - (ql:quickload "wuwei-examples") ; if wanted + (ql:quickload "wuwei/examples") ; if wanted 5. Start the server diff --git a/heroku-setup.lisp b/heroku-setup.lisp index 8470194..a7746db 100644 --- a/heroku-setup.lisp +++ b/heroku-setup.lisp @@ -3,12 +3,12 @@ (print ">>> Building system....") ;(asdf:clear-system "wuwei") -;(asdf:clear-system "wuwei-examples") +;(asdf:clear-system "wuwei/examples") (load (make-pathname :directory *build-dir* :defaults "wuwei.asd")) ;;; This is NOT WORKING, and the build gets Wuwei from Quicklisp. But that's better than what it was doing before, which was using a completely obsolete version...no fucking idea what is going on here. (push (make-pathname :directory *build-dir*) asdf:*central-registry*) -(ql:quickload :wuwei-examples) +(ql:quickload :wuwei/examples) (print ">>> Done building system") diff --git a/src/heroku.lisp b/src/heroku.lisp index 267d8a4..86b1269 100644 --- a/src/heroku.lisp +++ b/src/heroku.lisp @@ -7,13 +7,11 @@ ;;; Called from an application's heroku-setup.lisp ;;; Directory is a relative path from the app root. (defun heroku-install-wupub-files (&optional (directory '("wupub"))) - (asdf:run-shell-command - (format nil "cp -r ~Apublic ~A" - (namestring (asdf:component-pathname (asdf:find-system :wuwei))) - (namestring (make-pathname :directory (append cl-user::*build-dir* directory))) - ))) + (uiop:run-program + `("cp" "-r" ,(uiop:native-namestring (asdf:system-relative-pathname "wuwei" "public")) + ,(uiop:native-namestring (uiop:subpathname cl-user::*build-dir* directory))))) ;;; Called from cl-user::initialize-application, which is called at startup (defun wuwei-initialize-application (&key (directory "./wupub/")) (locate-public-directory directory) - (setf *developer-mode* (equal (ccl:getenv "DEVELOPER_MODE") "Y"))) + (setf *developer-mode* (equal (uiop:getenv "DEVELOPER_MODE") "Y"))) diff --git a/src/net-utils.lisp b/src/net-utils.lisp index 7972309..3f11f85 100644 --- a/src/net-utils.lisp +++ b/src/net-utils.lisp @@ -9,13 +9,12 @@ ;;; Alternate get-url that doesn't use net.aserve.client::do-http-request, which will sometimes get borked for no apparent reason. (defun wget-url (url &key query) - (let ((temp-file (make-pathname :name (string (gensym)) :directory "/tmp")) - (url (if query - (string+ url "?" (query-to-form-urlencoded query)) - url))) - (unless (zerop (asdf:run-shell-command "wget -c \"~A\" -O ~A" url (pathname temp-file))) - (error "Shell command failed")) - (file-to-string temp-file))) + (uiop:with-temporary-file (:pathname temp-file) + (let ((url (if query + (string+ url "?" (query-to-form-urlencoded query)) + url))) + (uiop:run-program `("wget" "-c" ,url "-O" ,(uiop:native-namestring temp-file))) + (file-to-string temp-file)))) (defun get-url-with-backoff (url &rest keys) (multiple-value-bind (body response) diff --git a/wuwei.asd b/wuwei.asd index b696b9b..1329fc5 100644 --- a/wuwei.asd +++ b/wuwei.asd @@ -1,9 +1,7 @@ -(in-package :asdf) - #+ALLEGRO (require :aserve) -(defsystem :wuwei +(defsystem "wuwei" :name "WuWei" :description "Tools for developing Ajaxy web applications" :long-description "WuWei is a toolkit for building Ajax web pages and web sites in Common Lisp. It's designed to be light-weight, a toolkit rather than a platform. Features include: Continuation-based AJAX user interfaces; Server-side DOM operations (add/remove elements, visual fades, drag and drop); High-level interfaces to in-place-editing and autocomplete widgets; Login and session management" @@ -11,18 +9,18 @@ :author "Mike Travers " :license "MIT" :serial t - :depends-on (#-ALLEGRO :aserve :cl-json :mtlisp #-ALLEGRO :ironclad - :drakma) ;for oauth2 - :components + :depends-on (#-ALLEGRO "aserve" "cl-json" "mtlisp" #-ALLEGRO "ironclad" + "drakma") ;for oauth2 + :components ((:static-file "wuwei.asd") (:module :src - :serial t + :serial t :components ((:file "package") (:file "htmlgen-patch") (:file "cl-json-patches") - + (:file "config") (:file "net-utils") (:file "web") @@ -42,15 +40,15 @@ #+:CCL (:file "heroku") )))) -(defsystem :wuwei-examples +(defsystem "wuwei/examples" :name "WuWei Examples" :description "Example for WuWei" :version "0.1" :author "Mike Travers " :license "MIT" :serial t - :depends-on (:wuwei :drakma) - :components + :depends-on ("wuwei" "drakma") + :components ((:module "examples" :serial t :components @@ -63,5 +61,3 @@ (:file "arc-challenge") (:file "go") ;set up for Heroku )))) - -