Changeset 11542


Ignore:
Timestamp:
Dec 17, 2008, 9:14:09 PM (11 years ago)
Author:
gb
Message:

When creating a standalone application bundle (or rather when
*COCOA-APPLICATION-INSTALL-ALTCONSOLE* is true), try to ensure that
ccl:cocoa-ide;altconsole;AltConsole.app is up-to-date and copy it
into the application bundle's Resources directory if so.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/cocoa-ide/ide-bundle.lisp

    r7804 r11542  
    1313                                           (source-ignore '(".svn" "cvs" ".cvsignore"))
    1414                                           (copy-headers *cocoa-application-copy-headers-p*)
     15                                           (install-altconsole *cocoa-application-install-altconsole*)
    1516                                           (if-exists :overwrite))
    1617  ;; TODO: Right now if the bundle exists, we leave alone any files that we don't replace.
     
    4142                                                               (cons "Resources" subdirs)))))
    4243          (recursive-copy-directory ccl-headers dest-headers :if-exists if-exists :test #'ignore-test)))
     44      (when install-altconsole
     45        (install-altconsole bundle-path))
    4346      ;; Is this necessary?
     47      ;; At one point in the past, it was necessary for the bundle to
     48      ;; contain an executable file whose name matched what was specified
     49      ;; in its Info.plist file.  That executable file could be practically
     50      ;; anything, as long as its executable bits were set.
    4451      (let* ((image-name (ccl::standard-kernel-name))
    4552             (ccl-image (make-pathname :name image-name :host "ccl"))
     
    5057      (ccl::touch target-dir))))
    5158
     59;;; This runs "make install" to generate
     60;;; "ccl:cocoa-ide;altconsole;AltConsole.app",
     61;;; then copies that application bundle into the "Resources" directory
     62;;; of the target bundle.  It might be simpler to just have "make install"
     63;;; put things in the right place, but "the right place" is likely to
     64;;; be a pathname that contains a space. Quoting such a pathname -
     65;;; and figuring out how to get make to do so - is left as an exercise.
     66(defun install-altconsole (bundle-path)
     67  (let* ((altconsole-path (merge-pathnames ";Contents;Resources;AltConsole.app;" bundle-path))
     68         (build-directory "ccl:cocoa-ide;altconsole;")
     69         (build-bundle-path "ccl:cocoa-ide;altconsole;AltConsole.app")
     70         (make-output (make-string-output-stream))
     71         (args `("-C" ,(native-translated-namestring build-directory) "install")))
     72    (recursive-delete-directory altconsole-path :if-does-not-exist nil)
     73    (unwind-protect
     74         (multiple-value-bind (exit-status code)
     75             (external-process-status
     76              (run-program "make" args :output make-output :error make-output))
     77           (unless (and (eq exit-status :exited) (zerop code))
     78             (format t "~&'make install' of AltConsole.app failed:~&~a"
     79                     (get-output-stream-string make-output))
     80             (return-from install-altconsole nil)))
     81      (close make-output))
     82    ;;(ensure-directories-exist altconsole-path)
     83    (recursive-copy-directory build-bundle-path altconsole-path)
     84    (ccl::touch altconsole-path)
     85    t))
     86
    5287(progn
    5388  (require "FAKE-CFBUNDLE-PATH")
Note: See TracChangeset for help on using the changeset viewer.