This chapter describes several issues relevant to delivery with LispWorks for Macintosh.
The supplied LispWorks (64-bit) for Macintosh image are a universal binaries, which run the correct native architecture on arm64 (Apple silicon) and x86_64 (Intel) Macintosh computers by default. To deliver a universal binary application from LispWorks (64-bit) for Macintosh, you will need an Apple silicon Macintosh computer. You can specify a universal binary build in the Application Builder tool (see 28 The Application Builder in the LispWorks IDE User Guide) or call save-universal-from-script directly (see the LispWorks® User Guide and Reference Manual).
deliver creates a single executable file. However graphical Macintosh applications consist of an application bundle, which is a folder Foo.app
with several subfolders containing the main executable and other resources.
LispWorks for Macintosh contains a function that constructs an application bundle. You can use this such that your executable is delivered ready to run in its application bundle in the usual macOS way. See 13.3 Creating a macOS application bundle for an illustration of this.
Utilities which attempt to "clean up" your Mac by removing unused parts of an image can damage LispWorks itself and also LispWorks applications.
If you use such a utility on your LispWorks development machines, configure it to ignore LispWorks.
If you distribute a LispWorks application, document that it may be damaged by utilities which attempt to clean up a Mac by removing unused parts of an image. To prevent this, such utilities should be configured to ignore the LispWorks application.
As an example, CleanMyMac has an Ignore List which includes LispWorks by default, but will not include your LispWorks runtime application until you add it.
LispWorks for Macintosh is supplied with two images. One supports the Cocoa GUI, the other supports the GTK+ GUI (and can load the Motif GUI). You cannot build a Cocoa application using the GTK+ LispWorks image, and vice versa.
You should use the appropriate image to deliver your application.
For GTK+ and Motif applications delivered with LispWorks for Macintosh, the issues described in 8 Delivery on Linux, FreeBSD and x86/x64 Solaris will be relevant.
A graphical Macintosh application does not usually have a console/terminal window.
You can achieve this by supplying the keyword argument :console :input
when delivering your application.
Output to *terminal-io* from an application without a console/terminal window will not ordinarily be visible to the user, so debugging messages should be written to a log file.
Log files are recommended for any complex application as they make it easier for you to get information back from your users.
You can use dbg:log-bug-form for logging errors. See the LispWorks® User Guide and Reference Manual for details.
To create an association between your LispWorks for Macintosh application and files with a specified type (file extension):
:open-file
message in the message-callback function.Also see the examples mentioned in 15.1 Delivering a Cocoa CAPI application examples.
If your application uses capi:editor-pane or its subclasses, your should consider the input style. The editor in the delivered application can emulate Emacs or macOS style editing. The deliver keyword :editor-style controls which emulation is used.
To implement the standard gestures Command+X
, Command+C
and Command+V
in your CAPI/Cocoa runtime application, you must include an Edit menu explicitly in your capi:interface definition.
Note: The LispWorks IDE adds a minimal Edit menu to all CAPI interfaces automatically, in order to make these standard gestures work in the LispWorks IDE, but this does not persist after delivery.
The application menu's quit callback (that is, the callback normally invoked by Command+Q
) should simply call capi:destroy with the application interface and should not call lw:quit directly.
For an example see the Quit Multiple Window CAPI Application menu item in:
(example-edit-file "capi/applications/cocoa-application")
If you implement an Objective-C class in Lisp but its name is not referenced at run time, then you need to arrange for this symbol to be retained during delivery.
This can be achieved with :keep-symbols, but a more modular approach is to keep the name on the plist of some other symbol. For example the internal CAPI class lw-slider
is defined like this:
(objc:define-objc-class lw-slider () () (:objc-class-name "LWSlider") (:objc-superclass-name "NSSlider"))
and lw-slider
is retained like this:
(setf (get 'slider-representation 'owner-class) 'lw-slider)
In this case, the code for slider-representation
is the only thing that makes the LWSlider object, so it is the best place to retain it (that is, only if slider-representation
is retained).
The default double-click (and triple-click) speed for X11 applications is 200ms, whereas the default for Macintosh applications is typically 500ms.
To match this in your configuration, add a line:
*.multiClickTime: 500
in the Xresources file.
Several self-contained examples in the LispWorks library illustrate delivering a CAPI/Cocoa application, listed in 15 Self-contained examples of delivery.
Delivery User Guide - 01 Dec 2021 19:35:04