-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
LibGit2: build libgit2 with libssh2 support #17391
Changes from all commits
5365943
d1d80e4
c148d43
8ea2a3c
e272e1e
ea3cfb4
ed41e46
f6b1a7d
2f2a715
ff3f12d
442fb0a
90c296d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,4 @@ GMP_VER = 6.1.0 | |
MPFR_VER = 3.1.4 | ||
PATCHELF_VER = 0.9 | ||
VIRTUALENV_VER = 15.0.0 | ||
MBEDTLS_VER = 2.2.1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
eb46efa15014aaec7e574dfdc5921a36 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
20aa4ca35e78873961ad45734db8af36fe600d523a8ef8c77dba66944c7e33efbe239c49f3258e81cf6a7f7b6afa3b867ad62fc1fb507377ad8e9fa2bb629472 |
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
25c40973c9cdcd7919c0b74ca0d06dd1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
eea5e3638395cb5711f97b36adfa05a9c1cb24cf3b5639cb0a20d74855da025c2db2ff3eeb6bf37d49977e2d9fcf2b929e5c5d874c65754c280defaacb9f3eb8 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
77751c0e370ed2ab01934e4c5e1d380f |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
6a74abc4ea225eb6bcf20894bb1a6faa82dbaff11129c41849151e2654570609efeee70d0644ce63c4d2c11e6142b2db262b88f3a22fdceff0a215a64a5d6eb0 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
b6909d94600fc5f644e9bca52e96fb27 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
03c32b46369d35e61acfeac83f417d09307d2f1e4358f9ea6af275d9a9a2319ca7a244733b5950a48d59f6305e4adcad6a66e589b42ee7417d1d4362c2595a4f |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,9 +7,9 @@ $(eval $(call git-external,libgit2,LIBGIT2,CMakeLists.txt,build/libgit2.$(SHLIB_ | |
LIBGIT2_OBJ_SOURCE := $(BUILDDIR)/$(LIBGIT2_SRC_DIR)/libgit2.$(SHLIB_EXT) | ||
LIBGIT2_OBJ_TARGET := $(build_shlibdir)/libgit2.$(SHLIB_EXT) | ||
|
||
LIBGIT2_OPTS := $(CMAKE_COMMON) -DTHREADSAFE=ON | ||
LIBGIT2_OPTS := $(CMAKE_COMMON) -DCMAKE_BUILD_TYPE=Release -DTHREADSAFE=ON | ||
ifeq ($(OS),WINNT) | ||
LIBGIT2_OPTS += -DWIN32=ON -DMINGW=ON -DUSE_SSH=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo | ||
LIBGIT2_OPTS += -DWIN32=ON -DMINGW=ON | ||
ifneq ($(ARCH),x86_64) | ||
LIBGIT2_OPTS += -DCMAKE_C_FLAGS="-mincoming-stack-boundary=2" | ||
endif | ||
|
@@ -20,26 +20,35 @@ LIBGIT2_OPTS += -DBUILD_CLAR=OFF -DDLLTOOL=`which $(CROSS_COMPILE)dlltool` | |
LIBGIT2_OPTS += -DCMAKE_FIND_ROOT_PATH=/usr/$(XC_HOST) -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY | ||
endif | ||
else | ||
LIBGIT2_OPTS += -DCMAKE_BUILD_TYPE=Release | ||
LIBGIT2_OPTS += -DCMAKE_INSTALL_RPATH=$(build_prefix) -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE | ||
endif | ||
|
||
$(BUILDDIR)/$(LIBGIT2_SRC_DIR)/Makefile: $(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)/CMakeLists.txt | ||
$(BUILDDIR)/$(LIBGIT2_SRC_DIR)/Makefile: $(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)/CMakeLists.txt $(LIBSSH2_OBJ_TARGET) | ||
ifeq ($(OS),Linux) | ||
-cd $(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR) && patch -p1 -f < $(SRCDIR)/patches/libgit2-require-openssl.patch | ||
endif | ||
-cd $(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR) && patch -p0 -f < $(SRCDIR)/patches/libgit2-ssh.patch | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I assume this should be edit: or maybe not, but should that patch actually be getting applied? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nope, libgit2-custom-tls.patch is for openssl-less libgit2 build There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. are we doing that here, or should that patch be moved to the other, more WIP PR? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll remove it for now |
||
mkdir -p $(dir $@) | ||
cd $(dir $@) && \ | ||
$(CMAKE) $(dir $<) $(LIBGIT2_OPTS) | ||
touch -c $@ | ||
|
||
$(LIBGIT2_OBJ_SOURCE): $(BUILDDIR)/$(LIBGIT2_SRC_DIR)/Makefile | ||
$(MAKE) -C $(dir $<) | ||
touch -c $@ | ||
|
||
$(BUILDDIR)/$(LIBGIT2_SRC_DIR)/checked: $(LIBGIT2_OBJ_SOURCE) | ||
ifeq ($(OS),$(BUILD_OS)) | ||
$(MAKE) -C $(dir $@) test | ||
endif | ||
echo 1 > $@ | ||
|
||
$(LIBGIT2_OBJ_TARGET): $(LIBGIT2_OBJ_SOURCE) | $(build_shlibdir) | ||
ifeq ($(BUILD_OS),WINNT) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what is needed from make install other than the shared library on linux and mac, and why? if only the dll is needed on windows, should this also apply for cross-compile and therefore be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is an issue with msys staged install (something related to our make-install or cmake - files are copied into wrong folder). Cygwin build doesn't have this issue. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok thanks for confirming - which wrong folder, something like /lib instead of /bin for dll's? one more reason to just drop msys2 support until we actually have a good reason to worry about it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. right, /lib instead of /bin |
||
cp $< $@ | ||
@#$$(call make-install,$(LIBGIT2_SRC_DIR),) # currently don't need the full install | ||
else | ||
$(call make-install,$(LIBGIT2_SRC_DIR),) | ||
endif | ||
ifeq ($(OS),Linux) | ||
@# If we're on linux, copy over libssl and libcrypto for libgit2 | ||
-LIBGIT_LIBS=$$(ldd "$@" | tail -n +2 | awk '{print $$(NF-1)}'); \ | ||
|
@@ -52,7 +61,7 @@ endif | |
touch -c $@ | ||
|
||
clean-libgit2: | ||
-rm -rf $(BUILDDIR)/$(LIBGIT2_SRC_DIR) | ||
-$(MAKE) -C $(BUILDDIR)/$(LIBGIT2_SRC_DIR) clean | ||
-rm -f $(LIBGIT2_OBJ_TARGET) | ||
|
||
get-libgit2: $(LIBGIT2_SRC_FILE) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
LIBGIT2_BRANCH=v0.24.0 | ||
LIBGIT2_SHA1=785d8c48ea8725691da3c50e7dae8751523d4c30 | ||
LIBGIT2_BRANCH=v0.24.1 | ||
LIBGIT2_SHA1=211e117a0590583a720c53172406f34186c543bd |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
## libssh2 | ||
|
||
LIBSSH2_GIT_URL := git://github.com/libssh2/libssh2.git | ||
LIBSSH2_TAR_URL = https://api.github.com/repos/libssh2/libssh2/tarball/$1 | ||
$(eval $(call git-external,libssh2,LIBSSH2,CMakeLists.txt,build/libssh2.$(SHLIB_EXT),$(SRCDIR)/srccache)) | ||
|
||
LIBSSH2_OBJ_SOURCE := $(BUILDDIR)/$(LIBSSH2_SRC_DIR)/src/libssh2.$(SHLIB_EXT) | ||
LIBSSH2_OBJ_TARGET := $(build_shlibdir)/libssh2.$(SHLIB_EXT) | ||
|
||
LIBSSH2_OPTS := $(CMAKE_COMMON) -DBUILD_SHARED_LIBS=ON -DBUILD_EXAMPLES=OFF \ | ||
-DCMAKE_INSTALL_RPATH=$(build_prefix) -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE \ | ||
-DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_LIBDIR=lib | ||
|
||
ifeq ($(OS),WINNT) | ||
LIBSSH2_OPTS += -DCRYPTO_BACKEND=WinCNG -DENABLE_ZLIB_COMPRESSION=OFF | ||
ifeq ($(BUILD_OS),WINNT) | ||
LIBSSH2_OPTS += -G"MSYS Makefiles" | ||
endif | ||
else | ||
LIBSSH2_OPTS += -DCRYPTO_BACKEND=mbedTLS -DENABLE_ZLIB_COMPRESSION=ON | ||
endif | ||
|
||
$(BUILDDIR)/$(LIBSSH2_SRC_DIR)/Makefile: $(SRCDIR)/srccache/$(LIBSSH2_SRC_DIR)/CMakeLists.txt $(MBEDTLS_OBJ_TARGET) | ||
-cd $(SRCDIR)/srccache/$(LIBSSH2_SRC_DIR) && patch -p1 -f < $(SRCDIR)/patches/libssh2-mbedtls.patch | ||
mkdir -p $(dir $@) | ||
cd $(dir $@) && \ | ||
$(CMAKE) $(dir $<) $(LIBSSH2_OPTS) | ||
touch -c $@ | ||
|
||
$(LIBSSH2_OBJ_SOURCE): $(BUILDDIR)/$(LIBSSH2_SRC_DIR)/Makefile | ||
$(MAKE) -C $(dir $<) libssh2 | ||
touch -c $@ | ||
|
||
$(BUILDDIR)/$(LIBSSH2_SRC_DIR)/checked: $(LIBSSH2_OBJ_SOURCE) | ||
ifeq ($(OS),$(BUILD_OS)) | ||
$(MAKE) -C $(dir $@) test | ||
endif | ||
echo 1 > $@ | ||
|
||
$(LIBSSH2_OBJ_TARGET): $(LIBSSH2_OBJ_SOURCE) | $(build_shlibdir) | ||
ifeq ($(BUILD_OS),WINNT) | ||
$(MAKE) -C $(BUILDDIR)/$(LIBSSH2_SRC_DIR) install | ||
else | ||
$(call make-install,$(LIBSSH2_SRC_DIR),) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what does this do differently from the above line? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. winnt - direct install, otherwise staged There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is staged install broken then? in what way? on both cygwin-cross and msys2? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sorry, don't remember There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok. Thanks for being up late on a friday working through this. I'll try using the staged |
||
endif | ||
touch -c $(LIBSSH2_OBJ_TARGET) | ||
|
||
clean-libssh2: | ||
-$(MAKE) -C $(BUILDDIR)/$(LIBSSH2_SRC_DIR) clean | ||
-rm -f $(LIBSSH2_OBJ_TARGET) | ||
|
||
get-libssh2: $(LIBSSH2_SRC_FILE) | ||
configure-libssh2: $(BUILDDIR)/$(LIBSSH2_SRC_DIR)/Makefile | ||
compile-libssh2: $(LIBSSH2_OBJ_SOURCE) | ||
check-libssh2: $(BUILDDIR)/$(LIBSSH2_SRC_DIR)/checked | ||
install-libssh2: $(LIBSSH2_OBJ_TARGET) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
LIBSSH2_BRANCH=libssh2-1.7.0 | ||
LIBSSH2_SHA1=6d553a7bb94966466c4db0abf9a26660e786a275 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does the homebrew libgit2 get built with or without ssh support?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we going to use our
libssh2
based on mbedTLS cryptolib, so it is necessary to rebuildlibgit2
as wellThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah that makes sense, but we might want to do so in homebrew-juliadeps to save the travis build time of recompiling all 3 libraries from source on every build