Skip to content

Fix libgit2 build scripts #443

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 18, 2015

Conversation

phatblat
Copy link
Member

I had some trouble getting libgit2 to build in 0.5 and 0.6, getting errors about 'libssh2.h' file not found. I wasn't sure if it was my setup (been on Xcode and Yosemite betas a lot lately), but by modifying the update_libgit2 scripts and defining LIBSSH2_INCLUDE_DIR it builds consistently.

Addresses #442

Ben Chatelain added 2 commits February 10, 2015 07:49
Set LIBSSH2_INCLUDE_DIR so that libssh2.h can be found
@@ -22,7 +22,11 @@ fi
mkdir build
cd build

cmake -DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_CLAR:BOOL=OFF -DTHREADSAFE:BOOL=ON ..
cmake -DBUILD_SHARED_LIBS:BOOL=OFF \
-DLIBSSH2_INCLUDE_DIR:PATH=../../External/libssh2-ios/include/libssh2/ \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't be correct for OS X builds, which use the system libssh2 (IIRC).

@jspahrsummers jspahrsummers self-assigned this Feb 16, 2015
@jspahrsummers
Copy link
Contributor

Thanks! The iOS changes definitely look good, but I'm a bit unsure about the OS X path.

@phatblat
Copy link
Member Author

Went ahead and reverted the change to the Mac build script. When I run script/update_libgit2 from the command line it builds fine.

It's only when I build the libgit2 target in Xcode that it fails.

[ 88%] Building C object CMakeFiles/git2.dir/src/transports/smart.c.o
[ 89%] Building C object CMakeFiles/git2.dir/src/transports/smart_pkt.c.o
[ 90%] Building C object CMakeFiles/git2.dir/src/transports/smart_protocol.c.o
[ 91%] Building C object CMakeFiles/git2.dir/src/transports/ssh.c.o
/Users/phatblat/dev/ios/APP_NAME/Carthage/Checkouts/objective-git/External/libgit2/src/transports/ssh.c:9:10: fatal error: 'libssh2.h' file not found
#include <libssh2.h>
         ^
1 error generated.
make[2]: *** [CMakeFiles/git2.dir/src/transports/ssh.c.o] Error 1
make[1]: *** [CMakeFiles/git2.dir/all] Error 2
make: *** [all] Error 2

@pietbrauer
Copy link
Member

For me both (Mac and iOS) built when I checked out @phatblat branch. Just using the iOS changes didn't solve the building issues.

@jspahrsummers
Copy link
Contributor

Sorry, to be clear: I think LIBSSH2_INCLUDE_DIR is important to pass to the Mac target, I just don't think it should point into the iOS build of libssh2.

Can it use /usr/include or /usr/local/include or something?

@phatblat
Copy link
Member Author

/usr/local/include works

LIBSSH2_INCLUDE_DIR = /usr/local/include/
@jspahrsummers
Copy link
Contributor

Awesome, thanks for tackling this! Works great for me. ✨

jspahrsummers added a commit that referenced this pull request Feb 18, 2015
@jspahrsummers jspahrsummers merged commit 5053a93 into libgit2:master Feb 18, 2015
@phatblat phatblat deleted the ben/pr/libgit2-build branch March 1, 2015 04:46
@jspahrsummers jspahrsummers removed their assignment May 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants