1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-04-12 16:52:10 -04:00

distros: Fix Go versioning on dms-git builds

This commit is contained in:
purian23
2026-02-19 17:20:22 -05:00
parent db8ebd606c
commit e931829411
3 changed files with 17 additions and 8 deletions

View File

@@ -28,7 +28,7 @@ Requires: accountsservice
Requires: dms-cli = %{epoch}:%{version}-%{release}
Requires: dgop
# Core utilities (Highly recommended for DMS functionality)
# Core utilities (Recommended for DMS functionality)
Recommends: cava
Recommends: danksearch
Recommends: matugen
@@ -65,6 +65,13 @@ Provides native DBus bindings, NetworkManager integration, and system utilities.
VERSION="%{version}"
COMMIT=$(echo "%{version}" | grep -oP '[a-f0-9]{7,}' | head -n1 || echo "unknown")
# Pin go.mod and vendor/modules.txt to the installed Go toolchain version
GO_INSTALLED=$(go version | grep -oP 'go\K[0-9]+\.[0-9]+')
sed -i "s/^go [0-9]\+\.[0-9]\+\(\.[0-9]*\)\?$/go ${GO_INSTALLED}/" core/go.mod
# Only patch vendor/modules.txt when a vendor dir exists (OBS/offline builds)
[ -f core/vendor/modules.txt ] && \
sed -i "s/^\(## explicit; go \)[0-9]\+\.[0-9]\+\(\.[0-9]*\)\?$/\1${GO_INSTALLED}/" core/vendor/modules.txt || true
cd core
make dist VERSION="$VERSION" COMMIT="$COMMIT"