mirror of
https://abf.rosa.ru/djam/golang.git
synced 2025-02-23 16:52:54 +00:00
Updated to 1.4
This commit is contained in:
parent
58537ffb83
commit
d2c6eda290
7 changed files with 62 additions and 102 deletions
2
.abf.yml
2
.abf.yml
|
@ -1,2 +1,2 @@
|
|||
sources:
|
||||
go1.2.1.src.tar.gz: 6a4b9991eddd8039438438d6aa25126ab7e07f2f
|
||||
go1.4.src.tar.gz: 6a7d9bd90550ae1e164d7803b3e945dc8309252b
|
||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
go1.2
|
||||
go1.3
|
||||
|
|
|
@ -6,8 +6,8 @@ index 30bbfad..54d65f9 100644
|
|||
//
|
||||
// TODO: After Go 1, decide when to pass build.AllowBinary here.
|
||||
// See issue 3268 for mistakes to avoid.
|
||||
- bp, err := buildContext.Import(path, srcDir, 0)
|
||||
+ bp, err := buildContext.Import(path, srcDir, build.AllowBinary)
|
||||
- bp, err := buildContext.Import(path, srcDir, build.ImportComment)
|
||||
+ bp, err := buildContext.Import(path, srcDir, build.ImportComment | build.AllowBinary)
|
||||
bp.ImportPath = importPath
|
||||
if gobin != "" {
|
||||
bp.BinDir = gobin
|
||||
|
|
|
@ -1,35 +0,0 @@
|
|||
diff --git a/src/cmd/go/build.go b/src/cmd/go/build.go
|
||||
index 4bb83f1..16ce829 100644
|
||||
--- a/src/cmd/go/build.go
|
||||
+++ b/src/cmd/go/build.go
|
||||
@@ -91,6 +91,7 @@ func init() {
|
||||
}
|
||||
|
||||
// Flags set by multiple commands.
|
||||
+var buildS bool // OPENSUSE -s (for packaging only)
|
||||
var buildA bool // -a flag
|
||||
var buildN bool // -n flag
|
||||
var buildP = runtime.NumCPU() // -p flag
|
||||
@@ -139,6 +140,10 @@ func init() {
|
||||
// addBuildFlags adds the flags common to the build and install commands.
|
||||
func addBuildFlags(cmd *Command) {
|
||||
// NOTE: If you add flags here, also add them to testflag.go.
|
||||
+
|
||||
+ // OPENSUSE
|
||||
+ cmd.Flag.BoolVar(&buildS, "s", false, "")
|
||||
+
|
||||
cmd.Flag.BoolVar(&buildA, "a", false, "")
|
||||
cmd.Flag.BoolVar(&buildN, "n", false, "")
|
||||
cmd.Flag.IntVar(&buildP, "p", buildP, "")
|
||||
@@ -762,6 +767,11 @@ func (b *builder) build(a *action) (err error) {
|
||||
|
||||
// install is the action for installing a single package or executable.
|
||||
func (b *builder) install(a *action) (err error) {
|
||||
+ // OPENSUSE
|
||||
+ if buildS && (a.p.Standard || a.p.ImportPath == "cmd/cgo") {
|
||||
+ return nil
|
||||
+ }
|
||||
+
|
||||
defer func() {
|
||||
if err != nil && err != errPrintedOutput {
|
||||
err = fmt.Errorf("go install %s: %v", a.p.ImportPath, err)
|
|
@ -1,3 +1,4 @@
|
|||
addFilter("binaryinfo-readelf-failed") # go binaries are suposedly ELF-compliant
|
||||
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")
|
118
go.spec
118
go.spec
|
@ -1,15 +1,16 @@
|
|||
%define debug_package %{nil}
|
||||
%define __debug_install_post echo
|
||||
|
||||
%define goversion go1.2
|
||||
%define goversion go1.4
|
||||
|
||||
Summary: A compiled, garbage-collected, concurrent programming language
|
||||
Name: go
|
||||
Version: 1.2.1
|
||||
Release: 3
|
||||
Version: 1.4
|
||||
Release: 1
|
||||
License: BSD-3-Clause
|
||||
Group: Development/Other
|
||||
Url: http://golang.org
|
||||
Source0: https://go.googlecode.com/files/%{name}%{version}.src.tar.gz
|
||||
Source0: https://storage.googleapis.com/golang/%{name}%{version}.src.tar.gz
|
||||
Source1: %{name}.rpmlintrc
|
||||
Source2: go.sh
|
||||
Source3: macros.go
|
||||
|
@ -17,8 +18,6 @@ Source3: macros.go
|
|||
# stripped from the tarball to save space. TODO: Update contents after version update!
|
||||
Source4: VERSION
|
||||
Source5: godoc.service
|
||||
# PATCH-FIX-OPENSUSE add -s flag to 'go install' (don't rebuild/install std libs)
|
||||
Patch3: go-build-dont-reinstall-stdlibs.patch
|
||||
# PATCH-FIX-OPENSUSE re-enable build binary only packages (we are binary distro)
|
||||
# see http://code.google.com/p/go/issues/detail?id=2775 & also issue 3268
|
||||
Patch4: allow-binary-only-packages.patch
|
||||
|
@ -45,13 +44,13 @@ safety of a static language.
|
|||
|
||||
%files
|
||||
%doc AUTHORS CONTRIBUTORS LICENSE PATENTS README
|
||||
%ifarch %{ix86} %{arm}
|
||||
%ifarch %{ix86}
|
||||
%{_libdir}/go/pkg/tool/linux_%{go_arch}/8*
|
||||
%endif
|
||||
%ifarch x86_64
|
||||
%{_libdir}/go/pkg/tool/linux_%{go_arch}/6*
|
||||
%endif
|
||||
%ifarch %{arm}
|
||||
%ifarch %{armx}
|
||||
%{_libdir}/go/pkg/tool/linux_%{go_arch}/5*
|
||||
%endif
|
||||
%{_libdir}/go/src/cmd
|
||||
|
@ -61,6 +60,20 @@ safety of a static language.
|
|||
%{_libdir}/go/pkg/linux_%{go_arch}/bufio.a
|
||||
%{_libdir}/go/pkg/linux_%{go_arch}/bytes.a
|
||||
%{_libdir}/go/pkg/linux_%{go_arch}/cgocall.h
|
||||
%{_libdir}/go/pkg/linux_%{go_arch}/cmd/internal/goobj.a
|
||||
%{_libdir}/go/pkg/linux_%{go_arch}/cmd/internal/objfile.a
|
||||
%{_libdir}/go/pkg/linux_%{go_arch}/cmd/internal/rsc.io/arm/armasm.a
|
||||
%{_libdir}/go/pkg/linux_%{go_arch}/cmd/internal/rsc.io/x86/x86asm.a
|
||||
%{_libdir}/go/pkg/linux_%{go_arch}/cmd/pprof/internal/commands.a
|
||||
%{_libdir}/go/pkg/linux_%{go_arch}/cmd/pprof/internal/driver.a
|
||||
%{_libdir}/go/pkg/linux_%{go_arch}/cmd/pprof/internal/fetch.a
|
||||
%{_libdir}/go/pkg/linux_%{go_arch}/cmd/pprof/internal/plugin.a
|
||||
%{_libdir}/go/pkg/linux_%{go_arch}/cmd/pprof/internal/profile.a
|
||||
%{_libdir}/go/pkg/linux_%{go_arch}/cmd/pprof/internal/report.a
|
||||
%{_libdir}/go/pkg/linux_%{go_arch}/cmd/pprof/internal/svg.a
|
||||
%{_libdir}/go/pkg/linux_%{go_arch}/cmd/pprof/internal/symbolizer.a
|
||||
%{_libdir}/go/pkg/linux_%{go_arch}/cmd/pprof/internal/symbolz.a
|
||||
%{_libdir}/go/pkg/linux_%{go_arch}/cmd/pprof/internal/tempfile.a
|
||||
%{_libdir}/go/pkg/linux_%{go_arch}/compress/bzip2.a
|
||||
%{_libdir}/go/pkg/linux_%{go_arch}/compress/flate.a
|
||||
%{_libdir}/go/pkg/linux_%{go_arch}/compress/gzip.a
|
||||
|
@ -94,6 +107,7 @@ safety of a static language.
|
|||
%{_libdir}/go/pkg/linux_%{go_arch}/debug/elf.a
|
||||
%{_libdir}/go/pkg/linux_%{go_arch}/debug/gosym.a
|
||||
%{_libdir}/go/pkg/linux_%{go_arch}/debug/macho.a
|
||||
%{_libdir}/go/pkg/linux_%{go_arch}/debug/plan9obj.a
|
||||
%{_libdir}/go/pkg/linux_%{go_arch}/debug/pe.a
|
||||
%{_libdir}/go/pkg/linux_%{go_arch}/encoding.a
|
||||
%{_libdir}/go/pkg/linux_%{go_arch}/encoding/ascii85.a
|
||||
|
@ -111,6 +125,7 @@ safety of a static language.
|
|||
%{_libdir}/go/pkg/linux_%{go_arch}/expvar.a
|
||||
%{_libdir}/go/pkg/linux_%{go_arch}/flag.a
|
||||
%{_libdir}/go/pkg/linux_%{go_arch}/fmt.a
|
||||
%{_libdir}/go/pkg/linux_%{go_arch}/funcdata.h
|
||||
%{_libdir}/go/pkg/linux_%{go_arch}/go/ast.a
|
||||
%{_libdir}/go/pkg/linux_%{go_arch}/go/build.a
|
||||
%{_libdir}/go/pkg/linux_%{go_arch}/go/doc.a
|
||||
|
@ -134,6 +149,7 @@ safety of a static language.
|
|||
%{_libdir}/go/pkg/linux_%{go_arch}/image/jpeg.a
|
||||
%{_libdir}/go/pkg/linux_%{go_arch}/image/png.a
|
||||
%{_libdir}/go/pkg/linux_%{go_arch}/index/suffixarray.a
|
||||
%{_libdir}/go/pkg/linux_%{go_arch}/internal/syscall.a
|
||||
%{_libdir}/go/pkg/linux_%{go_arch}/io.a
|
||||
%{_libdir}/go/pkg/linux_%{go_arch}/io/ioutil.a
|
||||
%{_libdir}/go/pkg/linux_%{go_arch}/log.a
|
||||
|
@ -151,6 +167,7 @@ safety of a static language.
|
|||
%{_libdir}/go/pkg/linux_%{go_arch}/net/http/fcgi.a
|
||||
%{_libdir}/go/pkg/linux_%{go_arch}/net/http/httptest.a
|
||||
%{_libdir}/go/pkg/linux_%{go_arch}/net/http/httputil.a
|
||||
%{_libdir}/go/pkg/linux_%{go_arch}/net/http/internal.a
|
||||
%{_libdir}/go/pkg/linux_%{go_arch}/net/http/pprof.a
|
||||
%{_libdir}/go/pkg/linux_%{go_arch}/net/mail.a
|
||||
%{_libdir}/go/pkg/linux_%{go_arch}/net/rpc.a
|
||||
|
@ -186,6 +203,7 @@ safety of a static language.
|
|||
%{_libdir}/go/pkg/linux_%{go_arch}/text/tabwriter.a
|
||||
%{_libdir}/go/pkg/linux_%{go_arch}/text/template.a
|
||||
%{_libdir}/go/pkg/linux_%{go_arch}/text/template/parse.a
|
||||
%{_libdir}/go/pkg/linux_%{go_arch}/textflag.h
|
||||
%{_libdir}/go/pkg/linux_%{go_arch}/time.a
|
||||
%{_libdir}/go/pkg/linux_%{go_arch}/unicode.a
|
||||
%{_libdir}/go/pkg/linux_%{go_arch}/unicode/utf16.a
|
||||
|
@ -194,7 +212,7 @@ safety of a static language.
|
|||
%{_libdir}/go/pkg/obj/linux_%{go_arch}/libbio.a
|
||||
%{_libdir}/go/pkg/obj/linux_%{go_arch}/libcc.a
|
||||
%{_libdir}/go/pkg/obj/linux_%{go_arch}/libgc.a
|
||||
%{_libdir}/go/pkg/obj/linux_%{go_arch}/libmach.a
|
||||
%{_libdir}/go/pkg/obj/linux_%{go_arch}/liblink.a
|
||||
%{_libdir}/go/pkg/tool/linux_%{go_arch}/addr2line
|
||||
%{_libdir}/go/pkg/tool/linux_%{go_arch}/cgo
|
||||
%{_libdir}/go/pkg/tool/linux_%{go_arch}/dist
|
||||
|
@ -206,9 +224,8 @@ safety of a static language.
|
|||
%{_libdir}/go/pkg/tool/linux_%{go_arch}/yacc
|
||||
%{_bindir}/go*
|
||||
%{_datadir}/go
|
||||
%config %{_sysconfdir}/bash_completion.d/go
|
||||
%config %{_sysconfdir}/profile.d/go.sh
|
||||
%config %{_sysconfdir}/rpm/macros.go
|
||||
%config %{_sysconfdir}/profile.d/go.sh
|
||||
%{_unitdir}/godoc.service
|
||||
|
||||
%post
|
||||
|
@ -232,57 +249,28 @@ Go examples and documentation.
|
|||
%files doc
|
||||
%doc doc misc
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
%package vim
|
||||
Summary: Go syntax files for Vim
|
||||
Group: Editors
|
||||
Requires: %{name} = %{EVRD}
|
||||
|
||||
%description vim
|
||||
Vim syntax highlighting scheme for the Go programming language.
|
||||
|
||||
%files vim
|
||||
%dir %{_datadir}/vim
|
||||
%{_datadir}/vim/*
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
%package emacs
|
||||
Summary: Go language syntax files for Emacs
|
||||
Group: Editors
|
||||
Requires: %{name} = %{version}
|
||||
|
||||
%description emacs
|
||||
Emacs syntax highlighting scheme for the Go programming language.
|
||||
|
||||
%files emacs
|
||||
%{_datadir}/emacs/site-lisp/go-mode*
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
%prep
|
||||
%setup -q -n %{name}
|
||||
%patch3 -p1
|
||||
%patch4 -p1
|
||||
%apply_patches
|
||||
cp %{SOURCE4} .
|
||||
cp %{SOURCE5} .
|
||||
|
||||
# setup go_arch (BSD-like scheme)
|
||||
%ifarch %{ix86}
|
||||
sed -i 's|GOARCH|386|' %{SOURCE3}
|
||||
%define go_arch 386
|
||||
%endif
|
||||
%ifarch x86_64
|
||||
sed -i 's|GOARCH|amd64|' %{SOURCE3}
|
||||
%define go_arch amd64
|
||||
%endif
|
||||
%ifarch %{arm}
|
||||
sed -i 's|GOARCH|arm|' %{SOURCE3}
|
||||
%ifarch %{armx}
|
||||
%define go_arch arm
|
||||
%endif
|
||||
|
||||
%build
|
||||
mkdir -p bfd
|
||||
ln -s %{_bindir}/ld.bfd bfd/ld
|
||||
export PATH=$PWD/bfd:$PATH
|
||||
|
||||
export GOROOT="`pwd`"
|
||||
export GOROOT_FINAL=%{_libdir}/go
|
||||
export GOBIN="$GOROOT/bin"
|
||||
|
@ -290,22 +278,28 @@ mkdir -p "$GOBIN"
|
|||
cd src
|
||||
export GDB_PRINTER="%{gdb_printer}"
|
||||
HOST_EXTRA_CFLAGS="%{optflags} -Wno-error" ./make.bash
|
||||
# CC_FOR_TARGET="%{__cc}" CC="%{__cc} %{optflags} %{ldflags}" ./make.bash
|
||||
|
||||
%check
|
||||
export GOROOT=$(pwd -P)
|
||||
export PATH="$PATH":"$GOROOT"/bin
|
||||
chmod +x doc/progs/run
|
||||
chmod +x doc/articles/wiki/test.bash
|
||||
chmod +x doc/codewalk/run
|
||||
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 !linux^Mpackage/' ../misc/cgo/test/issue5603.go
|
||||
perl -pi -e 's/func Test5603/\/\/func Test5603/' ../misc/cgo/test/cgo_test.go
|
||||
#./run.bash --no-rebuild --banner
|
||||
|
||||
CGO_ENABLED=0 ./run.bash --no-rebuild
|
||||
cd ..
|
||||
|
||||
%install
|
||||
export GOROOT="%{buildroot}%{_libdir}/%{name}"
|
||||
install -Dm644 misc/bash/go %{buildroot}%{_sysconfdir}/bash_completion.d/go
|
||||
install -Dm644 %{SOURCE2} %{buildroot}%{_sysconfdir}/profile.d/go.sh
|
||||
install -Dm644 misc/emacs/go-mode-load.el %{buildroot}%{_datadir}/emacs/site-lisp/go-mode-load.el
|
||||
install -Dm644 misc/emacs/go-mode.el %{buildroot}%{_datadir}/emacs/site-lisp/go-mode.el
|
||||
install -Dm644 misc/vim/autoload/go/complete.vim %{buildroot}%{_datadir}/vim/site/autoload/go/complete.vim
|
||||
install -d %{buildroot}%{_datadir}/vim/site/ftplugin/go
|
||||
install -Dm644 misc/vim/ftplugin/go/{fmt,import}.vim %{buildroot}%{_datadir}/vim/site/ftplugin/go/
|
||||
install -Dm644 misc/vim/ftplugin/go.vim %{buildroot}%{_datadir}/vim/site/ftplugin/go/
|
||||
install -Dm644 misc/vim/indent/go.vim %{buildroot}%{_datadir}/vim/site/indent/go.vim
|
||||
install -Dm644 misc/vim/plugin/godoc.vim %{buildroot}%{_datadir}/vim/site/plugin/godoc.vim
|
||||
install -Dm644 misc/vim/syntax/godoc.vim %{buildroot}%{_datadir}/vim/site/syntax/godoc.vim
|
||||
install -Dm644 misc/vim/syntax/go.vim %{buildroot}%{_datadir}/vim/site/syntax/go.vim
|
||||
install -Dm644 misc/vim/ftdetect/gofiletype.vim %{buildroot}%{_datadir}/vim/site/ftdetect/gofiletype.vim
|
||||
|
||||
# godoc service
|
||||
mkdir -p %{buildroot}%{_unitdir}
|
||||
|
@ -314,8 +308,8 @@ install -Dm644 godoc.service %{buildroot}%{_unitdir}/godoc.service
|
|||
# copy document templates, packages, obj libs and command utilities
|
||||
mkdir -p %{buildroot}%{_bindir}
|
||||
mkdir -p $GOROOT/lib
|
||||
mv pkg $GOROOT
|
||||
mv bin/* %{buildroot}%{_bindir}
|
||||
cp -r pkg $GOROOT
|
||||
cp bin/* %{buildroot}%{_bindir}
|
||||
rm -f %{buildroot}%{_bindir}/{hgpatch,quietgcc}
|
||||
|
||||
# source files for go install, godoc, etc
|
||||
|
@ -337,12 +331,12 @@ rm -f misc/goplay/{goplay,*.6,*.8}
|
|||
rm -rf misc/windows
|
||||
rm -rf misc/cgo/test/{_*,*.o,*.out,*.6,*.8}
|
||||
|
||||
# install RPM macros ($GOARCH prepared in %%prep section)
|
||||
# install RPM macros
|
||||
install -Dm644 %{SOURCE3} %{buildroot}%{_sysconfdir}/rpm/macros.go
|
||||
sed -i s/GOARCH/%{go_arch}/ %{buildroot}%{_sysconfdir}/rpm/macros.go
|
||||
|
||||
# break hard links
|
||||
rm %{buildroot}%{_libdir}/go/pkg/linux_%{go_arch}/{cgocall,runtime}.h
|
||||
ln -s %{_datadir}/go/src/pkg/runtime/{cgocall,runtime}.h %{buildroot}%{_libdir}/go/pkg/linux_%{go_arch}/
|
||||
|
||||
strip %{buildroot}%{_bindir}/%{name}
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#
|
||||
|
||||
%go_ver %(LC_ALL=C rpm -q --qf '%%{epoch}:%%{version}\\n' go | sed -e 's/ (none):/ /' -e 's/ 0:/ /' | grep -v "is not")
|
||||
%go_arch 386
|
||||
%go_arch GOARCH
|
||||
%go_build_ver %(go version | sed 's/^go version //' | tr -d ' ')
|
||||
|
||||
%go_dir %{_libdir}/go
|
||||
|
|
Loading…
Add table
Reference in a new issue