mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-03 20:32:07 -04:00
fedora: Update trial run of bundled go deps
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user