From 2a2761d354a443132d9396114747bafac946fc84 Mon Sep 17 00:00:00 2001 From: Romain Muller Date: Wed, 18 May 2011 13:04:48 +0200 Subject: [PATCH 1/6] Updates submodule to point to GitHub repository of LibGit2 Updated submodule to libGit 0.12 --- .gitmodules | 2 +- libgit2 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 6794840..2be1c54 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "libgit2"] path = libgit2 - url = git://repo.or.cz/libgit2.git \ No newline at end of file + url = git://github.com/libgit2/libgit2.git \ No newline at end of file diff --git a/libgit2 b/libgit2 index 998a7bf..4077454 160000 --- a/libgit2 +++ b/libgit2 @@ -1 +1 @@ -Subproject commit 998a7bf824c5faca0f9766c9b89bb73ec1315272 +Subproject commit 40774549e14e2d9f24b9271173d58b44f82d5254 From 6d8982ab4b4436c8aadf5f6e89a15a4eaf346133 Mon Sep 17 00:00:00 2001 From: Romain Muller Date: Wed, 18 May 2011 14:06:55 +0200 Subject: [PATCH 2/6] Build with WAF outside of source tree. Update headers and search paths with new build logic. --- GitX.xcodeproj/project.pbxproj | 16 +++++++++------- PBGitGrapher.mm | 2 +- PBGitLane.h | 2 +- PBGitSHA.h | 2 +- PBGitSHA.m | 2 +- build_libgit2.sh | 27 ++++++++++++++++++--------- libgit2 | 2 +- 7 files changed, 32 insertions(+), 21 deletions(-) diff --git a/GitX.xcodeproj/project.pbxproj b/GitX.xcodeproj/project.pbxproj index 766c971..d177e2e 100644 --- a/GitX.xcodeproj/project.pbxproj +++ b/GitX.xcodeproj/project.pbxproj @@ -503,7 +503,7 @@ F5B721C30E05CF7E00AF29DC /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = ""; }; F5C007730E731B48007B84B2 /* PBGitRef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitRef.h; sourceTree = ""; }; F5C007740E731B48007B84B2 /* PBGitRef.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitRef.m; sourceTree = ""; }; - F5C580E40EDA250900995434 /* libgit2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libgit2.a; path = libgit2/libgit2.a; sourceTree = ""; }; + F5C580E40EDA250900995434 /* libgit2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libgit2.a; sourceTree = BUILT_PRODUCTS_DIR; }; F5C6F68B0E65FF9300478D97 /* PBGitLane.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitLane.h; sourceTree = ""; }; F5C6F68C0E65FF9300478D97 /* PBGitLane.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PBGitLane.mm; sourceTree = ""; }; F5D2DC850EA401A80034AD24 /* PBGitConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitConfig.h; sourceTree = ""; }; @@ -1616,13 +1616,14 @@ GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = GitX_Prefix.pch; - HEADER_SEARCH_PATHS = libgit2/src; + HEADER_SEARCH_PATHS = libgit2/include; INFOPLIST_FILE = Info.plist; INFOPLIST_OTHER_PREPROCESSOR_FLAGS = "-traditional"; INFOPLIST_PREFIX_HEADER = $PROJECT_TEMP_DIR/revision; INFOPLIST_PREPROCESS = YES; INSTALL_PATH = "$(HOME)/Applications"; - LIBRARY_SEARCH_PATHS = libgit2; + LIBRARY_SEARCH_PATHS = ""; + ONLY_ACTIVE_ARCH = YES; PRODUCT_NAME = GitX; SDKROOT = ""; WRAPPER_EXTENSION = app; @@ -1643,13 +1644,13 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = GitX_Prefix.pch; GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS = ""; - HEADER_SEARCH_PATHS = libgit2/src; + HEADER_SEARCH_PATHS = libgit2/include; INFOPLIST_FILE = Info.plist; INFOPLIST_OTHER_PREPROCESSOR_FLAGS = "-traditional"; INFOPLIST_PREFIX_HEADER = $PROJECT_TEMP_DIR/revision; INFOPLIST_PREPROCESS = YES; INSTALL_PATH = "$(HOME)/Applications"; - LIBRARY_SEARCH_PATHS = libgit2; + LIBRARY_SEARCH_PATHS = ""; PRODUCT_NAME = GitX; SDKROOT = ""; WRAPPER_EXTENSION = app; @@ -1771,7 +1772,8 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h"; INSTALL_PATH = /usr/local/bin; - LIBRARY_SEARCH_PATHS = libgit2; + LIBRARY_SEARCH_PATHS = ""; + ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ( "-framework", Foundation, @@ -1795,7 +1797,7 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h"; INSTALL_PATH = /usr/local/bin; - LIBRARY_SEARCH_PATHS = libgit2; + LIBRARY_SEARCH_PATHS = ""; OTHER_LDFLAGS = ( "-framework", Foundation, diff --git a/PBGitGrapher.mm b/PBGitGrapher.mm index d22ba6c..47d9cfd 100644 --- a/PBGitGrapher.mm +++ b/PBGitGrapher.mm @@ -11,7 +11,7 @@ #import "PBGitLane.h" #import "PBGitGraphLine.h" #import -#import "git/oid.h" +#import using namespace std; diff --git a/PBGitLane.h b/PBGitLane.h index 94b59a2..136e5b3 100644 --- a/PBGitLane.h +++ b/PBGitLane.h @@ -6,7 +6,7 @@ // Copyright 2008 __MyCompanyName__. All rights reserved. // #import -#include "git/oid.h" +#include class PBGitLane { static int s_colorIndex; diff --git a/PBGitSHA.h b/PBGitSHA.h index f222911..15eeeb3 100644 --- a/PBGitSHA.h +++ b/PBGitSHA.h @@ -7,7 +7,7 @@ // #import -#include "git/oid.h" +#include @interface PBGitSHA : NSObject { diff --git a/PBGitSHA.m b/PBGitSHA.m index 1745133..a310040 100644 --- a/PBGitSHA.m +++ b/PBGitSHA.m @@ -7,7 +7,7 @@ // #import "PBGitSHA.h" - +#import @interface PBGitSHA () diff --git a/build_libgit2.sh b/build_libgit2.sh index 20d4c26..c5cd3d3 100755 --- a/build_libgit2.sh +++ b/build_libgit2.sh @@ -9,20 +9,29 @@ # based on: http://log.yeahrightkeller.com/post/270155578/run-script-while-cleaning-in-xcode buildAction () { - echo "Building libgit2..." + echo "Building libgit2..." if [[ -d .git ]] then - if [ "$(which git)" == "" ]; then - echo "git not found" - exit -1 - fi + if [ "$(which git)" == "" ]; then + echo "git not found" + exit -1 + fi git submodule init git submodule sync git submodule update cd libgit2 - rm -f libgit2.a - make CFLAGS="-arch i386 -arch ppc" - ranlib libgit2.a + ./waf --out=$TARGET_TEMP_DIR --prefix=$TARGET_BUILD_DIR configure + if [ $? != 0 ]; then + echo "error: failed to waf configure" + exit -1 + fi + ./waf build-static + if [ $? != 0 ]; then + echo "error: failed to waf build-static" + exit -1 + fi + ranlib $TARGET_TEMP_DIR/static/libgit2.a + cp $TARGET_TEMP_DIR/static/libgit2.a $TARGET_BUILD_DIR else echo "error: Not a git repository." echo "error: clone GitX first so that the libgit2 submodule can be updated" @@ -33,7 +42,7 @@ buildAction () { cleanAction () { echo "Cleaning libgit2..." cd libgit2 - make clean + ./waf clean } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/libgit2 b/libgit2 index 4077454..d1685ac 160000 --- a/libgit2 +++ b/libgit2 @@ -1 +1 @@ -Subproject commit 40774549e14e2d9f24b9271173d58b44f82d5254 +Subproject commit d1685ac7e91c5269cf01f6ab57c2c4705a14e6bc From b3cfd7fd0d9e5f7095e4ce89257dcd71e676ae2b Mon Sep 17 00:00:00 2001 From: Romain Muller Date: Wed, 18 May 2011 17:40:13 +0200 Subject: [PATCH 3/6] Build fat libgit2 --- build_libgit2.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_libgit2.sh b/build_libgit2.sh index c5cd3d3..dfbb003 100755 --- a/build_libgit2.sh +++ b/build_libgit2.sh @@ -20,7 +20,7 @@ buildAction () { git submodule sync git submodule update cd libgit2 - ./waf --out=$TARGET_TEMP_DIR --prefix=$TARGET_BUILD_DIR configure + CFLAGS='-arch i386 -arch x86_64' ./waf --out=$TARGET_TEMP_DIR --prefix=$TARGET_BUILD_DIR configure if [ $? != 0 ]; then echo "error: failed to waf configure" exit -1 From 451335acd3f55234371df54274e5fce3f544049f Mon Sep 17 00:00:00 2001 From: Romain Muller Date: Wed, 18 May 2011 11:43:40 +0200 Subject: [PATCH 4/6] Build fat and use XCode's 32_64 arch specification style. --- GitX.xcodeproj/project.pbxproj | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/GitX.xcodeproj/project.pbxproj b/GitX.xcodeproj/project.pbxproj index d177e2e..92317c4 100644 --- a/GitX.xcodeproj/project.pbxproj +++ b/GitX.xcodeproj/project.pbxproj @@ -1227,6 +1227,7 @@ isa = PBXProject; buildConfigurationList = 26FC0A880875C7B200E6366F /* Build configuration list for PBXProject "GitX" */; compatibilityVersion = "Xcode 3.1"; + developmentRegion = English; hasScannedForEncodings = 1; knownRegions = ( English, @@ -1604,6 +1605,7 @@ 26FC0A850875C7B200E6366F /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; COPY_PHASE_STRIP = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -1634,6 +1636,7 @@ 26FC0A860875C7B200E6366F /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -1696,6 +1699,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_FIX_AND_CONTINUE = YES; @@ -1704,6 +1708,7 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h"; INSTALL_PATH = /usr/local/bin; + ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ( "-framework", Foundation, @@ -1720,6 +1725,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = dwarf; GCC_ENABLE_FIX_AND_CONTINUE = NO; @@ -1744,6 +1750,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; GCC_ENABLE_FIX_AND_CONTINUE = YES; GCC_MODEL_TUNING = G5; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -1764,6 +1771,7 @@ 913D5E4B0E55644600CECEA2 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_FIX_AND_CONTINUE = YES; @@ -1790,6 +1798,7 @@ 913D5E4C0E55644600CECEA2 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_ENABLE_FIX_AND_CONTINUE = NO; @@ -1814,6 +1823,7 @@ D8022B1511DFCE7F003C21F6 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; @@ -1825,6 +1835,7 @@ D8022B1611DFCE7F003C21F6 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_ENABLE_FIX_AND_CONTINUE = NO; @@ -1837,6 +1848,7 @@ F56439F80F792B2100A579C2 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; @@ -1848,6 +1860,7 @@ F56439F90F792B2100A579C2 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_ENABLE_FIX_AND_CONTINUE = NO; From 16c4ef4ae64771d6e6a3f60afcf650e7073264f7 Mon Sep 17 00:00:00 2001 From: Romain Muller Date: Wed, 18 May 2011 18:09:12 +0200 Subject: [PATCH 5/6] Switch to own fork to have wafscript hack. --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 2be1c54..6e08054 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "libgit2"] path = libgit2 - url = git://github.com/libgit2/libgit2.git \ No newline at end of file + url = git://github.com/RomainMuller/libgit2.git \ No newline at end of file From a3175617da2c08904967697bdd3ba4d3826ca5c0 Mon Sep 17 00:00:00 2001 From: Romain Muller Date: Thu, 19 May 2011 09:29:47 +0200 Subject: [PATCH 6/6] Fix missing symbol due to relocation in libgit2. --- PBGitRevList.mm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PBGitRevList.mm b/PBGitRevList.mm index 10dd655..b787e59 100644 --- a/PBGitRevList.mm +++ b/PBGitRevList.mm @@ -17,6 +17,8 @@ #include #include +#include + using namespace std;