Changeset 12460


Ignore:
Timestamp:
Jul 26, 2009, 12:15:09 PM (10 years ago)
Author:
gb
Message:

When creating an application bundle, optionally copy specified libraries and framework
resources into the bundle's executable directory.

Location:
trunk/source
Files:
4 edited

Legend:

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

    r12277 r12460  
    1818(in-package "CCL")                      ; for now.
    1919
     20#+windows-target
     21(eval-when (:compile-toplevel :load-toplevel :execute)
     22  (pushnew :cocotron *features*))
     23
    2024
    2125(defvar *cocoa-application-path*
     
    2832    (declare (ignore os))
    2933    (format nil "Clozure CL-~a~a" (string-downcase cpu) bits)))
     34(defvar *cocoa-application-frameworks* #+cocotron '("ccl:cocotron;Foundation.framework;" "ccl:cocotron;AppKit.framework;") #-cocotron nil)
     35(defvar *cocoa-application-libraries* #+cocotron '("ccl:cocotron;Foundation'.1'.0'.dll" "ccl:cocotron;AppKit'.1'.0'.dll" #-cocotron nil)
     36       
    3037(defvar *cocoa-ide-force-compile* nil)
    3138(load "ccl:cocoa-ide;defsystem.lisp")
  • trunk/source/cocoa-ide/cocoa.lisp

    r12277 r12460  
    11(in-package "CCL")
     2
     3#+windows-target
     4(eval-when (:compile-toplevel :load-toplevel :execute)
     5  (pushnew :cocotron *features*))
    26
    37(defvar *cocoa-application-path* #+gz "ccl:GZ temp bundle.app;" #-gz
     
    1216    (format nil "temp bundle-~a~a" (string-downcase cpu) bits)))
    1317(defvar *cocoa-ide-force-compile* nil)
     18(defvar *cocoa-application-frameworks* #+cocotron '("ccl:cocotron;Foundation.framework;" "ccl:cocotron;AppKit.framework;") #-cocotron nil)
     19(defvar *cocoa-application-libraries* ())
    1420
    1521(load "ccl:cocoa-ide;defsystem.lisp")
  • trunk/source/cocoa-ide/ide-bundle.lisp

    r12178 r12460  
    5353             (ccl-image (make-pathname :name image-name :host "ccl"))
    5454             (dest-image (make-pathname :name image-name
    55                                         :defaults (subdir contents-dir "MacOS"))))
     55                                        :defaults (subdir contents-dir #+darwin-target "MacOS" #+windows-target "Windows"))))
    5656        (ensure-directories-exist dest-image)
    5757        #+no
     
    5959        (ccl::touch dest-image)
    6060        )
     61      #-windows-target
    6162      (ccl::touch target-dir))))
    6263
     
    9293  (require "FAKE-CFBUNDLE-PATH")
    9394  (create-ide-bundle *cocoa-application-path*)
    94   (ccl::fake-cfbundle-path *cocoa-application-path* "ccl:cocoa-ide;Info.plist-proto" "com.clozure" *cocoa-application-bundle-suffix*))
     95  (ccl::fake-cfbundle-path *cocoa-application-path* "ccl:cocoa-ide;Info.plist-proto" "com.clozure" *cocoa-application-bundle-suffix* *cocoa-application-frameworks* *cocoa-application-libraries*))
  • trunk/source/objc-bridge/fake-cfbundle-path.lisp

    r12173 r12460  
    1111;;; before the CoreFoundation library's initialized.
    1212
    13 (defun fake-cfbundle-path (bundle-root info-plist-proto-path bundle-prefix &optional bundle-suffix)
     13(defun fake-cfbundle-path (bundle-root info-plist-proto-path bundle-prefix  bundle-suffix install-frameworks install-libraries)
    1414  (let* ((kernel-name (standard-kernel-name))
    1515         (translated-root (translate-logical-pathname bundle-root))
     
    3131                    ("OPENMCL-IDENTIFIER" . ,bundle-id)
    3232                    ("OPENMCL-VERSION" . ,bundle-version)))
    33          (executable-path (merge-pathnames
    34                            (make-pathname :directory "Contents/MacOS/"
    35                                           :name kernel-name)
    36                            translated-root)))
     33         (executable-dir (merge-pathnames
     34                           (make-pathname :directory (format nil "Contents/~a/"
     35                                                             #+windows-target
     36                                                             "Windows"
     37                                                             #+darwin-target
     38                                                             "MacOS"
     39                                                             #-(or windows-target darwin-target) "Unknown"))
     40                           translated-root))
     41         (executable-path (merge-pathnames executable-dir (make-pathname :name kernel-name :defaults nil))))
    3742    (unless (probe-file info-plist-proto-path)
    3843      (error "Can't find Info.plist prototype in ~s" info-plist-proto-path))
     
    6065                                   (subseq line (+ pos (length (car needle)))))))))
    6166          (write-line line out))))
     67   
    6268    (touch executable-path)
     69    (dolist (lib install-libraries)
     70      (copy-file lib executable-dir :preserve-attributes t))
     71    (when install-frameworks
     72      (flet ((subdir (framework target)
     73               (ensure-directory-pathname (make-pathname :name (car (last (pathname-directory framework))) :defaults target))))
     74        (dolist (framework install-frameworks)
     75          (recursive-copy-directory framework (subdir framework executable-dir) :if-exists :overwrite))))
    6376    (setenv "CFProcessPath" (native-translated-namestring executable-path))))
Note: See TracChangeset for help on using the changeset viewer.