From fb9b3941bae3ad449aae3547e3993da18c197c76 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Mon, 14 Apr 2014 11:18:20 -0400 Subject: [PATCH 1/6] =?UTF-8?q?Add=20brew=E2=80=99s=20keg-only=20openssl?= =?UTF-8?q?=20to=20the=20search=20paths.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ObjectiveGitFramework.xcodeproj/project.pbxproj | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ObjectiveGitFramework.xcodeproj/project.pbxproj b/ObjectiveGitFramework.xcodeproj/project.pbxproj index e49f1dff0..e6b1f1aee 100644 --- a/ObjectiveGitFramework.xcodeproj/project.pbxproj +++ b/ObjectiveGitFramework.xcodeproj/project.pbxproj @@ -1505,6 +1505,10 @@ FRAMEWORK_VERSION = A; GCC_PREFIX_HEADER = ObjectiveGitFramework_Prefix.pch; INFOPLIST_FILE = Info.plist; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + /usr/local/Cellar/openssl/1.0.1g/lib/, + ); OTHER_LDFLAGS = ( "-lgit2", "-force_load", @@ -1526,6 +1530,10 @@ FRAMEWORK_VERSION = A; GCC_PREFIX_HEADER = ObjectiveGitFramework_Prefix.pch; INFOPLIST_FILE = Info.plist; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + /usr/local/Cellar/openssl/1.0.1g/lib/, + ); OTHER_LDFLAGS = ( "-lgit2", "-force_load", @@ -1704,6 +1712,10 @@ FRAMEWORK_VERSION = A; GCC_PREFIX_HEADER = ObjectiveGitFramework_Prefix.pch; INFOPLIST_FILE = Info.plist; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + /usr/local/Cellar/openssl/1.0.1g/lib/, + ); OTHER_LDFLAGS = ( "-lgit2", "-force_load", From e9fd990faad27d60074c4f6a4a06dc0cf32db19b Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Mon, 14 Apr 2014 11:18:50 -0400 Subject: [PATCH 2/6] Attempt to link with the brewed libssl/libcrypto. --- ObjectiveGitFramework.xcodeproj/project.pbxproj | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ObjectiveGitFramework.xcodeproj/project.pbxproj b/ObjectiveGitFramework.xcodeproj/project.pbxproj index e6b1f1aee..24e9f8276 100644 --- a/ObjectiveGitFramework.xcodeproj/project.pbxproj +++ b/ObjectiveGitFramework.xcodeproj/project.pbxproj @@ -208,8 +208,6 @@ 88746CC517FA1C950005888A /* GTRepository+Committing.h in Headers */ = {isa = PBXBuildFile; fileRef = 88746CC217FA1C950005888A /* GTRepository+Committing.h */; settings = {ATTRIBUTES = (Public, ); }; }; 88746CC617FA1C950005888A /* GTRepository+Committing.m in Sources */ = {isa = PBXBuildFile; fileRef = 88746CC317FA1C950005888A /* GTRepository+Committing.m */; }; 88746CC717FA1C950005888A /* GTRepository+Committing.m in Sources */ = {isa = PBXBuildFile; fileRef = 88746CC317FA1C950005888A /* GTRepository+Committing.m */; }; - 887DAFFC15CB1CBD00F30D0D /* libcrypto.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 887DAFFB15CB1CBD00F30D0D /* libcrypto.dylib */; }; - 887DAFFD15CB1CE200F30D0D /* libssl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 887DAFF915CB1C9F00F30D0D /* libssl.dylib */; }; 88948AC91779243600809CDA /* GTObjectDatabaseSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 88948AC81779243600809CDA /* GTObjectDatabaseSpec.m */; }; 88A994BA16FCE7D400402C7B /* GTBranchSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 88A994B916FCE7D400402C7B /* GTBranchSpec.m */; }; 88A994CB16FCED1D00402C7B /* GTTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = 88A994CA16FCED1D00402C7B /* GTTestCase.m */; }; @@ -579,8 +577,6 @@ buildActionMask = 2147483647; files = ( 4D103ADD1819CFAA0029DB24 /* libiconv.dylib in Frameworks */, - 887DAFFD15CB1CE200F30D0D /* libssl.dylib in Frameworks */, - 887DAFFC15CB1CBD00F30D0D /* libcrypto.dylib in Frameworks */, 8DC2EF570486A6940098B216 /* Cocoa.framework in Frameworks */, 8803DA871313145700E6E818 /* libz.dylib in Frameworks */, ); @@ -1514,6 +1510,8 @@ "-force_load", External/libgit2.a, /usr/local/lib/libssh2.a, + "-lcrypto", + "-lssl", ); PRODUCT_NAME = ObjectiveGit; USER_HEADER_SEARCH_PATHS = ""; @@ -1539,6 +1537,8 @@ "-force_load", External/libgit2.a, /usr/local/lib/libssh2.a, + "-lcrypto", + "-lssl", ); PRODUCT_NAME = ObjectiveGit; USER_HEADER_SEARCH_PATHS = ""; @@ -1721,6 +1721,8 @@ "-force_load", External/libgit2.a, /usr/local/lib/libssh2.a, + "-lcrypto", + "-lssl", ); PRODUCT_NAME = ObjectiveGit; USER_HEADER_SEARCH_PATHS = ""; From e0f925ed9890179fadc21d05d541af8608d85909 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Mon, 14 Apr 2014 13:48:15 -0400 Subject: [PATCH 3/6] Use the correct search path for brewed openssl. --- ObjectiveGitFramework.xcodeproj/project.pbxproj | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ObjectiveGitFramework.xcodeproj/project.pbxproj b/ObjectiveGitFramework.xcodeproj/project.pbxproj index 24e9f8276..c5ec039ad 100644 --- a/ObjectiveGitFramework.xcodeproj/project.pbxproj +++ b/ObjectiveGitFramework.xcodeproj/project.pbxproj @@ -1503,7 +1503,7 @@ INFOPLIST_FILE = Info.plist; LIBRARY_SEARCH_PATHS = ( "$(inherited)", - /usr/local/Cellar/openssl/1.0.1g/lib/, + /usr/local/opt/openssl/lib/, ); OTHER_LDFLAGS = ( "-lgit2", @@ -1530,7 +1530,7 @@ INFOPLIST_FILE = Info.plist; LIBRARY_SEARCH_PATHS = ( "$(inherited)", - /usr/local/Cellar/openssl/1.0.1g/lib/, + /usr/local/opt/openssl/lib/, ); OTHER_LDFLAGS = ( "-lgit2", @@ -1714,7 +1714,7 @@ INFOPLIST_FILE = Info.plist; LIBRARY_SEARCH_PATHS = ( "$(inherited)", - /usr/local/Cellar/openssl/1.0.1g/lib/, + /usr/local/opt/openssl/lib/, ); OTHER_LDFLAGS = ( "-lgit2", From e11f861d7bb637c19f915e68dc38a37a5cbf2a15 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Mon, 14 Apr 2014 14:03:15 -0400 Subject: [PATCH 4/6] =?UTF-8?q?Don=E2=80=99t=20change=20search=20paths.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ObjectiveGitFramework.xcodeproj/project.pbxproj | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/ObjectiveGitFramework.xcodeproj/project.pbxproj b/ObjectiveGitFramework.xcodeproj/project.pbxproj index c5ec039ad..0cad18050 100644 --- a/ObjectiveGitFramework.xcodeproj/project.pbxproj +++ b/ObjectiveGitFramework.xcodeproj/project.pbxproj @@ -1501,10 +1501,6 @@ FRAMEWORK_VERSION = A; GCC_PREFIX_HEADER = ObjectiveGitFramework_Prefix.pch; INFOPLIST_FILE = Info.plist; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - /usr/local/opt/openssl/lib/, - ); OTHER_LDFLAGS = ( "-lgit2", "-force_load", @@ -1528,10 +1524,6 @@ FRAMEWORK_VERSION = A; GCC_PREFIX_HEADER = ObjectiveGitFramework_Prefix.pch; INFOPLIST_FILE = Info.plist; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - /usr/local/opt/openssl/lib/, - ); OTHER_LDFLAGS = ( "-lgit2", "-force_load", @@ -1712,10 +1704,6 @@ FRAMEWORK_VERSION = A; GCC_PREFIX_HEADER = ObjectiveGitFramework_Prefix.pch; INFOPLIST_FILE = Info.plist; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - /usr/local/opt/openssl/lib/, - ); OTHER_LDFLAGS = ( "-lgit2", "-force_load", From 2f5f8f1fa5953a7becde28b1d5481d66efc47090 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Mon, 14 Apr 2014 14:03:22 -0400 Subject: [PATCH 5/6] =?UTF-8?q?Don=E2=80=99t=20include=20the=20old=20dylib?= =?UTF-8?q?s.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ObjectiveGitFramework.xcodeproj/project.pbxproj | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ObjectiveGitFramework.xcodeproj/project.pbxproj b/ObjectiveGitFramework.xcodeproj/project.pbxproj index 0cad18050..77c30a317 100644 --- a/ObjectiveGitFramework.xcodeproj/project.pbxproj +++ b/ObjectiveGitFramework.xcodeproj/project.pbxproj @@ -445,8 +445,6 @@ 88746CC217FA1C950005888A /* GTRepository+Committing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "GTRepository+Committing.h"; sourceTree = ""; }; 88746CC317FA1C950005888A /* GTRepository+Committing.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "GTRepository+Committing.m"; sourceTree = ""; }; 887DAFF615CB1C8000F30D0D /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; }; - 887DAFF915CB1C9F00F30D0D /* libssl.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libssl.dylib; path = usr/lib/libssl.dylib; sourceTree = SDKROOT; }; - 887DAFFB15CB1CBD00F30D0D /* libcrypto.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcrypto.dylib; path = usr/lib/libcrypto.dylib; sourceTree = SDKROOT; }; 88948AC81779243600809CDA /* GTObjectDatabaseSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GTObjectDatabaseSpec.m; sourceTree = ""; }; 88A994B916FCE7D400402C7B /* GTBranchSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GTBranchSpec.m; sourceTree = ""; }; 88A994C916FCED1D00402C7B /* GTTestCase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GTTestCase.h; sourceTree = ""; }; @@ -639,8 +637,6 @@ children = ( 4D103ADC1819CFAA0029DB24 /* libiconv.dylib */, 188DC01817FC1571007350CD /* libz.dylib */, - 887DAFF915CB1C9F00F30D0D /* libssl.dylib */, - 887DAFFB15CB1CBD00F30D0D /* libcrypto.dylib */, 8803DA861313145700E6E818 /* libz.dylib */, 04DB4671133AB5FE00D9C624 /* libz.dylib */, 6A1F2FD317C6A8F3003DFADE /* libcrypto.a */, From 2614e4cf1ccb8b9d9bb4a5176ab599a71fc24bf7 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Mon, 14 Apr 2014 14:05:39 -0400 Subject: [PATCH 6/6] Symlinks to brewed libcrypto.a & libssl.a. When these symlinks are unable to be resolved, the linker just skips past them on to the next entry in the search paths. Thus, this should work fine for system dylibs (since the search path entries that would resolve to brewed dylibs have been removed) and for brewed archives. --- External/libcrypto.a | 1 + External/libssl.a | 1 + 2 files changed, 2 insertions(+) create mode 120000 External/libcrypto.a create mode 120000 External/libssl.a diff --git a/External/libcrypto.a b/External/libcrypto.a new file mode 120000 index 000000000..fe603c877 --- /dev/null +++ b/External/libcrypto.a @@ -0,0 +1 @@ +/usr/local/opt/openssl/lib/libcrypto.a \ No newline at end of file diff --git a/External/libssl.a b/External/libssl.a new file mode 120000 index 000000000..e321f3268 --- /dev/null +++ b/External/libssl.a @@ -0,0 +1 @@ +/usr/local/opt/openssl/lib/libssl.a \ No newline at end of file