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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.