Skip to content

Commit

Permalink
debian/control: Use explicit named package for go version
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
3v1n0 committed Oct 14, 2024
1 parent 7a81912 commit a214c2c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Build-Depends: debhelper-compat (= 13),
dh-exec,
dh-golang,
dctrl-tools,
golang-go (>= 2:1.23~),
golang-1.23-go,
libc6-dev (>= 2.35),
libglib2.0-dev,
libpam0g-dev,
Expand Down
4 changes: 4 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ include /usr/share/rustc/architecture.mk
# The package name for authd, used only locally to avoid repetitions
AUTHD_GO_PACKAGE := $(shell grep-dctrl -s XS-Go-Import-Path -n - ./debian/control)

AUTHD_GO_VERSION := $(shell grep-dctrl -s Build-Depends -n - ./debian/control | sed -n "s,.*\bgolang-\([0-9.]\+\)\b.*,\1,p")

export GOFLAGS := -ldflags=-X=$(AUTHD_GO_PACKAGE)/internal/consts.Version=$(shell dpkg-parsechangelog -S Version) --mod=vendor -buildmode=pie

export DEB_BUILD_MAINT_OPTIONS := optimize=-lto
Expand Down Expand Up @@ -47,6 +49,8 @@ export AUTHD_SKIP_ROOT_TESTS := 1
export DH_GOLANG_BUILDPKG := $(AUTHD_GO_PACKAGE)/... \
$(NULL)

export PATH := /usr/lib/go-$(AUTHD_GO_VERSION)/bin:$(shell printenv PATH)

BUILDDIR := $(CURDIR)/obj-$(DEB_HOST_GNU_TYPE)

export BUILT_PAM_LIBS_PATH := obj-$(DEB_HOST_GNU_TYPE)/src/$(AUTHD_GO_PACKAGE)/pam
Expand Down

0 comments on commit a214c2c

Please sign in to comment.