Distribution.MacOSX
Description
Cabal support for creating Mac OSX application bundles.
GUI applications on Mac OSX should be run as application bundles; these wrap an executable in a particular directory structure which can also carry resources such as icons, program metadata, images, other binaries, and copies of shared libraries.
This module provides a Cabal post-build hook for creating such application bundles, and controlling their contents.
For more information about OSX application bundles, look for the Bundle Programming Guide on the Apple Developer Connection website, http://developer.apple.com/.
- appBundleBuildHook :: [MacApp] -> Args -> BuildFlags -> PackageDescription -> LocalBuildInfo -> IO ()
- appBundleInstallHook :: [MacApp] -> Args -> InstallFlags -> PackageDescription -> LocalBuildInfo -> IO ()
- makeAppBundle :: AppBuildInfo -> IO ()
- data MacApp = MacApp {}
- data ChaseDeps
- type Exclusions = [String]
- defaultExclusions :: Exclusions
Documentation
Arguments
:: [MacApp] | List of applications to build; if empty, an application is built for each executable in the package, with no icon or plist, and no dependency-chasing. |
-> Args | All other parameters as per
|
-> BuildFlags | |
-> PackageDescription | |
-> LocalBuildInfo | |
-> IO () |
Post-build hook for OS X application bundles. Does nothing if called on another O/S.
Arguments
:: [MacApp] | List of applications to build; if empty, an application is built for each executable in the package, with no icon or plist, and no dependency-chasing. |
-> Args | All other parameters as per
|
-> InstallFlags | |
-> PackageDescription | |
-> LocalBuildInfo | |
-> IO () |
Post-install hook for OS X application bundles. Copies the
application bundle (assuming you are also using the appBundleBuildHook)
to $prefix/Applications
Does nothing if called on another O/S.
makeAppBundle :: AppBuildInfo -> IO ()Source
Given a MacApp
in context, make an application bundle in the
build area. (for internal use only)
Mac OSX application information.
Constructors
MacApp | |
Fields
|
Application bundles may carry their own copies of shared libraries, which enables distribution of applications which 'just work, out of the box' in the absence of static linking. For example, a wxHaskell app can include the wx library (and its dependencies, recursively), meaning end users do not need to install wxWidgets in order to use the app.
This data type controls this process: if dependency chasing is
activated, then the app's executable and any otherBins
are
examined for their dependencies, recursively (usually with some
exceptions - see below), the dependencies are copied into the app
bundle, and any references to each library are updated to point to
the copy.
(The process is transparent to the programmer, i.e. requires no
modification to code. In case anyone is interested: otool
is
used to discover a binary's library dependencies; each library is
copied to a relative sub-directory of Contents/Frameworks/
in
the app bundle (e.g. /usr/lib/libFoo.a
becomes
Contents/Frameworks/usr/lib/libFoo.a
); finally,
install_name_tool
is used to update dependency references to
point to the new version.)
Constructors
DoNotChase | Do not include any dependencies - a sensible default if not distributing your app. |
ChaseWithDefaults | Include any libraries which the executable and |
ChaseWith Exclusions | Include any libraries which the executable and |
type Exclusions = [String]Source
A list of exclusions to dependency chasing. Any library whose path contains any exclusion string as a substring will be excluded when chasing dependencies.
defaultExclusions :: ExclusionsSource
Default list of exclusions; excludes OSX standard frameworks, libgcc, etc. - basically things which we would expect to be present on any functioning OSX installation.