libgit2 / objective-git

Objective-C bindings to libgit2
MIT License
1.16k stars 280 forks source link

Distributed Mac binary (via Carthage) depends on Homebrew’d openssl #667

Open mxcl opened 5 years ago

mxcl commented 5 years ago
$ otool -L ObjectiveGit.framework/ObjectiveGit 
ObjectiveGit:
    @rpath/ObjectiveGit.framework/ObjectiveGit (compatibility version 1.0.0, current version 1.0.0)
    /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
    /usr/local/opt/openssl/lib/libssl.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
    /usr/lib/libcurl.4.dylib (compatibility version 7.0.0, current version 9.0.0)
    /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
    /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
    /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 22.0.0)
    /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1452.23.0)
    /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.50.4)
    /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1452.23.0)

Key lines being these:

/usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/local/opt/openssl/lib/libssl.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)

This makes it hard to distribute a binary on Mac that uses ObjectiveGit.

I realize this is probably a deep seated distribution problem, I'm willing to put in the time to fix it, but need guidance and encouragement. Thanks.

tiennou commented 5 years ago

Hey, another GitX fork, which stumbled on the exact same problem I did just a few days ago 😉.

@mxcl Can you give a try to the PR just above, just so I have another pair of eyes ?

mxcl commented 5 years ago

Great! I’ll do it. Will let you know.

mxcl commented 5 years ago

This didn't work for my GitX installation since it runs in the ObjectiveGit.framework build and at that point there is no bundle to copy the dylibs to.

tiennou commented 5 years ago

I've just checked my GitX by moving the submodule against that, and I can confirm its included ObjectiveGit.framework is correct, and it runs.

mxcl commented 5 years ago

K right I see how it can work. I built with Carthage on CLI. So that is no good yeah. But if you build as source from the GitX project it makes sense that it would work.