From c5a9044ef426e9914902cc65b714f283ba8a2f8f Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Feb 17 2022 02:12:38 +0000 Subject: Stop using deprecated %__global_ldflags macro. --- diff --git a/rpm/macros.d/macros.go-compilers-gcc b/rpm/macros.d/macros.go-compilers-gcc index 609c464..3d344d2 100644 --- a/rpm/macros.d/macros.go-compilers-gcc +++ b/rpm/macros.d/macros.go-compilers-gcc @@ -26,9 +26,9 @@ # Define commands for building %gobuild(o:) %{expand: %{?gobuilddir:GOPATH="%{gobuilddir}:${GOPATH:+${GOPATH}:}%{?gopath}"} \\ -go build -compiler gccgo -gccgoflags "$RPM_OPT_FLAGS ${LDFLAGS:-%{?currentgoldflags} %__global_ldflags} %{?__golang_extldflags}" -a -v -x %{?**}; +go build -compiler gccgo -gccgoflags "$RPM_OPT_FLAGS ${LDFLAGS:-%{?currentgoldflags} %{build_ldflags}} %{?__golang_extldflags}" -a -v -x %{?**}; } # Define commands for testing -%gotestflags -compiler gccgo -gccgoflags "$RPM_OPT_FLAGS ${LDFLAGS:-%{?currentgoldflags} %__global_ldflags} %{?__golang_extldflags}" +%gotestflags -compiler gccgo -gccgoflags "$RPM_OPT_FLAGS ${LDFLAGS:-%{?currentgoldflags} %{build_ldflags}} %{?__golang_extldflags}" %gotest() go test %{gotestflags} %{?**}; diff --git a/rpm/macros.d/macros.go-compilers-golang b/rpm/macros.d/macros.go-compilers-golang index da2aa52..c88e550 100644 --- a/rpm/macros.d/macros.go-compilers-golang +++ b/rpm/macros.d/macros.go-compilers-golang @@ -29,7 +29,7 @@ # # %make GOBUILDFLAGS="%gobuildflags" # -%gobuildflags() %{expand:%{gocompilerflags} -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-} %{?currentgoldflags} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -compressdwarf=false -extldflags '%__global_ldflags %{?__golang_extldflags}'" -a -v -x} +%gobuildflags() %{expand:%{gocompilerflags} -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-} %{?currentgoldflags} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -compressdwarf=false -extldflags '%{build_ldflags} %{?__golang_extldflags}'" -a -v -x} # Turn off Go modules %gomodulesmode GO111MODULE=off @@ -50,7 +50,7 @@ ${workroot}${GOPATH:+:${GOPATH}} # Define commands for testing %gotestflags %{gocompilerflags} -%gotestextldflags %__global_ldflags %{?__golang_extldflags} +%gotestextldflags %{build_ldflags} %{?__golang_extldflags} %gotest() %{expand: %undefine _auto_set_build_flags %{?gomodulesmode} go test %{gotestflags} -ldflags "${LDFLAGS:-} %{?currentgoldflags} -extldflags '%{gotestextldflags}'" %{?**};