macdylibbundler/README.md

95 lines
4.0 KiB
Markdown
Raw Permalink Normal View History

mac dylib bundler v2.2
======================
2014-05-29 23:46:44 +00:00
2014-05-30 00:20:09 +00:00
About
-----
**dylibbundler** is a macOS command-line utility for producing relocatable application bundles. External dependencies (dynamic libraries) are copied inside the app bundle, and install names are made run-path-relative. (https://developer.apple.com/library/archive/documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/RunpathDependentLibraries.html)
2014-05-30 00:20:09 +00:00
Installation
------------
In Terminal, from within the macdylibbundler directory:
```bash
mkdir build && cd build
cmake ..
make
```
To install in '/usr/local/bin':
```bash
sudo make install
```
2014-05-30 00:20:09 +00:00
Using dylibbundler
------------------
options:
2014-05-30 00:20:09 +00:00
`-h`, `--help`
<blockquote>
Displays a summary of options
2014-05-30 00:20:09 +00:00
</blockquote>
2019-12-29 18:54:38 +00:00
`-a`, `--app` (path to app bundle)
<blockquote>
Application bundle to make self-contained. Fixes the main executable of the app bundle. Add additional binary files to fix with the `-x` flag.
2019-12-29 18:54:38 +00:00
</blockquote>
2014-05-30 00:20:09 +00:00
`-x`, `--fix-file` (executable or plug-in filepath)
<blockquote>
Executable file or dynamic library (ex: .dylib, .so) to fix. Any file on which `otool -L` works is accepted by `-x`. dylibbundler will walk through the dependencies of the specified file to build a dependency list. It will also fix the said files' dependencies so that it expects to find the libraries relative to itself (e.g. in the app bundle) instead of at an absolute path (e.g. /usr/local/lib). To pass multiple files to fix, simply specify multiple `-x` flags.
2014-05-30 00:20:09 +00:00
</blockquote>
2019-12-30 02:26:24 +00:00
<!--
2014-05-30 00:20:09 +00:00
`-b`, `--bundle-deps`
<blockquote>
Copies libaries to a local directory, fixes their internal name so that they are aware of their new location,
fixes dependencies where bundled libraries depend on each other. If this option is not passed, no libraries will be prepared for distribution.
</blockquote>
2019-12-30 02:26:24 +00:00
-->
2014-05-30 00:20:09 +00:00
2019-12-30 02:26:24 +00:00
`-f`, `--frameworks`
2019-12-16 10:04:52 +00:00
<blockquote>
2019-12-30 02:26:24 +00:00
Copy framework dependencies to app bundle and fix internal names and rpaths. If this option is not passed, dependencies contained in frameworks will be ignored. dylibbundler will also deploy Qt frameworks & plugins, eliminating the need to use `macdeployqt`.
2019-12-16 10:04:52 +00:00
</blockquote>
2014-05-30 00:20:09 +00:00
`-d`, `--dest-dir` (directory)
> Sets the name of the directory in wich distribution-ready dylibs will be placed, relative to `./MyApp.app/Contents`. (Default is `Frameworks`).
2014-05-30 00:23:49 +00:00
2014-05-30 00:20:09 +00:00
`-p`, `--install-path` (libraries install path)
> Sets the "inner" installation path of libraries, usually inside the bundle and relative to executable. (Default is `@executable_path/../Frameworks`, which points to a directory named `Frameworks` inside the `Contents` directory of the bundle.)
2014-05-30 00:23:49 +00:00
2019-12-16 10:04:52 +00:00
*The difference between `-d` and `-p` is that `-d` is the location dylibbundler will put files in, while `-p` is the location where the libraries will be expected to be found when you launch the app (often using @executable_path, @loader_path, or @rpath).*
2014-05-30 00:20:09 +00:00
2019-12-16 10:04:52 +00:00
`-s`, `--search-path` (search path)
> Check for libraries in the specified path.
2014-05-30 00:20:09 +00:00
2019-12-30 02:26:24 +00:00
`-i`, `--ignore` (path)
> Dylibs in (path) will be ignored. By default, dylibbundler will ignore libraries installed in `/usr/lib` & `/System/Library` since they are assumed to be present by default on all macOS installations. *(It is usually recommend not to install additional stuff in `/usr`, always use ` /usr/local` or another prefix to avoid confusion between system libs and libs you added yourself)*
2019-12-30 02:26:24 +00:00
2014-05-30 00:20:09 +00:00
`-of`, `--overwrite-files`
2014-05-30 00:23:49 +00:00
> When copying libraries to the output directory, allow overwriting files when one with the same name already exists.
2014-05-30 00:20:09 +00:00
2019-12-30 02:26:24 +00:00
`-cd`, `--create-dir`
> If the output directory does not exist, create it.
2014-05-30 00:20:09 +00:00
`-od`, `--overwrite-dir`
2014-05-30 00:23:49 +00:00
> If the output directory already exists, completely erase its current content before adding anything to it. (This option implies --create-dir)
2014-05-30 00:20:09 +00:00
2019-12-30 02:26:24 +00:00
`-n`, `--just-print`
> Print the dependencies found (without copying into app bundle).
2014-05-30 00:20:09 +00:00
`-q`, `--quiet`
2019-12-30 02:26:24 +00:00
> Less verbose output.
2019-12-16 10:04:52 +00:00
`-v`, `--verbose`
2019-12-30 02:26:24 +00:00
> More verbose output (only recommended for debugging).
`-V`, `--version`
> Print dylibbundler version number and exit.
2019-12-16 10:04:52 +00:00
2014-05-30 00:20:09 +00:00
A command may look like
2019-12-30 02:26:24 +00:00
`% dylibbundler -cd -of -f -q -a ./HelloWorld.app -x ./HelloWorld.app/Contents/PlugIns/printsupport`