-
Notifications
You must be signed in to change notification settings - Fork 5
/
openbookstore.asd
208 lines (177 loc) · 7.34 KB
/
openbookstore.asd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
#|
This file is part of the OpenBookstore project.
|#
(require "asdf") ;; for CI
(require "uiop") ;; for CI?
(require "cl+ssl")
(uiop:format! t "~&------- ASDF version: ~a~&" (asdf:asdf-version))
(uiop:format! t "~&------- UIOP version: ~a~&" uiop:*uiop-version*)
(asdf:defsystem "openbookstore"
:version "0.2"
:author "vindarel"
:license "GPL3"
:description "Free software for bookshops."
:homepage "https://gitlab.com/myopenbookstore/openbookstore/"
:bug-tracker "https://gitlab.com/myopenbookstore/openbookstore/-/issues/"
:source-control (:git "https://gitlab.com/myopenbookstore/openbookstore/")
:depends-on (
;; web client
:dexador
:plump
:lquery
:clss ;; might do with lquery only
;; DB
:mito
:dbd-sqlite3 ;; required for the binary (?)
:mito-auth
;; readline
:unix-opts
:replic
:cl-ansi-text
:parse-number
;; utils
:alexandria
:can
:function-cache ;; scrapers
:str
:local-time
:local-time-duration
:cl-ppcre
:parse-float
:serapeum
:log4cl
:trivial-backtrace
:deploy ;; must be a build dependency, but we also use deployed-p checks in our code.
:fiveam ;; dep of dep for build, required by deploy??
;; cache
:cacle
;; web app
:hunchentoot
:hunchentoot-errors ;; augment stacktrace with request data: params, headers…
:easy-routes
:djula
:djula-gettext
:cl-json
:cl-slug
:gettext
)
:components ((:module "src/datasources"
:components
((:file "dilicom")
(:file "dilicom-flat-text")
(:file "base-scraper")
(:file "scraper-fr")
(:file "scraper-argentina")
;; Depends on the above.
(:file "datasources")))
(:module "src"
:components
;; stand-alone packages.
((:file "parameters")
(:file "utils")
(:file "i18n")
(:file "termp")
;; they depend on the above.
(:file "packages")
(:file "authentication")
(:file "bookshops") ;; depends on src/web
(:file "database")))
(:module "src/models"
:components
((:file "shelves")
(:file "models")
(:file "models-utils")
(:file "baskets")
(:file "contacts")
(:file "sell")))
;; readline-based, terminal user-facing app (using REPLIC).
(:module "src/terminal"
:components
((:file "commands")
;; relies on the above:
(:file "manager")))
;; One-off utility "scripts" to work on the DB.
(:module "src/management"
:components
((:file "management")))
(:module "src/web"
:components
((:file "package")
(:file "messages")
(:file "authentication")
(:file "search")
(:file "pre-web")
(:file "web")
(:file "api")))
(:static-file "README.md")
;; Declare our templates to compile them in-memory, for delivery.
(:module "src/web/templates"
:components
;; Order is important: the ones that extend base.html
;; must be declared after it, because we compile all of them
;; at build time.
((:static-file "login.html")
(:static-file "404.html")
(:static-file "base.html")
(:static-file "dashboard.html")
(:static-file "history.html")
(:static-file "loans.html")
(:static-file "search.html")
(:static-file "stock.html")
(:static-file "sell.html")
(:static-file "receive.html")
(:static-file "card-edit.html")
(:static-file "card-stock.html")
(:static-file "card-page.html")
(:static-file "card-create.html")
(:static-file "permission-denied.html")
(:static-file "no-nav-base.html")))
;; Static files (JS, CSS)
(:module "src/static"
:components
((:static-file "openbookstore.js")
(:static-file "card-page.js"))))
;; :build-operation "program-op"
:entry-point "openbookstore:run"
:build-pathname "openbookstore"
;; For a .deb (with the two lines above).
;; :build-operation "linux-packaging:build-op"
;; With Deploy, ship foreign libraries (and ignore libssl).
:defsystem-depends-on (:deploy) ;; (ql:quickload "deploy") before
:build-operation "deploy-op" ;; instead of "program-op"
;; :long-description
;; #.(read-file-string
;; (subpathname *load-pathname* "README.md"))
:in-order-to ((test-op (test-op "bookshops-test"))))
;; Don't ship libssl, rely on the target OS'.
;; Needs to require or quickload cl+ssl before we can compile and load this .asd file? :S
#+linux (deploy:define-library cl+ssl::libssl :dont-deploy T)
#+linux (deploy:define-library cl+ssl::libcrypto :dont-deploy T)
;; Use compression: from 108M, 0.04s startup time to 24M, 0.37s.
#+sb-core-compression
(defmethod asdf:perform ((o asdf:image-op) (c asdf:system))
(uiop:dump-image (asdf:output-file o c) :executable t :compression t))
(asdf:defsystem "bookshops/gui"
:version "0.1.0"
:author "vindarel"
:license "GPL3"
:depends-on (:bookshops
:nodgui)
:components ((:module "src/gui"
:components
((:file "gui"))))
:build-operation "program-op"
:build-pathname "bookshops-gui"
:entry-point "bookshops.gui:main"
:description "Simple graphical user interface to manage one's books."
;; :long-description
;; #.(read-file-string
;; (subpathname *load-pathname* "README.md"))
:in-order-to ((test-op (test-op "bookshops-test"))))
;; Now ASDF wants to update itself and crashes.
;; On the target host, when we run the binary, yes. Damn!
;; Thanks again to Shinmera.
(deploy:define-hook (:deploy asdf) (directory)
(declare (ignorable directory))
#+asdf (asdf:clear-source-registry)
#+asdf (defun asdf:upgrade-asdf () nil))