forked from atlas-engineer/nyxt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
make.lisp
49 lines (41 loc) · 2.01 KB
/
make.lisp
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
;;; make.lisp --- create binary files for Next
;;;
;;; See documents/README.org for more information on installing the
;;; dependencies necessary to build Next from source
;;;
;;; Please note that this script must be run from the root directory
;;; of the repository.
(defun maybe-load-quicklisp (path)
(ignore-errors
(load (merge-pathnames path (user-homedir-pathname)) :if-does-not-exist nil)))
(find-if (function maybe-load-quicklisp)
'(".quicklisp/setup.lisp" "quicklisp/setup.lisp"))
(require :asdf)
(push "./" asdf:*central-registry*)
(ql:quickload "next/cocoa/application" :silent t)
(defparameter *source-dir* (make-pathname :name nil :type nil :defaults *load-truename*))
(defparameter *build-dir* (merge-pathnames "build/" *source-dir*))
(defvar *bundle-dir*)
(defvar *contents-dir*)
(defvar *resources-dir*)
(defvar *macos-dir*)
(defun build-next (&optional (build-dir *build-dir*))
(let* ((*build-dir* build-dir)
(*bundle-dir* (merge-pathnames "Next.app/" *build-dir*))
(*contents-dir* (merge-pathnames "Contents/" *bundle-dir*))
(*resources-dir* (merge-pathnames "Resources/" *contents-dir*))
(*macos-dir* (merge-pathnames "MacOS/" *contents-dir*))
(*default-pathname-defaults* *source-dir*))
(ccl::ensure-directories-exist *resources-dir*)
(ccl::ensure-directories-exist (merge-pathnames "ccl/" *resources-dir*))
(ccl::ensure-directories-exist *macos-dir*)
(ccl::copy-file "../assets/Info.plist" (merge-pathnames "Info.plist" *contents-dir*)
:if-exists :supersede)
(ccl::copy-file "../assets/next.icns" (merge-pathnames "next.icns" *resources-dir*)
:if-exists :supersede)
(ccl::copy-file (ccl::kernel-path) (merge-pathnames "next" *macos-dir*)
:if-exists :supersede
:preserve-attributes t)
(ccl::save-application (merge-pathnames "ccl/next.image" *resources-dir*)
:application-class (find-symbol "COCOA-APPLICATION" "CCL"))))
(build-next)