From 7a81912e710087e2e5958c92707a3d33e3d093c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Mon, 14 Oct 2024 11:49:04 +0200 Subject: [PATCH 1/2] debian/control: Bump dependency on go 1.23 That's what we actually require --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 2ffdd6d55..1662a43dc 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~), libc6-dev (>= 2.35), libglib2.0-dev, libpam0g-dev, From 37e7f7742f1a962f45e0ae83c20a7561703bd45f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Mon, 14 Oct 2024 11:49:36 +0200 Subject: [PATCH 2/2] debian/control: Use explicit named package for go version So that authd can be easily compiled on other versions such as 22.04, and in case that we forget to update this value when bumping our go.mod toolchain, then we'll fail at debian build phase (as expected) --- debian/control | 2 +- debian/rules | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 1662a43dc..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.23~), + 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