Recently Written · git

clic

MIRROR ONLY Gopher client with pretty colours in Common Lisp

git clone https://github.com/equwal/clic

Log | Files | Refs


commit 351cdba6f1b01fe686a8e30cd3fbc745266c3766
Solene Rapenne <solene@perso.pw>
2019-03-01 12:47:04 +0100

Change build system

 3rdparties/bundle-info.sexp             |  4 ++--
 3rdparties/local-projects/.exists       |  0
 3rdparties/software/uiop-3.3.2/uiop.asd |  2 +-
 Makefile                                |  4 ++--
 clic.asd                                | 13 +++++++++++++
 clic.lisp                               | 12 ++----------
 make-binary.lisp                        | 24 +++++++++++-------------
 make-bundle.lisp                        |  2 +-
 8 files changed, 32 insertions(+), 29 deletions(-)
diff --git a/3rdparties/bundle-info.sexp b/3rdparties/bundle-info.sexp
index 43d4a86..e7aad1c 100644
--- a/3rdparties/bundle-info.sexp
+++ b/3rdparties/bundle-info.sexp
@@ -1,5 +1,5 @@
-(:CREATION-TIME "2019-02-28T17:28:32Z" :REQUESTED-SYSTEMS ("usocket" "cl+ssl")
- :LISP-INFO
+(:CREATION-TIME "2019-03-01T11:39:38Z" :REQUESTED-SYSTEMS
+ ("usocket" "cl+ssl" "asdf") :LISP-INFO
  (:MACHINE-INSTANCE "solene.perso.local" :MACHINE-TYPE "amd64" :MACHINE-VERSION
   NIL :LISP-IMPLEMENTATION-TYPE "ECL" :LISP-IMPLEMENTATION-VERSION "16.1.3")
  :QUICKLISP-INFO
diff --git a/3rdparties/local-projects/.exists b/3rdparties/local-projects/.exists
deleted file mode 100644
index e69de29..0000000
diff --git a/3rdparties/software/uiop-3.3.2/uiop.asd b/3rdparties/software/uiop-3.3.2/uiop.asd
index 7abab7a..e96ef7a 100644
--- a/3rdparties/software/uiop-3.3.2/uiop.asd
+++ b/3rdparties/software/uiop-3.3.2/uiop.asd
@@ -44,7 +44,7 @@ you already have a matching UIOP loaded."
    (:file "image" :depends-on ("stream"))
    (:file "lisp-build" :depends-on ("image"))
    (:file "launch-program" :depends-on ("stream"))
-   (:file "run-program" :depends-on ("launch-program"))
+   (:file "run-program" :depends-on ("launch-program" "version"))
    (:file "configuration" :depends-on ("image"))
    (:file "backward-driver" :depends-on ("lisp-build" "run-program" "configuration" "version"))
    (:file "driver" :depends-on ("backward-driver"))))
diff --git a/Makefile b/Makefile
index a96f698..443c17c 100644
--- a/Makefile
+++ b/Makefile
@@ -11,8 +11,8 @@ MANDIR = ${PREFIX}/share/man
 
 all: ${BIN}
 
-${BIN}:	clic.lisp make-binary.lisp
-	ecl -load make-binary.lisp
+${BIN}:	clic.lisp clic.asd make-binary.lisp
+	ecl -norc -load make-binary.lisp
 
 install: ${BIN}
 	@echo installing executable to "${DESTDIR}${PREFIX}/bin"
diff --git a/clic.asd b/clic.asd
new file mode 100644
index 0000000..4b1a32d
--- /dev/null
+++ b/clic.asd
@@ -0,0 +1,13 @@
+;;(defpackage :clic
+;;  (:use :cl :asdf)
+;;  (:export #:main))
+;;
+;;(in-package :clic)
+
+(defsystem "clic"
+    :description "Command Line Interface Client"
+    :version "1.1.1"
+    :author "Solene Rapenne <solene@perso.pw>"
+    :licence "MIT"
+    :depends-on (:usocket :cl+ssl)
+    :components ((:file "clic")))
diff --git a/clic.lisp b/clic.lisp
index 206b122..ba57271 100644
--- a/clic.lisp
+++ b/clic.lisp
@@ -1,12 +1,4 @@
-;;; let's hide the loading
-(let ((*standard-output* (make-broadcast-stream)))
-  (require 'asdf)
-  #+ecl
-  (require 'sockets))
-
-(load "3rdparties/bundle.lisp")
-(require :cl+ssl)
-(require :usocket)
+(in-package :cl-user)
 
 ;;;; C binding to get terminal informations
 #+ecl
@@ -733,7 +725,7 @@
   (let ((last-page (car *history*)))
     (format t "~a~agopher://~a:~a/~a~a (~as, ~aKb) / (p)rev (r)edisplay (h)istory : "
             (if *kiosk-mode* "KIOSK " "")
-            (if (location-tls last-page) "**TLS** " " UNSECURE ")
+            (if (location-tls last-page) "**TLS** " "UNSECURE ")
             (location-host last-page)
             (location-port last-page)
             (location-type last-page)
diff --git a/make-binary.lisp b/make-binary.lisp
index 9c2cc54..3eb022e 100644
--- a/make-binary.lisp
+++ b/make-binary.lisp
@@ -1,17 +1,15 @@
-;; ecl produces a linked binary to ecl shared library
 (load "3rdparties/bundle.lisp")
-(require 'usocket)
-(require 'cl+ssl)
-(require 'asdf)
-(require 'cmp)
+(require :asdf)
 
-(progn
-  (compile-file "clic.lisp" :system-p t)
-  (c:build-program "clic"
-                   :prologue-code '(ext:set-signal-handler ext:+sigint+ nil)
-                   :epilogue-code '(progn (handler-case (main)
-                                            (condition () (quit))))
-                   :lisp-files '("clic.o")))
+;; load clic which is in $PWD
+(push '*default-pathname-defaults* asdf:*central-registry*)
 
-(format t "~%~%Compilation finished~%")
+(in-package :cl-user)
+
+(asdf:make-build "clic" :type :program
+                 :monolithic t
+                 :move-here "."
+                 :prologue-code '(ext:set-signal-handler ext:+sigint+ nil)
+                 :epilogue-code '(progn (handler-case (main)
+                                          (condition () (quit)))))
 (quit)
diff --git a/make-bundle.lisp b/make-bundle.lisp
index 1a7a60a..d1b2127 100644
--- a/make-bundle.lisp
+++ b/make-bundle.lisp
@@ -1,2 +1,2 @@
-(ql:bundle-systems '("usocket" "cl+ssl") :to "3rdparties/")
+(ql:bundle-systems '("usocket" "cl+ssl" "asdf") :to "3rdparties/")
 (quit)