diff --git a/debian/control b/debian/control index 2ffdd6d55..137437b12 100644 --- a/debian/control +++ b/debian/control @@ -10,7 +10,7 @@ Build-Depends: debhelper-compat (= 13), dh-exec, dh-golang, dctrl-tools, - golang-go (>= 2:1.22~), + golang-go (>= 2:1.23~) | golang-1.23-go, libc6-dev (>= 2.35), libglib2.0-dev, libpam0g-dev, diff --git a/debian/rules b/debian/rules index 91562d228..f4e36955d 100755 --- a/debian/rules +++ b/debian/rules @@ -47,6 +47,12 @@ export AUTHD_SKIP_ROOT_TESTS := 1 export DH_GOLANG_BUILDPKG := $(AUTHD_GO_PACKAGE)/... \ $(NULL) +# We add the required backported version to the $PATH so that if it exists, then +# we can use it. Otherwise we default to the go installed in original $PATH that +# always matches with the latest available go version in the archive. +AUTHD_BACKPORTED_GO_VERSION := $(shell grep-dctrl -s Build-Depends -n - ./debian/control | sed -n "s,.*\bgolang-\([0-9.]\+\)\b.*,\1,p") +export PATH := $(shell printenv PATH):/usr/lib/go-$(AUTHD_BACKPORTED_GO_VERSION)/bin + BUILDDIR := $(CURDIR)/obj-$(DEB_HOST_GNU_TYPE) export BUILT_PAM_LIBS_PATH := obj-$(DEB_HOST_GNU_TYPE)/src/$(AUTHD_GO_PACKAGE)/pam