Portable apps
Ryan Schmidt
ryandesign at macports.org
Thu Jan 11 16:38:32 UTC 2018
On Jan 11, 2018, at 10:23, Michael wrote:
> On 2018-01-11, at 4:37 AM, Ryan Schmidt wrote:
>
>> openssl provides libssl.1.0.0.dylib. The absolute path /opt/local/lib/libssl.1.0.0.dylib is baked into the lynx executable as a library that it needs in order to run. This is not special to lynx or openssl; this is how programs and libraries work on macOS.
>
> How is it possible then to make a binary that can be distributed without that binary being dependent on specific machine configurations?
To make a redistributable app, copy all the libraries into the application bundle, and use install_name_tool to change all their install_names and inter-library linkages to use a relative instead of absolute path (e.g. using "@loader_path" or "@rpath"). The dylibbundler program (installable via MacPorts) automates that.
> I'm specifically thinking of OBS. Trying to compile OBS from source code results in an executable that is approximately one tenth the size of the officially distributed one, that is not portable to other people's machines, unless every library is in the exact same spot (Homebrew vs macports, or in one case, one person's ~/lib.).
More information about the macports-users
mailing list