Update to 1.13

This commit is contained in:
User 2019-09-18 17:09:36 +03:00
parent 3fa4ffdad4
commit 78d77df2ad
3 changed files with 42 additions and 18 deletions

View file

@ -1,3 +0,0 @@
sources:
go1.4.3.src.tar.gz: 486db10dc571a55c8d795365070f66d343458c48
go1.4.src.tar.gz: 6a7d9bd90550ae1e164d7803b3e945dc8309252b

View file

@ -2,3 +2,7 @@ addFilter("binaryinfo-readelf-failed") # go binaries are suposedly ELF-complian
addFilter("statically-linked-binary") # go doesn't yet support dynamic linking
addFilter("unstripped-binary-or-object") # doesnt like stripping
addFilter("devel-file-in-non-devel-package")
addFilter("E: missing-PT_GNU_STACK-section")
addFilter("E: zero-length")
addFilter("E: non-readable")

View file

@ -27,14 +27,17 @@
%define __noautoreq '/bin/rc|/usr/bin/awk|libc.so'
Name: golang
Version: 1.4.3
Release: 3
Version: 1.13
Release: 1
Summary: The Go Programming Language
Group: Development/Other
License: BSD
URL: http://golang.org/
Source0: https://storage.googleapis.com/golang/go%{version}.src.tar.gz
Source3: macros.go
#bootstrap
Source10: https://storage.googleapis.com/golang/go%{version}.linux-amd64.tar.gz
Source11: https://storage.googleapis.com/golang/go%{version}.linux-386.tar.gz
# for hostname
BuildRequires: net-tools
@ -72,35 +75,47 @@ end
%prep
%setup -q -n go
#setup -q -n go
# setup go_arch (BSD-like scheme)
%ifarch %{ix86}
sed -i 's|GOARCH|386|' %{SOURCE3}
%define go_arch 386
%setup -q -a11 -T -c -n go-bootstrap
%endif
%ifarch x86_64
sed -i 's|GOARCH|amd64|' %{SOURCE3}
%define go_arch amd64
%setup -q -a10 -T -c -n go-bootstrap
%endif
%setup -q -n go
%build
export CFLAGS="${RPM_OPT_FLAGS/-Wstrict-aliasing=2/} -Wno-error"
export LDFLAGS="$RPM_LD_FLAGS"
# set up final install location
export GOROOT_FINAL=%{_libdir}/%{name}
export GOROOT=$(pwd -P)
#export GOROOT=$(pwd -P)
export GOROOT=$RPM_BUILD_DIR/go-bootstrap/go
export GOBIN="$GOROOT"/bin
export GOROOT_BOOTSTRAP=$GOROOT
# TODO use the system linker to get the system link flags and build-id
# when https://code.google.com/p/go/issues/detail?id=5221 is solved
#export GO_LDFLAGS="-linkmode external -extldflags $RPM_LD_FLAGS"
# build
cd src
#cd src
#./make.bash
#cd ..
pushd src
./make.bash
cd ..
popd
# build static version of documentation
export PATH="$PATH":"$GOROOT"/bin
@ -115,7 +130,7 @@ cd src
# For now test 3729,5603 doesn't pass so skiping it
perl -pi -e 's/!windows/!windows,!linux/' ../misc/cgo/test/issue3729.go
perl -pi -e 's/func Test3729/\/\/func Test3729/' ../misc/cgo/test/cgo_test.go
perl -pi -e 's/^package/\/\/ +build !linuxpackage/' ../misc/cgo/test/issue5603.go
perl -pi -e 's/^package/\/\/ +build !linux package/' ../misc/cgo/test/issue5603.go
perl -pi -e 's/func Test5603/\/\/func Test5603/' ../misc/cgo/test/cgo_test.go
#./run.bash --no-rebuild
cd ..
@ -123,13 +138,19 @@ cd ..
%install
# create the top level directories
mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_libdir}/%{name}
install -d %{buildroot}%{_bindir}
install -d %{buildroot}%{_libdir}/%{name}
# remove all .bat
pushd src
rm -f *.bat
popd
# install everything into libdir (until symlink problems are fixed)
# https://code.google.com/p/go/issues/detail?id=5830
cp -av api bin doc favicon.ico include lib pkg robots.txt src \
%{buildroot}%{_libdir}/%{name}
#cp -av api bin doc favicon.ico include lib pkg robots.txt src %{buildroot}%{_libdir}/%{name}
cp -av bin lib src pkg robots.txt %{buildroot}%{_libdir}/%{name}
# remove the unnecessary zoneinfo file (Go will always use the system one first)
rm -rfv %{buildroot}%{_libdir}/%{name}/lib/time
@ -145,18 +166,20 @@ done
popd
# gdbinit
mkdir -p %{buildroot}%{_sysconfdir}/gdbinit.d
#mkdir -p %{buildroot}%{_sysconfdir}/gdbinit.d
install -d %{buildroot}%{_sysconfdir}/gdbinit.d
cp -av %{SOURCE100} %{buildroot}%{_sysconfdir}/gdbinit.d/golang
# prelink blacklist
mkdir -p %{buildroot}%{_sysconfdir}/prelink.conf.d
#mkdir -p %{buildroot}%{_sysconfdir}/prelink.conf.d
install -d %{buildroot}%{_sysconfdir}/prelink.conf.d
cp -av %{SOURCE101} %{buildroot}%{_sysconfdir}/prelink.conf.d/golang.conf
# install RPM macros ($GOARCH prepared in %%prep section)
install -Dm644 %{SOURCE3} %{buildroot}%{_sysconfdir}/rpm/macros.go
%files
%doc AUTHORS CONTRIBUTORS LICENSE PATENTS VERSION
%doc api/ doc/ AUTHORS CONTRIBUTORS LICENSE PATENTS VERSION README.md
# go files
%{_libdir}/%{name}
# bin symlinks