From d18f93497855e9fdf7f2f6a5f5f900a9250f085d Mon Sep 17 00:00:00 2001 From: purian23 Date: Thu, 19 Feb 2026 19:21:01 -0500 Subject: [PATCH] fedora: Update trial run of bundled go deps --- distro/fedora/dms-git.spec | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/distro/fedora/dms-git.spec b/distro/fedora/dms-git.spec index 083ae225..dfa416a2 100644 --- a/distro/fedora/dms-git.spec +++ b/distro/fedora/dms-git.spec @@ -3,6 +3,7 @@ %global debug_package %{nil} %global version {{{ git_repo_version }}} %global pkg_summary DankMaterialShell - Material 3 inspired shell for Wayland compositors +%global go_toolchain_version 1.25.7 Name: dms Epoch: 2 @@ -14,12 +15,12 @@ License: MIT URL: https://github.com/AvengeMedia/DankMaterialShell VCS: {{{ git_repo_vcs }}} Source0: {{{ git_repo_pack }}} +Source1: https://go.dev/dl/go%{go_toolchain_version}.linux-amd64.tar.gz +Source2: https://go.dev/dl/go%{go_toolchain_version}.linux-arm64.tar.gz BuildRequires: git-core BuildRequires: gzip -BuildRequires: golang >= 1.24 BuildRequires: make -BuildRequires: wget BuildRequires: systemd-rpm-macros # Core requirements @@ -65,12 +66,27 @@ 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 +# Use pinned bundled Go toolchain (deterministic across chroots) +case "%{_arch}" in + x86_64) + GO_TARBALL="%{_sourcedir}/go%{go_toolchain_version}.linux-amd64.tar.gz" + ;; + aarch64) + GO_TARBALL="%{_sourcedir}/go%{go_toolchain_version}.linux-arm64.tar.gz" + ;; + *) + echo "Unsupported architecture for bundled Go: %{_arch}" + exit 1 + ;; +esac + +rm -rf .go +tar -xzf "$GO_TARBALL" +mv go .go +export GOROOT="$PWD/.go" +export PATH="$GOROOT/bin:$PATH" +export GOTOOLCHAIN=local +go version cd core make dist VERSION="$VERSION" COMMIT="$COMMIT"