+# NOTE: build needs >128 processes limit
# TODO
# - allow disabling tests (currently bcond exists just for showing which are test deps)
# - add verbose build output (currently dummy bcond)
Summary: Go compiler and tools
Summary(pl.UTF-8): Kompilator języka Go i narzędzia
Name: golang
-Version: 1.10.7
+Version: 1.18.8
Release: 1
# source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain
License: BSD and Public Domain
Group: Development/Languages
# Source0Download: https://golang.org/dl/
Source0: https://storage.googleapis.com/golang/go%{version}.src.tar.gz
-# Source0-md5: 3aed21a9a8fcc9455452b2229074213b
+# Source0-md5: 4da6e6a0f709a4fe9f5b1033a8439a09
Patch0: ca-certs.patch
Patch1: 0001-Don-t-use-the-bundled-tzdata-at-runtime-except-for-t.patch
-URL: http://golang.org/
+URL: https://golang.org/
BuildRequires: bash
+BuildRequires: rpm-build >= 4.6
BuildRequires: rpm-pythonprov
# The compiler is written in Go. Needs go(1.4+) compiler for build.
%if %{with bootstrap}
BuildRequires: glibc-static
BuildRequires: hostname
BuildRequires: pcre-devel
+BuildRequires: rpmbuild(macros) >= 2.007
BuildRequires: tzdata
%endif
Requires: ca-certificates
Conflicts: gcc-go
-ExclusiveArch: %{ix86} %{x8664} %{arm} aarch64 mips64 mips64le ppc64 ppc64le s390x
+ExclusiveArch: %{ix86} %{x8664} %{armv5} %{armv6} %{armv7} aarch64 mips mipsel mips64 mips64el ppc64 ppc64le riscv64 s390x
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%define no_install_post_strip 1
%ifarch %{x8664}
%define GOARCH amd64
%endif
-%ifarch %{arm}
+%ifarch %{armv5}
%define GOARCH arm
+%define GOARM 5
+%endif
+%ifarch %{armv6}
+%define GOARCH arm
+%define GOARM 6
+%endif
+%ifarch %{armv7}
+%define GOARCH arm
+%define GOARM 7
%endif
%ifarch aarch64
%define GOARCH arm64
%endif
-%ifarch mips64
-%define GOARCH mips64x
+%ifarch mipsel
+%define GOARCH mipsle
+%endif
+%ifarch mips64el
+%define GOARCH mips64le
%endif
-%ifarch ppc64 ppc64le s390x
+%ifarch mips mips64 ppc64 ppc64le riscv64 s390x
%define GOARCH %{_arch}
%endif
Summary(it.UTF-8): Documentazione di Go
Summary(pl.UTF-8): Dokumentacja do języka Go
Group: Documentation
-%if "%{_rpmversion}" >= "5"
BuildArch: noarch
-%endif
%description doc
Documentation for Go language.
export GOOS=linux
export GOARCH=%{GOARCH}
-%if %{without external_linker}
+%{?GOARM:export GOARM=%{GOARM}}
+%ifarch %{ix86}
+%ifarch %{x86_with_sse2}
+export GO386=sse2
+%else
+export GO386=softfloat
+%endif
+%endif
+%if %{without ext_linker}
export GO_LDFLAGS="-linkmode internal"
%endif
%if %{with cgo}
export CC_FOR_TARGET="$CC"
EOF
+grep -rl '#!.*env bash' . | xargs %{__sed} -i -e '1{
+ s,^#!.*bin/env bash,#!%{__bash},
+}'
+
%if 0
# optflags for go tools build
nflags="\"$(echo '%{rpmcflags}' | sed -e 's/^[ ]*//;s/[ ]*$//;s/[ ]\+/ /g' -e 's/ /\",\"/g')\""
# FIXME: do we need whole sources, including build scripts?
# for now, remove only non-Linux stuff
-%{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/src/androidtest.bash \
- $RPM_BUILD_ROOT%{_libdir}/%{name}/src/syscall/{mksyscall_solaris,mksysctl_openbsd,mksysnum_{darwin,dragonfly,freebsd,netbsd,openbsd}}.pl
+%{__rm} \
+ $RPM_BUILD_ROOT%{_libdir}/%{name}/src/syscall/{mksyscall,mksysctl_openbsd,mksysnum_{dragonfly,freebsd,netbsd,openbsd}}.pl
# ...and tests
%{__rm} -r $RPM_BUILD_ROOT%{_libdir}/%{name}/src/internal/trace \
$RPM_BUILD_ROOT%{_libdir}/%{name}/misc/cgo/{errors,fortran,test*}
+find $RPM_BUILD_ROOT%{_libdir}/%{name} -name testdata -prune | xargs %{__rm} -r
# unenvize remaining scripts
%{__sed} -i -e '1s,/usr/bin/env bash,/bin/bash,' $RPM_BUILD_ROOT%{_libdir}/%{name}/src/*.bash
%{__sed} -i -e '1s,/usr/bin/env bash,/bin/bash,' $RPM_BUILD_ROOT%{_libdir}/%{name}/src/syscall/*.sh
+%{__sed} -i -e '1s,/usr/bin/env bash,/bin/bash,' $RPM_BUILD_ROOT%{_libdir}/%{name}/src/cmd/vendor/golang.org/x/sys/unix/*.sh
+%{__sed} -i -e '1s,/usr/bin/env bash,/bin/bash,' $RPM_BUILD_ROOT%{_libdir}/%{name}/src/cmd/go/*.sh
%{__sed} -i -e '1s,/usr/bin/env perl,/usr/bin/perl,' $RPM_BUILD_ROOT%{_libdir}/%{name}/src/syscall/*.pl
%clean
%attr(755,root,root) %{_libdir}/%{name}/pkg/tool/linux_%{GOARCH}/trace
%attr(755,root,root) %{_libdir}/%{name}/pkg/tool/linux_%{GOARCH}/vet
-%dir %{_libdir}/%{name}/pkg/bootstrap
-%dir %{_libdir}/%{name}/pkg/bootstrap/bin
-%attr(755,root,root) %{_libdir}/%{name}/pkg/bootstrap/bin/asm
-%attr(755,root,root) %{_libdir}/%{name}/pkg/bootstrap/bin/cgo
-%attr(755,root,root) %{_libdir}/%{name}/pkg/bootstrap/bin/compile
-%attr(755,root,root) %{_libdir}/%{name}/pkg/bootstrap/bin/link
-%{_libdir}/%{name}/pkg/bootstrap/pkg
-%{_libdir}/%{name}/pkg/bootstrap/src
%{_libdir}/%{name}/pkg/include
%if %{with shared}