]> git.pld-linux.org Git - packages/golang.git/blobdiff - golang.spec
up to 1.18.8
[packages/golang.git] / golang.spec
index fd6ebc6352b623ae75d2c386934d02bf525f04ba..c81502e8a2c0c6b23af34d1c8bb8d43bf2874939 100644 (file)
@@ -1,3 +1,4 @@
+# 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.13.8
+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: 984c244563f2d2f48103e8d6db8a8308
+# 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}
@@ -48,11 +50,12 @@ BuildRequires:      golang >= 1.4
 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
@@ -68,16 +71,28 @@ BuildRoot:  %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 %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
 
@@ -107,9 +122,7 @@ Summary(fr.UTF-8):  Documentation pour Go
 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.
@@ -146,7 +159,15 @@ export GOHOSTARCH=%{GOARCH}
 
 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}
@@ -164,6 +185,10 @@ export CC="${CC#ccache }"
 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')\""
@@ -208,10 +233,11 @@ ln -sf %{_libdir}/%{name}/pkg/tool/linux_%{GOARCH}/cgo $RPM_BUILD_ROOT%{_bindir}
 # FIXME: do we need whole sources, including build scripts?
 # for now, remove only non-Linux stuff
 %{__rm} \
-       $RPM_BUILD_ROOT%{_libdir}/%{name}/src/syscall/{mksyscall,mksysctl_openbsd,mksysnum_{darwin,dragonfly,freebsd,netbsd,openbsd}}.pl
+       $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
This page took 0.04442 seconds and 4 git commands to generate.