Skip to content

Commit ff51831

Browse files
committed
Merge pull request #483 from phatblat/ben/libgit2-build
Cleanup libgit2 build
2 parents de7bfed + 20804e8 commit ff51831

File tree

4 files changed

+46
-5
lines changed

4 files changed

+46
-5
lines changed

ObjectiveGitFramework.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,7 @@
311311
DD3D9513182A81E1004AF532 /* GTBlame.m in Sources */ = {isa = PBXBuildFile; fileRef = DD3D9511182A81E1004AF532 /* GTBlame.m */; };
312312
DD3D951C182AB25C004AF532 /* GTBlameHunk.h in Headers */ = {isa = PBXBuildFile; fileRef = DD3D951A182AB25C004AF532 /* GTBlameHunk.h */; settings = {ATTRIBUTES = (Public, ); }; };
313313
DD3D951D182AB25C004AF532 /* GTBlameHunk.m in Sources */ = {isa = PBXBuildFile; fileRef = DD3D951B182AB25C004AF532 /* GTBlameHunk.m */; };
314+
F879D8311B4B788F002D5C07 /* Libgit2FeaturesSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = F879D82F1B4B77F4002D5C07 /* Libgit2FeaturesSpec.m */; };
314315
F8E4A2911A170CA6006485A8 /* GTRemotePushSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = F8E4A2901A170CA6006485A8 /* GTRemotePushSpec.m */; };
315316
/* End PBXBuildFile section */
316317

@@ -573,6 +574,7 @@
573574
DD3D951B182AB25C004AF532 /* GTBlameHunk.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GTBlameHunk.m; sourceTree = "<group>"; };
574575
E46931A7172740D300F2077D /* update_libgit2 */ = {isa = PBXFileReference; lastKnownFileType = text; name = update_libgit2; path = script/update_libgit2; sourceTree = "<group>"; };
575576
E46931A8172740D300F2077D /* update_libgit2_ios */ = {isa = PBXFileReference; lastKnownFileType = text; name = update_libgit2_ios; path = script/update_libgit2_ios; sourceTree = "<group>"; };
577+
F879D82F1B4B77F4002D5C07 /* Libgit2FeaturesSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Libgit2FeaturesSpec.m; sourceTree = "<group>"; };
576578
F8E4A2901A170CA6006485A8 /* GTRemotePushSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GTRemotePushSpec.m; sourceTree = "<group>"; };
577579
/* End PBXFileReference section */
578580

@@ -746,6 +748,7 @@
746748
88234B2518F2FE260039972E /* GTRepositoryResetSpec.m */,
747749
8870390A1975E3F2004118D7 /* GTDiffDeltaSpec.m */,
748750
88E353051982EA6B0051001F /* GTRepositoryAttributesSpec.m */,
751+
F879D82F1B4B77F4002D5C07 /* Libgit2FeaturesSpec.m */,
749752
);
750753
path = ObjectiveGitTests;
751754
sourceTree = "<group>";
@@ -1273,6 +1276,7 @@
12731276
307623AB17C6C8BD00E2CDF1 /* NSArray+StringArraySpec.m in Sources */,
12741277
8832811F173D8816006D7DCF /* GTIndexSpec.m in Sources */,
12751278
D0F4E28A17C7F24200BBDE30 /* NSErrorGitSpec.m in Sources */,
1279+
F879D8311B4B788F002D5C07 /* Libgit2FeaturesSpec.m in Sources */,
12761280
88328128173D8A64006D7DCF /* GTTreeSpec.m in Sources */,
12771281
88E353061982EA6B0051001F /* GTRepositoryAttributesSpec.m in Sources */,
12781282
88234B2618F2FE260039972E /* GTRepositoryResetSpec.m in Sources */,
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
//
2+
// Libgit2FeaturesSpec.m
3+
// ObjectiveGitFramework
4+
//
5+
// Created by Ben Chatelain on 7/6/15.
6+
// Copyright (c) 2015 GitHub, Inc. All rights reserved.
7+
//
8+
9+
#import <Nimble/Nimble.h>
10+
#import <ObjectiveGit/ObjectiveGit.h>
11+
#import <Quick/Quick.h>
12+
13+
#import "QuickSpec+GTFixtures.h"
14+
15+
QuickSpecBegin(Libgit2FeaturesSpec)
16+
17+
describe(@"libgit", ^{
18+
19+
__block git_feature_t git_features = 0;
20+
21+
beforeEach(^{
22+
git_features = git_libgit2_features();
23+
});
24+
25+
it(@"should be built with THREADS enabled", ^{
26+
expect(@(git_features & GIT_FEATURE_THREADS)).to(beTruthy());
27+
});
28+
29+
it(@"should be built with HTTPS enabled", ^{
30+
expect(@(git_features & GIT_FEATURE_HTTPS)).to(beTruthy());
31+
});
32+
33+
it(@"should be built with SSH enabled", ^{
34+
expect(@(git_features & GIT_FEATURE_SSH)).to(beTruthy());
35+
});
36+
37+
});
38+
39+
QuickSpecEnd

script/update_libgit2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ mkdir build
2323
cd build
2424

2525
cmake -DBUILD_SHARED_LIBS:BOOL=OFF \
26-
-DLIBSSH2_INCLUDE_DIR:PATH=/usr/local/include/ \
26+
-DLIBSSH2_INCLUDE_DIRS:PATH=/usr/local/include/ \
2727
-DBUILD_CLAR:BOOL=OFF \
2828
-DTHREADSAFE:BOOL=ON \
2929
..

script/update_libgit2_ios

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,13 @@ function build_libgit2 ()
4545
cmake -DCMAKE_C_COMPILER=clang \
4646
-DCMAKE_C_COMPILER_WORKS:BOOL=ON \
4747
-DBUILD_SHARED_LIBS:BOOL=OFF \
48-
-DOPENSSL_INCLUDE_DIR:PATH=../../External/ios-openssl/include/ \
4948
-DCMAKE_LIBRARY_PATH:PATH=../../External/libssh2-ios/lib/ \
50-
-DLIBSSH2_INCLUDE_DIR:PATH=../../External/libssh2-ios/include/libssh2/ \
51-
-DOPENSSL_SSL_LIBRARY:FILEPATH=../../External/ios-openssl/lib/libssl.a \
49+
-DLIBSSH2_INCLUDE_DIRS:PATH=../../External/libssh2-ios/include/libssh2/ \
5250
-DCMAKE_LIBRARY_PATH:PATH="${SDKROOT}/usr/lib/" \
53-
-DOPENSSL_CRYPTO_LIBRARY:FILEPATH=../../External/ios-openssl/lib/libcrypto.a \
5451
-DCMAKE_INSTALL_PREFIX:PATH="${INSTALL_PREFIX}/" \
5552
-DBUILD_CLAR:BOOL=OFF \
5653
-DTHREADSAFE:BOOL=ON \
54+
-DCURL:BOOL=OFF \
5755
"${SYS_ROOT}" \
5856
-DCMAKE_OSX_ARCHITECTURES:STRING="${ARCH}" \
5957
.. >> "${LOG}" 2>&1

0 commit comments

Comments
 (0)