Skip to content

Commit 12f02da

Browse files
authored
Merge pull request #18658 from JuliaLang/tk/libgit2-mbedtls
Use mbedtls instead of openssl in libgit2 on Linux
2 parents 39f48a3 + f241e23 commit 12f02da

File tree

6 files changed

+909
-36
lines changed

6 files changed

+909
-36
lines changed

LICENSE.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ Julia bundles the following external programs and libraries on some platforms:
8686
- [BUSYBOX](https://github.com/rmyorston/busybox-w32/blob/master/LICENSE)
8787
- [ZLIB](http://zlib.net/zlib_license.html)
8888
- [LIBEXPAT](http://expat.cvs.sourceforge.net/viewvc/expat/expat/README)
89-
- [OPENSSL](https://github.com/openssl/openssl/blob/master/LICENSE)
9089

9190
On some platforms, distributions of Julia contain SSL certificate authority certificates,
9291
released under the [Mozilla Public License](https://en.wikipedia.org/wiki/Mozilla_Public_License).

Makefile

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -362,12 +362,6 @@ endif
362362
fi \
363363
done \
364364
done
365-
366-
# Copy in libssl and libcrypto if they exist
367-
ifeq ($(OS),Linux)
368-
-$(INSTALL_M) $(build_libdir)/libssl*.so* $(DESTDIR)$(private_libdir)
369-
-$(INSTALL_M) $(build_libdir)/libcrypto*.so* $(DESTDIR)$(private_libdir)
370-
endif
371365
endif
372366

373367
ifeq ($(USE_SYSTEM_LIBUV),0)

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,6 @@ Building Julia requires that the following software be installed:
275275
- **[m4]** — needed to build GMP.
276276
- **[patch]** — for modifying source code.
277277
- **[cmake]** — needed to build `libgit2`.
278-
- **[openssl]** — needed for HTTPS support in `libgit2` on Linux, install via `apt-get install libssl-dev` or `yum install openssl-devel`.
279278
- **[pkg-config]** - needed to build `libgit2` correctly, especially for proxy support
280279

281280
Julia uses the following external libraries, which are automatically downloaded (or in a few cases, included in the Julia source repository) and then compiled from source the first time you run `make`:
@@ -338,7 +337,6 @@ For a longer overview of Julia's dependencies, see these [slides](https://github
338337
[utf8proc]: http://julialang.org/utf8proc/
339338
[libosxunwind]: https://github.com/JuliaLang/libosxunwind
340339
[libunwind]: http://www.nongnu.org/libunwind
341-
[openssl]: https://www.openssl.org
342340
[libssh2]: https://www.libssh2.org
343341
[mbedtls]: https://tls.mbed.org/
344342
[pkg-config]: https://www.freedesktop.org/wiki/Software/pkg-config/

deps/libgit2.mk

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ ifeq ($(USE_SYSTEM_LIBSSH2), 0)
88
$(BUILDDIR)/$(LIBGIT2_SRC_DIR)/build-configured: | $(build_prefix)/manifest/libssh2
99
endif
1010

11+
ifeq ($(USE_SYSTEM_MBEDTLS), 0)
12+
$(BUILDDIR)/$(LIBGIT2_SRC_DIR)/build-configured: | $(build_prefix)/manifest/mbedtls
13+
endif
14+
1115
ifneq ($(OS),WINNT)
1216
ifeq ($(USE_SYSTEM_CURL), 0)
1317
$(BUILDDIR)/$(LIBGIT2_SRC_DIR)/build-configured: | $(build_prefix)/manifest/curl
@@ -33,18 +37,18 @@ LIBGIT2_OPTS += -DCURL_INCLUDE_DIRS=$(build_includedir) -DCURL_LIBRARIES="-L$(bu
3337
endif
3438

3539
ifeq ($(OS),Linux)
36-
LIBGIT2_OPTS += -DCMAKE_INSTALL_RPATH="\$$ORIGIN"
40+
LIBGIT2_OPTS += -DUSE_OPENSSL=OFF -DUSE_MBEDTLS=ON -DCMAKE_INSTALL_RPATH="\$$ORIGIN"
3741
endif
3842

3943
$(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)/libgit2-ssh.patch-applied: $(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)/source-extracted
4044
cd $(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR) && patch -p0 -f < $(SRCDIR)/patches/libgit2-ssh.patch
4145
echo 1 > $@
4246

43-
$(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)/libgit2-require-openssl.patch-applied: $(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)/source-extracted | $(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)/libgit2-ssh.patch-applied
44-
cd $(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR) && patch -p1 -f < $(SRCDIR)/patches/libgit2-require-openssl.patch
47+
$(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)/libgit2-mbedtls.patch-applied: $(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)/source-extracted | $(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)/libgit2-ssh.patch-applied
48+
cd $(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR) && patch -p1 -f < $(SRCDIR)/patches/libgit2-mbedtls.patch
4549
echo 1 > $@
4650

47-
$(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)/libgit2-agent-nonfatal.patch-applied: $(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)/source-extracted | $(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)/libgit2-require-openssl.patch-applied
51+
$(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)/libgit2-agent-nonfatal.patch-applied: $(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)/source-extracted | $(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)/libgit2-mbedtls.patch-applied
4852
cd $(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR) && patch -p1 -f < $(SRCDIR)/patches/libgit2-agent-nonfatal.patch
4953
echo 1 > $@
5054

@@ -53,7 +57,7 @@ $(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)/libgit2-openssl-hang.patch-applied: $(SRCD
5357
echo 1 > $@
5458

5559
$(BUILDDIR)/$(LIBGIT2_SRC_DIR)/build-configured: \
56-
$(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)/libgit2-require-openssl.patch-applied \
60+
$(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)/libgit2-mbedtls.patch-applied \
5761
$(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)/libgit2-openssl-hang.patch-applied \
5862
$(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)/libgit2-ssh.patch-applied \
5963
$(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)/libgit2-agent-nonfatal.patch-applied
@@ -82,15 +86,6 @@ ifeq ($$(OS),WINNT)
8286
else
8387
$(call MAKE_INSTALL,$1,$2,$3)
8488
endif
85-
ifeq ($$(OS),Linux)
86-
@# If we're on linux, copy over libssl and libcrypto for libgit2
87-
-LIBGIT_LIBS=$$$$(ldd "$1/libgit2.$$(SHLIB_EXT)" | tail -n +2 | awk '{print $$$$(NF-1)}'); \
88-
for LIB in libssl libcrypto; do \
89-
LIB_PATH=$$$$(echo "$$$$LIBGIT_LIBS" | grep "$$$$LIB"); \
90-
echo "LIB_PATH for $$$$LIB: $$$$LIB_PATH"; \
91-
[ ! -z "$$$$LIB_PATH" ] && cp -v "$$$$LIB_PATH" $2/$$(build_shlibdir); \
92-
done
93-
endif
9489
endef
9590
$(eval $(call staged-install, \
9691
libgit2,$(LIBGIT2_SRC_DIR), \

0 commit comments

Comments
 (0)