summaryrefslogtreecommitdiff
path: root/next/make.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'next/make.lisp')
-rw-r--r--next/make.lisp117
1 files changed, 38 insertions, 79 deletions
diff --git a/next/make.lisp b/next/make.lisp
index f66f0b58b..31c7b4a5d 100644
--- a/next/make.lisp
+++ b/next/make.lisp
@@ -1,87 +1,46 @@
;;;; make.lisp --- create binary files for nEXT
-
-;;;; Pre-requisties:
-;;;; - dylibbundler (available via ports)
-;;;; - ecl (available at the official website)
-;;;; - eql (available at the official repository)
;;;;
;;;; See Next/next/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 directory
-;;;; Next/next. It may be necessary to modify the paths or commands in
-;;;; the "Bundle OSX Dependencies" List.
-
-#-eql5
-(error "Please use the EQL5 executable (see README)")
-(require :cmp)
-(push "./" asdf:*central-registry*)
-(ql:quickload "next")
-
-;; build static library
-(asdf:make-build "next"
- :monolithic t
- :type :static-library
- :move-here "./")
-
-;; rename static library
-(let ((lib-name #+msvc "next.lib"
- #-msvc "libnext.a"))
- (when (probe-file lib-name)
- (delete-file lib-name))
- (rename-file (x:cc "next--all-systems"
- #+msvc ".lib"
- #-msvc ".a")
- lib-name))
-
-;; execute qmake
-(ext:run-program "qmake" nil :output t)
+;;;; Next/next.
-;; execute make
-(ext:run-program "make" nil :output t)
+(let ((quicklisp-init (merge-pathnames ".quicklisp/setup.lisp" (user-homedir-pathname))))
+ (when (probe-file quicklisp-init)
+ (load quicklisp-init)))
+(require :asdf)
-
-;;;; Cleanup Operations ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; delete tmp dir to force recompilation
-(uiop:delete-directory-tree
- (merge-pathnames (make-pathname
- :directory '(:relative "tmp"))
- (asdf:system-source-directory :next))
- :validate T
- :if-does-not-exist :ignore)
-;; delete libnext.a
-(uiop:delete-file-if-exists
- (format nil "~Alibnext.a" (asdf:system-source-directory :next)))
-;; delete Makefile
-(uiop:delete-file-if-exists
- (format nil "~AMakefile" (asdf:system-source-directory :next)))
-
-;;;; Prompt the User to Bundle Dependencies ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-(format *query-io* "[0] Quit [1] Bundle OSX Dependencies: ")
-(force-output *query-io*)
-(let ((input (read-line *query-io*)))
- (cond ((equalp input "0") )
- ((equalp input "1")
- (progn
- (ext:run-program
- "dylibbundler"
- '("-cd"
- "-b"
- "-x"
- "./next.app/Contents/MacOS/next"
- "-d"
- "./next.app/Contents/libs") :input t :output t)
-
- (ext:run-program
- "macdeployqt"
- '("./next.app/"
- "-libpath=/usr/local/lib") :output t)
-
- (ext:run-program
- "install_name_tool"
- '("-change"
- "@libdir@/libecl.16.1.dylib"
- "@executable_path/../libs/libecl.16.1.dylib"
- "./next.app/Contents/MacOS/next") :output t)))))
-
-(qquit)
+(push "./" asdf:*central-registry*)
+(ql:quickload "next" :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)