Skip to content

Commit bba5b31

Browse files
committed
Allow libgit2 build to be enforced
This can be useful on machines where libgit2 is installed due to other applications depending on it, but where the composition of this installation does not properly work with the controller. Reason the system version is still preferred, is because this lowers the barrier for drive-by contributors, as a working set of (Git) dependencies should only really be required if you are going to perform work in that domain. Signed-off-by: Hidde Beydals <[email protected]>
1 parent 981d91e commit bba5b31

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

Makefile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,12 @@ CRD_OPTIONS ?= crd:crdVersions=v1
1818
# Repository root based on Git metadata
1919
REPOSITORY_ROOT := $(shell git rev-parse --show-toplevel)
2020

21-
# Dependency versions
21+
# Libgit2 version
2222
LIBGIT2_VERSION ?= 1.1.1
23+
# Allows forcing the build of libgit2 if set to 1
24+
LIBGIT2_FORCE ?=
25+
26+
# Other dependency versions
2327
ENVTEST_BIN_VERSION ?= 1.19.2
2428
KUBEBUILDER_ASSETS ?= $(shell $(SETUP_ENVTEST) use -i $(ENVTEST_BIN_VERSION) -p path)
2529

@@ -164,8 +168,10 @@ endif
164168
libgit2: $(LIBGIT2) ## Detect or download libgit2 library
165169

166170
$(LIBGIT2):
167-
ifeq ($(LIBGIT2_VERSION),$(SYSTEM_LIBGIT2_VERSION))
168-
else
171+
ifneq ($(LIBGIT2_VERSION),$(SYSTEM_LIBGIT2_VERSION))
172+
LIBGIT2_FORCE = 1
173+
endif
174+
ifeq (1, $(LIBGIT2_FORCE))
169175
@{ \
170176
set -e; \
171177
mkdir -p $(LIBGIT2_PATH); \

0 commit comments

Comments
 (0)