Skip to content
This repository was archived by the owner on Dec 16, 2022. It is now read-only.

Commit e1afa3f

Browse files
authored
Merge pull request #6 from fluxcd/libgit2-1.3.0
2 parents 170222b + 7d11074 commit e1afa3f

File tree

2 files changed

+24
-6
lines changed

2 files changed

+24
-6
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ STATIC_TEST_TAG := test
55
PLATFORMS ?= linux/amd64,linux/arm/v7,linux/arm64
66
BUILD_ARGS ?=
77

8-
GIT2GO_TAG ?= v31.6.1
8+
GIT2GO_TAG ?= v33.0.1
99

1010
.PHONY: build
1111
build:

hack/Makefile

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,16 @@ INSTALL_LIBDIR ?= $(INSTALL_PREFIX)/lib/$(shell xx-info triple)
1515
endif
1616
BUILD_TYPE ?= "RelWithDebInfo"
1717
FLAGS ?=
18-
USE_HTTPS ?= OpenSSL
19-
USE_SSH ?= ON
18+
USE_HTTPS ?= OFF
19+
USE_SSH ?= OFF
20+
USE_BUNDLED_ZLIB ?= OFF
21+
BUILD_SHARED_LIBS ?= ON
2022

2123
# Cmake version to be installed.
2224
CMAKE_VERSION ?= 3.21.3
2325

2426
# Libgit2 version to be compiled and installed.
25-
LIBGIT2_VERSION ?= 1.1.1
27+
LIBGIT2_VERSION ?= 1.3.0
2628
# In some scenarios libgit2 needs to be checked out to a specific commit.
2729
# This takes presidence over LIBGIT_VERSION if defined.
2830
# Ref: https://github.com/libgit2/git2go/issues/834
@@ -65,19 +67,32 @@ ifeq (debian,$(XX_VENDOR))
6567
# certain key formats).
6668
# Ref: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=668271
6769
# Ref: https://github.com/ARMmbed/mbedtls/issues/2452#issuecomment-802683144
70+
DEPENDENCIES =
71+
ifneq ("OFF",$(USE_BUNDLED_ZLIB))
72+
DEPENDENCIES += zlib1g-dev
73+
endif
74+
ifneq ("OFF",$(USE_HTTPS))
75+
DEPENDENCIES += libssl-dev
76+
endif
77+
ifneq ("OFF",$(USE_SSH))
78+
DEPENDENCIES += libssh2-1-dev
79+
endif
6880
dependencies:
81+
ifneq ("",$(DEPENDENCIES))
6982
set -e; \
7083
echo "deb http://deb.debian.org/debian sid main" > /etc/apt/sources.list.d/sid.list \
7184
&& echo "deb-src http://deb.debian.org/debian sid main" /etc/apt/sources.list.d/sid.list \
7285
&& xx-apt update \
73-
&& xx-apt -t sid install --no-install-recommends -y zlib1g-dev libssl-dev libssh2-1-dev
86+
&& xx-apt -t sid install --no-install-recommends -y $(DEPENDENCIES)
87+
endif
7488
endif
7589
.PHONY: dependencies
7690

7791
libgit2: $(LIBGIT2)
7892
.PHONY: libgit2
7993

8094
ifdef HAS_BREW
95+
ifneq ("OFF",$(USE_HTTPS))
8196
HAS_OPENSSL := $(shell brew --prefix [email protected])
8297
# NB: the OPENSSL_LDFLAGS ensures the path is included in the libgit2.pc
8398
# file. As a standard brew installation doesn't appear to be system wide
@@ -87,11 +102,14 @@ ifdef HAS_OPENSSL
87102
PKG_CONFIG_PATH := $(PKG_CONFIG_PATH):$(HAS_OPENSSL)/lib/pkgconfig
88103
FLAGS += -DOPENSSL_LDFLAGS:STRING='-L $(HAS_OPENSSL)/lib'
89104
endif
105+
endif
106+
ifneq ("OFF",$(USE_SSH))
90107
HAS_LIBSSH2 := $(shell brew --prefix libssh2)
91108
ifdef HAS_LIBSSH2
92109
PKG_CONFIG_PATH := $(PKG_CONFIG_PATH):$(HAS_LIBSSH2)/lib/pkgconfig
93110
endif
94111
endif
112+
endif
95113

96114
$(LIBGIT2):
97115
set -e; \
@@ -108,7 +126,7 @@ $(LIBGIT2):
108126
-DCMAKE_INSTALL_LIBDIR:PATH=$(INSTALL_LIBDIR) \
109127
-DBUILD_CLAR:BOOL:BOOL=OFF \
110128
-DTHREADSAFE:BOOL=ON \
111-
-DBUILD_SHARED_LIBS=ON \
129+
-DBUILD_SHARED_LIBS:BOOL=$(BUILD_SHARED_LIBS) \
112130
-DUSE_BUNDLED_ZLIB:BOOL=OFF \
113131
-DUSE_HTTP_PARSER:STRING=builtin \
114132
-DREGEX_BACKEND:STRING=builtin \

0 commit comments

Comments
 (0)