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

Skip to content

Commit 945e1bb

Browse files
committed
Grab TLS certificates during libgit2 build time instead of binary-dist time
1 parent dab1774 commit 945e1bb

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
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: 19 additions & 1 deletion
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,11 +63,22 @@ $(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+
ifeq ($(CERTFILE),)
67+
$(build_datarootdir)/julia/cert.pem:
68+
touch $@
69+
else
70+
$(build_datarootdir)/julia/cert.pem: $(CERTFILE)
71+
mkdir -p $(build_datarootdir)/julia
72+
echo "NABIL: Copying over certfile $(CERTFILE)"
73+
-cp $(CERTFILE) $@
74+
endif
75+
5976
$(BUILDDIR)/$(LIBGIT2_SRC_DIR)/build-configured: \
6077
$(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)/libgit2-mbedtls.patch-applied \
6178
$(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)/libgit2-openssl-hang.patch-applied \
6279
$(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)/libgit2-ssh.patch-applied \
63-
$(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)/libgit2-agent-nonfatal.patch-applied
80+
$(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)/libgit2-agent-nonfatal.patch-applied \
81+
$(build_datarootdir)/julia/cert.pem
6482

6583
$(BUILDDIR)/$(LIBGIT2_SRC_DIR)/build-configured: $(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)/source-extracted
6684
mkdir -p $(dir $@)

0 commit comments

Comments
 (0)