File: make-image.lisp.in

package info (click to toggle)
stumpwm 2:1.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 1,216 kB
  • sloc: lisp: 13,721; makefile: 180; sh: 30
file content (57 lines) | stat: -rw-r--r-- 2,541 bytes parent folder | download
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
(in-package #:cl-user)

(load "load-stumpwm.lisp")

#-ecl (stumpwm:set-module-dir "@MODULE_DIR@")

(when (uiop:version<= "3.1.5" (asdf:asdf-version))
  ;; We register StumpWM and its dependencies as immutable, to stop ASDF from
  ;; looking for their source code when loading modules.
  (uiop:symbol-call '#:asdf '#:register-immutable-system :stumpwm)
  (dolist (system-name (asdf:system-depends-on (asdf:find-system :stumpwm)))
    (uiop:symbol-call '#:asdf '#:register-immutable-system system-name)))

#+sbcl
(sb-ext:save-lisp-and-die "stumpwm" :toplevel (lambda ()
                                                ;; asdf requires sbcl_home to be set, so set it to the value when the image was built
                                                (sb-posix:putenv (format nil "SBCL_HOME=~A" #.(sb-ext:posix-getenv "SBCL_HOME")))
                                                (stumpwm:stumpwm)
                                                0)
                                    :executable t
                                    :purify t)

#+clisp
(ext:saveinitmem "stumpwm" :init-function (lambda ()
                                            (stumpwm:stumpwm)
                                            (ext:quit))
                 :executable t :keep-global-handlers t :norc t :documentation "The StumpWM Executable")

#+ccl
(ccl:save-application "stumpwm" :prepend-kernel t :toplevel-function #'stumpwm:stumpwm)

#+ecl
(asdf:make-build 'stumpwm :type :program :monolithic t
                 :move-here "."
                 :name-suffix ""
                 :epilogue-code '(progn
                                  (stumpwm:set-module-dir "@MODULE_DIR@")
                                  (stumpwm:stumpwm)))

;;; if you want to save an image
#+(and lispworks (not lispworks-personal-edition))
(hcl:save-image "stumpwm"
                :multiprocessing t
                :environment nil
                :load-init-files t
                :restart-function (compile nil
                                           #'(lambda ()
                                               (stumpwm:stumpwm)
                                               (lw:quit :status 0))))
;;; if you want to save a standalone executable
#+(and nil lispworks (not lispworks-personal-edition))
(lw:deliver #'stumpwm:stumpwm "stumpwm" 0
            :interface nil
            :multiprocessing t
            :keep-pretty-printer t)
#+(and lispworks lispworks-personal-edition)
(warn "StumpWM can be saved as an image only in LispWorks Pro/Enterprise editions.")