auriamg / macdylibbundler

Utility to ease bundling libraries into executables for OSX
MIT License
550 stars 83 forks source link

Link with unversioned dylibs #26

Open jngd opened 6 years ago

jngd commented 6 years ago

Is there any way to use macdylibbundler with unversioned dylibs? I'm using it along with macdeployqt and the last one use unversioned dylibs whereas that macdylibbundler use dylibs verioned.

Any clue about?

auriamg commented 6 years ago

Hi, I'm actually not sure what you called an "unversioned" dylib? That is not a concept I am familiar with

jngd commented 6 years ago

Maybe this issue has been opened with a lack of information, sorry for that. I have one app built with Qt that has dependencies with external lib. When I execute macdylibbundler against my app, that is dynamic linked against a lib called foo, installed in my system with brew:

jngds-MacBook-Pro:lib jngd$ ll
total 79656
drwxr-xr-x  39 jngd  admin   1.2K 12 Feb 01:29 .
drwxr-xr-x  11 jngd  admin   352B 20 Feb 16:39 ..
-r--r--r--   1 jngd  admin    12M 20 Feb 16:39 libfoo.1.107.100.dylib
lrwxr-xr-x   1 jngd  admin    27B 12 Feb 01:29 libfoo.1.dylib -> libfoo.1.107.100.dylib
-r--r--r--   1 jngd  admin    15M 12 Feb 01:29 libfoo.a
lrwxr-xr-x   1 jngd  admin    27B 12 Feb 01:29 libfoo.dylib -> libfoo.1.107.100.dylib

macdylibbundler is copying libfoo.1.107.100.dylib in libs directory. As macdylibbundler has not deployed frameworks from Qt, I need to execute macdeployqt tool that is copying libfoo.1.dylib so when application start then crash, because is linking with libfoo.1.dylib that has dependencies without resolve (becuase is not processed by macdylibbundler). If I make otool -L libfoo.1.dylib it has bad references to an external libraries. However, libfoo.1.107.100.dylib has all dependencies resolved correctly. Any way to tell macdylibbundler that copy libfoo.1.dylib instead of libfoo.1.107.100.dylib?

auriamg commented 6 years ago

It seems like libfoo.1.dylib is a symlink to libfoo.1.107.100.dylib, and that confused dylibbundler as it does not reckognise that those 2 files are one and the seem? If that is truly the case then that may require quite a bit of work to fix, and I don't expect I will have time soon to work on that unfortunately, though contributions are welcome