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

Make wuwei ready for ASDF 3.3 #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions heroku-setup.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -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")
10 changes: 4 additions & 6 deletions src/heroku.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -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")))
13 changes: 6 additions & 7 deletions src/net-utils.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
22 changes: 9 additions & 13 deletions wuwei.asd
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
(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"
:version "0.1"
:author "Mike Travers <[email protected]>"
: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")
Expand All @@ -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 <[email protected]>"
:license "MIT"
:serial t
:depends-on (:wuwei :drakma)
:components
:depends-on ("wuwei" "drakma")
:components
((:module "examples"
:serial t
:components
Expand All @@ -63,5 +61,3 @@
(:file "arc-challenge")
(:file "go") ;set up for Heroku
))))