Skip to content

Commit

Permalink
libgit2: fix cmake options on FreeBSD (#22754)
Browse files Browse the repository at this point in the history
Fix #22745
  • Loading branch information
iblislin authored and ararslan committed Jul 12, 2017
1 parent 79ea87f commit c492a7d
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions deps/libgit2.mk
Original file line number Diff line number Diff line change
Expand Up @@ -36,30 +36,27 @@ else
LIBGIT2_OPTS += -DCURL_INCLUDE_DIRS=$(build_includedir) -DCURL_LIBRARIES="-L$(build_shlibdir) -lcurl"
endif

ifeq ($(OS),Linux)
ifneq (,$(findstring $(OS),Linux FreeBSD))
LIBGIT2_OPTS += -DUSE_HTTPS=ON -DTLS_BACKEND="mbedTLS" -DCMAKE_INSTALL_RPATH="\$$ORIGIN"
endif
ifeq ($(OS),FreeBSD)
LIBGIT2_OPTS += -DCMAKE_INSTALL_RPATH="\$$ORIGIN"
endif

# We need to bundle ca certs on linux now that we're using libgit2 with ssl
ifeq ($(OS),Linux)
ifneq (,$(findstring $(OS),Linux FreeBSD))
OPENSSL_DIR=$(shell openssl version -d | cut -d '"' -f 2)
# This certfile location observed on Ubuntu 16.04
ifeq ($(shell [ -e $(OPENSSL_DIR)/certs/ca-certificates.crt ] && echo exists),exists)
CERTFILE=$(OPENSSL_DIR)/certs/ca-certificates.crt
# This certfile location observed on openSUSE Leap 42.1
else ifeq ($(shell [ -e $(OPENSSL_DIR)/ca-bundle.pem ] && echo exists),exists)
CERTFILE=$(OPENSSL_DIR)/ca-bundle.pem
# This certfile location observed on Ubuntu 14.04
# This certfile location observed on Ubuntu 14.04 and FreeBSD
else ifeq ($(shell [ -e $(OPENSSL_DIR)/cert.pem ] && echo exists),exists)
CERTFILE=$(OPENSSL_DIR)/cert.pem
# This certfile location observed on Debian 7
else ifeq ($(shell [ -e $(OPENSSL_DIR)/certs/ca.pem ] && echo exists),exists)
CERTFILE=$(OPENSSL_DIR)/certs/ca.pem
endif
endif # Linux
endif # Linux and FreeBSD

LIBGIT2_SRC_PATH := $(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)

Expand Down

0 comments on commit c492a7d

Please sign in to comment.