Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5afff8c

Browse files
committed
Grab TLS certificates during libgit2 build time instead of binary-dist time
1 parent b5fe42d commit 5afff8c

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

Makefile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -453,10 +453,9 @@ ifneq ($(OS), WINNT)
453453
endif
454454
ifeq ($(OS), Linux)
455455
-$(JULIAHOME)/contrib/fixup-libstdc++.sh $(DESTDIR)$(libdir) $(DESTDIR)$(private_libdir)
456-
# We need to bundle ca certs on linux now that we're using libgit2 with ssl
457-
ifeq ($(shell [ -e $(shell openssl version -d | cut -d '"' -f 2)/cert.pem ] && echo exists),exists)
458-
-cp $(shell openssl version -d | cut -d '"' -f 2)/cert.pem $(DESTDIR)$(datarootdir)/julia/
459-
endif
456+
457+
# Copy over any bundled ca certs we picked up from the system during buildi
458+
-cp $(build_datarootdir)/julia/cert.pem $(DESTDIR)$(datarootdir)/julia/
460459
endif
461460
# Copy in juliarc.jl files per-platform for binary distributions as well
462461
# Note that we don't install to sysconfdir: we always install to $(DESTDIR)$(prefix)/etc.

deps/libgit2.mk

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ ifeq ($(OS),Linux)
4040
LIBGIT2_OPTS += -DUSE_OPENSSL=OFF -DUSE_MBEDTLS=ON -DCMAKE_INSTALL_RPATH="\$$ORIGIN"
4141
endif
4242

43+
# We need to bundle ca certs on linux now that we're using libgit2 with ssl
44+
ifeq ($(OS),Linux)
45+
ifeq ($(shell [ -e $(shell openssl version -d | cut -d '"' -f 2)/cert.pem ] && echo exists),exists)
46+
CERTFILE=$(shell openssl version -d | cut -d '"' -f 2)/cert.pem
47+
endif
48+
endif
49+
4350
$(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)/libgit2-ssh.patch-applied: $(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)/source-extracted
4451
cd $(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR) && patch -p0 -f < $(SRCDIR)/patches/libgit2-ssh.patch
4552
echo 1 > $@
@@ -56,12 +63,21 @@ $(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)/libgit2-openssl-hang.patch-applied: $(SRCD
5663
cd $(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR) && patch -p1 -f < $(SRCDIR)/patches/libgit2-openssl-hang.patch
5764
echo 1 > $@
5865

66+
$(build_datarootdir)/julia/cert.pem: $(CERTFILE)
67+
mkdir -p $(build_datarootdir)/julia
68+
echo "NABIL: Copying over certfile $(CERTFILE)"
69+
-cp $(CERTFILE) $@
70+
5971
$(BUILDDIR)/$(LIBGIT2_SRC_DIR)/build-configured: \
6072
$(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)/libgit2-mbedtls.patch-applied \
6173
$(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)/libgit2-openssl-hang.patch-applied \
6274
$(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)/libgit2-ssh.patch-applied \
6375
$(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)/libgit2-agent-nonfatal.patch-applied
6476

77+
ifneq ($(CERTFILE),)
78+
$(BUILDDIR)/$(LIBGIT2_SRC_DIR)/build-configured: $(build_datarootdir)/julia/cert.pem
79+
endif
80+
6581
$(BUILDDIR)/$(LIBGIT2_SRC_DIR)/build-configured: $(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)/source-extracted
6682
mkdir -p $(dir $@)
6783
cd $(dir $@) && \

0 commit comments

Comments
 (0)