-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild-darwin-arm64-sdl2.lisp
46 lines (35 loc) · 1.72 KB
/
build-darwin-arm64-sdl2.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
(ql:quickload :lem-sdl2)
(cffi:close-foreign-library 'async-process::async-process)
(cffi:close-foreign-library 'sdl2::libsdl2)
(cffi:close-foreign-library 'sdl2-ttf::libsdl2-ttf)
(cffi:close-foreign-library 'sdl2-image::libsdl2-image)
#+(or)
(defun p (x)
(with-open-file (out "~/lem.log"
:direction :output
:if-exists :append
:if-does-not-exist :create)
(uiop:println x out)))
#+(or)
(defun depends-libs ()
(loop :for lib :in (cffi:list-foreign-libraries)
:for lib-pathname := (cffi:foreign-library-pathname lib)
:unless (uiop:string-prefix-p "/System" (namestring lib-pathname))
:collect lib-pathname))
(defun setup-foreign-library-directories ()
;; (p "setup-foreign-library-directories")
;; (setf (uiop:getenv "DYLD_FALLBACK_LIBRARY_PATH") (format nil "/usr/local/lib:/usr/lib:~A" (namestring (lem:lem-relative-pathname "../Frameworks/"))))
;; (setf (uiop:getenv "DYLD_LIBRARY_PATH") (namestring (lem:lem-relative-pathname "../Frameworks/")))
(uiop:chdir (user-homedir-pathname))
(setf cffi:*foreign-library-directories* '())
(setf lem-sdl2/resource::*resource-directory*
(lem:lem-relative-pathname "../Resources/"))
(dolist (file (uiop:directory-files (lem:lem-relative-pathname "../Frameworks/")))
(cffi:load-foreign-library file)))
(lem:copy-file-or-directory (asdf:system-relative-pathname :lem-sdl2 "resources/")
"darwin/arm64/lem.app/Contents/Resources/resources/")
(load "general.lisp")
(sb-ext:save-lisp-and-die "darwin/arm64/lem.app/Contents/MacOS/lem"
:toplevel 'launch
:executable t
:compression nil)