Skip to content

Commit

Permalink
Merge pull request #483 from phatblat/ben/libgit2-build
Browse files Browse the repository at this point in the history
Cleanup libgit2 build
  • Loading branch information
pietbrauer committed Jul 10, 2015
2 parents de7bfed + 20804e8 commit ff51831
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 5 deletions.
4 changes: 4 additions & 0 deletions ObjectiveGitFramework.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@
DD3D9513182A81E1004AF532 /* GTBlame.m in Sources */ = {isa = PBXBuildFile; fileRef = DD3D9511182A81E1004AF532 /* GTBlame.m */; };
DD3D951C182AB25C004AF532 /* GTBlameHunk.h in Headers */ = {isa = PBXBuildFile; fileRef = DD3D951A182AB25C004AF532 /* GTBlameHunk.h */; settings = {ATTRIBUTES = (Public, ); }; };
DD3D951D182AB25C004AF532 /* GTBlameHunk.m in Sources */ = {isa = PBXBuildFile; fileRef = DD3D951B182AB25C004AF532 /* GTBlameHunk.m */; };
F879D8311B4B788F002D5C07 /* Libgit2FeaturesSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = F879D82F1B4B77F4002D5C07 /* Libgit2FeaturesSpec.m */; };
F8E4A2911A170CA6006485A8 /* GTRemotePushSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = F8E4A2901A170CA6006485A8 /* GTRemotePushSpec.m */; };
/* End PBXBuildFile section */

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

Expand Down Expand Up @@ -746,6 +748,7 @@
88234B2518F2FE260039972E /* GTRepositoryResetSpec.m */,
8870390A1975E3F2004118D7 /* GTDiffDeltaSpec.m */,
88E353051982EA6B0051001F /* GTRepositoryAttributesSpec.m */,
F879D82F1B4B77F4002D5C07 /* Libgit2FeaturesSpec.m */,
);
path = ObjectiveGitTests;
sourceTree = "<group>";
Expand Down Expand Up @@ -1273,6 +1276,7 @@
307623AB17C6C8BD00E2CDF1 /* NSArray+StringArraySpec.m in Sources */,
8832811F173D8816006D7DCF /* GTIndexSpec.m in Sources */,
D0F4E28A17C7F24200BBDE30 /* NSErrorGitSpec.m in Sources */,
F879D8311B4B788F002D5C07 /* Libgit2FeaturesSpec.m in Sources */,
88328128173D8A64006D7DCF /* GTTreeSpec.m in Sources */,
88E353061982EA6B0051001F /* GTRepositoryAttributesSpec.m in Sources */,
88234B2618F2FE260039972E /* GTRepositoryResetSpec.m in Sources */,
Expand Down
39 changes: 39 additions & 0 deletions ObjectiveGitTests/Libgit2FeaturesSpec.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
//
// Libgit2FeaturesSpec.m
// ObjectiveGitFramework
//
// Created by Ben Chatelain on 7/6/15.
// Copyright (c) 2015 GitHub, Inc. All rights reserved.
//

#import <Nimble/Nimble.h>
#import <ObjectiveGit/ObjectiveGit.h>
#import <Quick/Quick.h>

#import "QuickSpec+GTFixtures.h"

QuickSpecBegin(Libgit2FeaturesSpec)

describe(@"libgit", ^{

__block git_feature_t git_features = 0;

beforeEach(^{
git_features = git_libgit2_features();
});

it(@"should be built with THREADS enabled", ^{
expect(@(git_features & GIT_FEATURE_THREADS)).to(beTruthy());
});

it(@"should be built with HTTPS enabled", ^{
expect(@(git_features & GIT_FEATURE_HTTPS)).to(beTruthy());
});

it(@"should be built with SSH enabled", ^{
expect(@(git_features & GIT_FEATURE_SSH)).to(beTruthy());
});

});

QuickSpecEnd
2 changes: 1 addition & 1 deletion script/update_libgit2
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ mkdir build
cd build

cmake -DBUILD_SHARED_LIBS:BOOL=OFF \
-DLIBSSH2_INCLUDE_DIR:PATH=/usr/local/include/ \
-DLIBSSH2_INCLUDE_DIRS:PATH=/usr/local/include/ \
-DBUILD_CLAR:BOOL=OFF \
-DTHREADSAFE:BOOL=ON \
..
Expand Down
6 changes: 2 additions & 4 deletions script/update_libgit2_ios
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,13 @@ function build_libgit2 ()
cmake -DCMAKE_C_COMPILER=clang \
-DCMAKE_C_COMPILER_WORKS:BOOL=ON \
-DBUILD_SHARED_LIBS:BOOL=OFF \
-DOPENSSL_INCLUDE_DIR:PATH=../../External/ios-openssl/include/ \
-DCMAKE_LIBRARY_PATH:PATH=../../External/libssh2-ios/lib/ \
-DLIBSSH2_INCLUDE_DIR:PATH=../../External/libssh2-ios/include/libssh2/ \
-DOPENSSL_SSL_LIBRARY:FILEPATH=../../External/ios-openssl/lib/libssl.a \
-DLIBSSH2_INCLUDE_DIRS:PATH=../../External/libssh2-ios/include/libssh2/ \
-DCMAKE_LIBRARY_PATH:PATH="${SDKROOT}/usr/lib/" \
-DOPENSSL_CRYPTO_LIBRARY:FILEPATH=../../External/ios-openssl/lib/libcrypto.a \
-DCMAKE_INSTALL_PREFIX:PATH="${INSTALL_PREFIX}/" \
-DBUILD_CLAR:BOOL=OFF \
-DTHREADSAFE:BOOL=ON \
-DCURL:BOOL=OFF \
"${SYS_ROOT}" \
-DCMAKE_OSX_ARCHITECTURES:STRING="${ARCH}" \
.. >> "${LOG}" 2>&1
Expand Down

0 comments on commit ff51831

Please sign in to comment.