Hello community, here is the log from the commit of package go.868 for openSUSE:12.1:Update checked in at 2012-09-17 13:27:08 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:12.1:Update/go.868 (Old) and /work/SRC/openSUSE:12.1:Update/.go.868.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "go.868", Maintainer is "" Changes: -------- New Changes file: --- /dev/null 2012-08-23 02:41:28.555381587 +0200 +++ /work/SRC/openSUSE:12.1:Update/.go.868.new/go.changes 2012-09-17 13:27:09.000000000 +0200 @@ -0,0 +1,867 @@ +------------------------------------------------------------------- +Wed Sep 5 03:46:15 UTC 2012 - [email protected] + +- BNC#776058 + - Add new patch to prevent the go install tool trying to reinstall + std library packages that are dependencies of third party packages. + - Using touch on the precompiled archives introdoces additional + problems with the go install tool. Instead, we simply don't mark + std library files as stale when a third party package is evaluated + for installation. The behaviour remains unchanged for the root + user and while it is inadvisable to manually reinstall standard + libraries using the openSUSE packages, we do not disallow it. +- Spec changes + - Remove redundant requires for ed/bison + - Minor tweaks for cross distro builds based on FC/Mageia/Mandriva +- Macro changes + - Tweak the BRP strip macro to work on RHEL based distros +- Add go-wiki xml widget + +------------------------------------------------------------------- +Thu Aug 16 11:15:13 UTC 2012 - [email protected] + +- BNC#776058 +- spec changes, reverse positions of compiled items and package + source in the %install section. touch compiled package archives + after source is installed for go-doc, this prevents the go tool + trying to re-compile/install std libraries. + +------------------------------------------------------------------- +Tue Aug 14 22:31:47 UTC 2012 - [email protected] + +- Patch vim Godoc and Import plugins. +- Update spec file. + - Instead of using tarball generated from a repo checkout, switch + tarball source and use upstream official tarball. + - Remove dependance on VERSION file, make spec more robust for + future updates. + +------------------------------------------------------------------- +Mon Jul 16 23:56:36 UTC 2012 - [email protected] + +- remove unavailable -x verbose flag from go fix macro + +------------------------------------------------------------------- +Wed Jun 14 18:17:33 UTC 2012 - [email protected] + +- fix some qemu-arm compilation errors by passing -x to go always + +------------------------------------------------------------------- +Thu Jun 14 08:39:11 UTC 2012 - [email protected] + +- Update to bugfix release 1.0.2 +- This fixes two major bugs: + 3695 runtime: computed hash value for struct map key ignores + some fields + 3573 runtime: use of large map key causes crash +- Additionally, this fixes numerous smaller documentation and code + fixes, details can be found on this full list of changes: + http://code.google.com/p/go/source/list?name=release-branch.go1 + +------------------------------------------------------------------- +Tue Jun 5 14:10:49 UTC 2012 - [email protected] + +- Some Fedora_16 build fixes (i.e. added suse macros) + +------------------------------------------------------------------- +Tue Jun 5 13:53:04 UTC 2012 - [email protected] + +- Fix build time path locations in macros.go for packages that + depend on other Go packages. + +------------------------------------------------------------------- +Tue May 29 16:57:08 UTC 2012 - [email protected] + +- enable verbose build (fixes compilation for ARM? O_o) + +------------------------------------------------------------------- +Tue May 29 08:59:20 UTC 2012 - [email protected] + +- fix build for ARM + +------------------------------------------------------------------- +Wed May 9 09:32:23 UTC 2012 - [email protected] + +- Update to version 1.0.1 +- fix escape analysis bug that could cause memory corruption +- other minor updates see: + http://code.google.com/p/go/source/list?name=release-branch.go1 +- go.spec: remove arch dependent conditionals from %files section + we don't have to select these anymore. + +------------------------------------------------------------------- +Thu Apr 5 16:54:27 UTC 2012 - [email protected] + +- spec/go.sh/macros + change install location of third party libs to $GOROOT/contrib + add $GOROOT/contrib as the last location in users $GOPATH +- re-add sachape's typo and version check fixes +- Update godoc patch and add contrib src dir + +------------------------------------------------------------------- +Mon Apr 2 18:29:35 UTC 2012 - [email protected] + +- Add %godoc macro to help with packaging API docs + +------------------------------------------------------------------- +Mon Apr 2 09:37:12 UTC 2012 - [email protected] + +- Fixed some typos +- Removed checks for outdated SUSE versions + +------------------------------------------------------------------- +Mon Apr 2 02:53:46 UTC 2012 - [email protected] + +- update profile.d go.sh with $GOBIN for users + +------------------------------------------------------------------- +Mon Apr 2 02:21:51 UTC 2012 - [email protected] + +- cmd/go - re-enable building from binary only packages + we are a binary distro and the last minue change to go clean -i + disabled building from third party binary packages. package management + will be done via yast/zypper anyway and not go clean. + +------------------------------------------------------------------- +Sat Mar 31 12:14:51 UTC 2012 - [email protected] + +- change provides to match go release string as per VERSION file +- fix %pre, %post etc godoc service statement + +------------------------------------------------------------------- +Fri Mar 30 15:21:31 UTC 2012 - [email protected] + +- Export $GOBIN for the %gobuild() macro + +------------------------------------------------------------------- +Wed Mar 28 17:28:24 UTC 2012 - [email protected] + +- Go version 1 + http://golang.org/doc/go1.html + +------------------------------------------------------------------- +Tue Mar 27 06:55:34 UTC 2012 - [email protected] + +- Release candidate 2 +- Bug fixes and resolved issues + http://weekly.golang.org/doc/devel/weekly.html#2012-03-22 + +------------------------------------------------------------------- +Tue Mar 13 11:00:41 UTC 2012 - [email protected] + +- No language changes +- Initial Go 1 beta offering +- Many bug fixes and resolved issues + http://weekly.golang.org/doc/devel/weekly.html#2012-03-13 + +------------------------------------------------------------------- +Sat Mar 10 16:44:34 UTC 2012 - [email protected] + +- Add additional Go vim scripts, tweak goversion macro + +------------------------------------------------------------------- +Fri Mar 9 13:22:32 UTC 2012 - [email protected] + +- update spec and macro file to provide working requires + +------------------------------------------------------------------- +Wed Mar 7 06:12:58 UTC 2012 - [email protected] + +- update gotest/gofix macro + +------------------------------------------------------------------- +Tue Mar 6 04:20:18 UTC 2012 - [email protected] + +- Update godoc & go build patches +- removed dwarf pretty printer patch +- add godoc systemd service file + +------------------------------------------------------------------- +Mon Mar 5 05:34:19 UTC 2012 - [email protected] + +- Update to weekly.2012-03-04 +- Changes to go/build required code refactoring + see: http://weekly.golang.org/doc/devel/weekly.html#2012-03-04 + +------------------------------------------------------------------- +Fri Feb 24 01:03:28 UTC 2012 - [email protected] + +- Wpdate to weekly.2012-02-22 +- Some BC breaks and language changes, too many details to list + see release announcement: + http://weekly.golang.org/doc/devel/weekly.html#2012-02-22 + +------------------------------------------------------------------- +Fri Feb 17 14:30:55 UTC 2012 - [email protected] + +- cmd/gc: fix comparison of struct with _ field ++++ 670 more lines (skipped) ++++ between /dev/null ++++ and /work/SRC/openSUSE:12.1:Update/.go.868.new/go.changes New: ---- README-openSUSE allow-binary-only-packages.patch go-build-dont-reinstall-stdlibs.patch go-install-dont-reinstall-stdlibs.patch go-wiki-gadget.xml go.changes go.sh go.spec go1.0.2.src.tar.gz godoc-path-locations.patch godoc.service macros.go opensuse-vim.patch rpmlintrc verbose-build.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ go.spec ++++++ # # spec file for package go # # Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. # Copyright (c) 2011, Sascha Peilicke <[email protected]> # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # Name: go Version: 1.0.2 Release: 0 Summary: A compiled, garbage-collected, concurrent programming language License: BSD-3-Clause Group: Development/Languages/Other Url: http://golang.org Source0: http://go.googlecode.com/files/go%{version}.src.tar.gz Source1: rpmlintrc Source2: go.sh Source3: macros.go Source4: godoc.service Source6: go-wiki-gadget.xml Source5: README-openSUSE # PATCH-FIX-OPENSUSE adjust documentation paths for API/doc server Patch1: godoc-path-locations.patch # 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 Patch5: verbose-build.patch # PATCH-FIX-OPENSUSE fix vim Godoc and Import helpers/autocomplete Patch6: opensuse-vim.patch # PATCH-FIX-OPENSUSE BNC#776058 Patch7: go-install-dont-reinstall-stdlibs.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %if 0%{?suse_version} >= 1210 BuildRequires: systemd %endif %if 0%{?suse_version} >= 1100 BuildRequires: fdupes Recommends: go-doc %endif Provides: go-devel = %{name}%{version} Provides: go-devel-static = %{name}%{version} Obsoletes: go-devel < %{name}%{version} ExclusiveArch: %ix86 x86_64 %arm # For godoc service %if 0%{?suse_version} >= 1210 %systemd_requires %endif # fc pukes on the debug info in the command binaries %if 0%{?fedora} %define debug_package %{nil} %endif %description Go is an expressive, concurrent, garbage collected systems programming language that is type safe and memory safe. It has pointers but no pointer arithmetic. Go has fast builds, clean syntax, garbage collection, methods for any type, and run-time reflection. It feels like a dynamic language but has the speed and safety of a static language. %package doc Summary: Go documentation Group: Documentation/Other Requires: %{name} = %{version} %description doc Go examples and documentation. %package vim Summary: Go syntax files for Vim Group: Productivity/Text/Editors Requires: %{name} = %{version} %description vim Vim syntax highlighting scheme for the Go programming language. %package emacs Summary: Go language syntax files for Emacs Group: Productivity/Text/Editors Requires: %{name} = %{version} %description emacs Emacs syntax highlighting scheme for the Go programming language. %package kate Summary: Go syntax files for Kate and KWrite editors Group: Productivity/Text/Editors Requires: %{name} = %{version} %description kate Kate syntax highlighting scheme for the Go programming language. %prep %setup -q -n %{name} %patch1 -p1 %patch3 -p1 %patch4 -p1 %patch5 -p1 %patch6 -p1 %patch7 -p1 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} %define go_arch arm %endif %build export GOROOT="`pwd`" export GOROOT_FINAL=%{_libdir}/go export GOBIN="$GOROOT/bin" mkdir -p "$GOBIN" cd src export GDB_PRINTER="%{gdb_printer}" HOST_EXTRA_CFLAGS="%{optflags} -Wno-error" ./make.bash %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,godoc,import}.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 install -Dm644 misc/kate/go.xml %{buildroot}%{_datadir}/kde4/apps/katepart/syntax/go.xml # locations for third party libraries, see README-openSUSE for info about locations. install -d %{buildroot}%{_libdir}/go/contrib/pkg/linux_%{go_arch} install -d %{buildroot}%{_datadir}/go/contrib/src/pkg install -d %{buildroot}%{_datadir}/go/contrib/src/cmd install -Dm644 README-openSUSE %{buildroot}%{_libdir}/go/contrib/ ln -s %{_libdir}/go/contrib/README-openSUSE %{buildroot}%{_datadir}/go/contrib/README-openSUSE # godoc service mkdir -p %{buildroot}%{_unitdir} install -Dm644 godoc.service %{buildroot}%{_unitdir}/godoc.service # source files for go install, godoc, etc install -d %{buildroot}%{_datadir}/go for ext in *.{go,c,h,s,S,py}; do find src -name ${ext} -exec install -Dm644 \{\} %{buildroot}%{_datadir}/go/\{\} \; done mkdir -p $GOROOT/src ln -s /usr/share/go/src/pkg $GOROOT/src/pkg ln -s /usr/share/go/src/cmd $GOROOT/src/cmd # copy document templates, packages, obj libs and command utilities mkdir -p %{buildroot}%{_bindir} mkdir -p $GOROOT/lib cp -ar lib/godoc $GOROOT/lib mv pkg $GOROOT mv bin/* %{buildroot}%{_bindir} rm -f %{buildroot}%{_bindir}/{hgpatch,quietgcc} # documentation and examples # fix documetation permissions (rpmlint warning) find doc/ misc/ -type f -exec chmod 0644 '{}' \; # remove unwanted arch-dependant binaries (rpmlint warning) rm -rf misc/cgo/test/{_*,*.o,*.out,*.6,*.8} rm -f misc/dashboard/builder/{gobuilder,*6,*.8} rm -f misc/goplay/{goplay,*.6,*.8} rm -rf misc/windows rm -rf misc/cgo/test/{_*,*.o,*.out,*.6,*.8} # fix bnc#686557, contains image licensed under non-commercial license rm doc/talks/go_talk-20091030.pdf # install RPM macros ($GOARCH prepared in %%prep section) install -Dm644 %{SOURCE3} %{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}/ # Disable brp-strip-static-archive breaks build %define __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib/rpm/[^/]*/?brp-strip-static-archive %{__strip}!!g') %if 0%{?suse_version} >= 1100 %fdupes %{buildroot}%{_prefix} %endif %pre %if 0%{?suse_version} >= 1210 %service_add_pre godoc.service %endif %post %if 0%{?suse_version} >= 1210 %service_add_post godoc.service %endif %preun %if 0%{?suse_version} >= 1210 %service_del_preun godoc.service %endif %postun %if 0%{?suse_version} >= 1210 %service_del_postun godoc.service %endif %files %defattr(-,root,root,-) %doc AUTHORS CONTRIBUTORS LICENSE PATENTS README README-openSUSE %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 %{_libdir}/go/pkg/tool/linux_%{go_arch}/5* %endif %{_datadir}/go/ %{_bindir}/go* %{_libdir}/go/ %config %{_sysconfdir}/bash_completion.d/go %config %{_sysconfdir}/profile.d/go.sh %config %{_sysconfdir}/rpm/macros.go %if 0%{?suse_version} >= 1210 || 0%{?fedora} >= 16 %{_unitdir}/godoc.service %endif %files doc %defattr(-,root,root,-) %doc doc misc %files vim %defattr(-,root,root,-) %dir %{_datadir}/vim %{_datadir}/vim/* %files emacs %defattr(-,root,root,-) %{_datadir}/emacs/site-lisp/go-mode* %files kate %defattr(-,root,root,-) %dir %{_datadir}/kde4 %dir %{_datadir}/kde4/apps %dir %{_datadir}/kde4/apps/katepart %dir %{_datadir}/kde4/apps/katepart/syntax %{_datadir}/kde4/apps/katepart/syntax/go.xml %changelog ++++++ README-openSUSE ++++++ Updated: 05.05.2012 Authors: Graham Anderson, <[email protected]> PROJECT DETAILS --------------- OBS: https://build.opensuse.org/project/show?project=devel:languages:go Maintainers: Sascha Peilicke (saschpe), Graham Anderson (andtecheu) Wiki: http://en.opensuse.org/Go http://en.opensuse.org/openSUSE:Packaging_Go GENERAL NOTES ------------- Go toolchain environmental variables are configured via go.sh, which is installed to /etc/profile.d/go.sh Packaging guidelines and an RPM spec file recipe for packaging third party Go libraries can be found on the openSUSE wiki: http://en.opensuse.org/openSUSE:Packaging_Go The openSUSE go package uses the standard Go distribution toolchain, with a a small patchset to modify a few of the toolchain commands to suit our environment and packaging needs. This means that many of the standard go toolchain commands are not inside a users PATH, but rather are invoked and used via the "go" command. Should you wish to script or manually use the commands, the install location on a 64 bit system is /usr/lib64/go/pkg/tool/linux_amd64 The "go" tool, the "godoc" document server are inside a users PATH. We currently don't support the gccgo implementation, this is not for any other reason than contributer and maintainer time constraints. GO DOCUMENTATION ---------------- As of yet, there are no man pages for the standard Go distribution toolchain, please see the documentation provided by the "godoc" command. Man pages are slated to be included in the release in future. One of the diffs from the maintained patchset adds the distro specific doc and source file locations of the *-doc RPM packages to the virtual filesystem of the "godoc" documentation server. That is to say, as long as packages follow the Go packaging guidelines, API and other documentation should always be available via the godoc server if the packages "doc" RPM is installed. PACKAGE INSTALL LOCATIONS ------------------------- Go standard library packages are installed to a location in $GOROOT, which is defined as /usr/lib64/go on 64bit systems. Third party package binaries are installed to the default system wide $GOPATH entry. On 64bit systems the location /usr/lib64/go/contrib is used. This is specified in the macros.go RPM macro definition file that is part of the main Go package and is used for packaging most third party Go libraries. The reasons binary packages are installed to a GOPATH entry instead of GOROOT are mainly to do with how the Go toolchain prioritises and behaves with packages installed to the same location as the Go std library. By installing third party packages to a system-wide GOPATH entry location, we can ensure that no packages clobber the standard library namespace or file tree. Additionally we can support binary only packages, which as of Go 1.1 will only be supported outside of the $GOROOT. There are additional benefits to this location; such as allowing users and developers to prioritise linking from their own user defined GOPATH, which defaults to $HOME/go configured via /etc/profile.d/go.sh config. This has particular benefit for development workflows. For Go 1.1 and beyond, building and linking with binary only pacakges will only be supported with the following caveat. Package source code must not exist in the same GOPATH segment as the binary package .a archive file. If both the binary archive (.a) and the package source are installed to the same GOPATH segment, then the "go build" or "go install" command will prioritise building the software using package sources before using package binary archives. A side effect of this is that is actually possible to have source code only third party packages. To summarise the priority of binary package linking and building: 1. Any source files or binary packages in $GOROOT are considered first. Any binary packages in $GOROOT that are considered "stale" by the build tools are ignored in favour of the package source. 2. $GOPATH is considered next for import statements. GOPATH is a colon delimited list of paths. GOPATH segments are examined by the build tools in a FIFO manner, left to right. Both a system wide and a user GOPATH segment are configured by default, the user GOPATH segment takes priority over the system segment to allow flexibility for development workflows. The default user GOPATH is: GOPATH=$HOME/go:$GOROOT/contrib The default root user GOPATH is: GOPATH=$GOROOT/contrib 3. For Go < 1.1, If both the source and binary archive is available for a package import in the same GOPATH segment, the binary archive will take precedence and will be linked during compilation. For Go >= 1.1 If the package source is avaiable in the GOPATH segment, it will always be used in preference to the binary ++++++ allow-binary-only-packages.patch ++++++ diff --git a/src/cmd/go/pkg.go b/src/cmd/go/pkg.go index 30bbfad..54d65f9 100644 --- a/src/cmd/go/pkg.go +++ b/src/cmd/go/pkg.go @@ -220,7 +220,7 @@ func loadImport(path string, srcDir string, stk *importStack, importPos []token. // // 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.ImportPath = importPath if gobin != "" { bp.BinDir = gobin ++++++ go-build-dont-reinstall-stdlibs.patch ++++++ 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) ++++++ go-install-dont-reinstall-stdlibs.patch ++++++ diff --git a/src/cmd/go/pkg.go b/src/cmd/go/pkg.go index 54d65f9..a6c93f4 100644 --- a/src/cmd/go/pkg.go +++ b/src/cmd/go/pkg.go @@ -476,6 +476,13 @@ func isStale(p *Package, topRoot map[string]bool) bool { return true } + // openSUSE bnc#776058 + // Only root user can reinstall a std library from a dependancy, all other + // users should *never* have to do this. + if os.Getuid() != 0 && p.Standard { + return false + } + olderThan := func(file string) bool { fi, err := os.Stat(file) return err != nil || fi.ModTime().After(built) ++++++ go.sh ++++++ # go toolchain env paths libdir=lib arch=386 if [ -x /usr/lib64/go ] ; then libdir=lib64 arch=amd64 fi export GOOS="linux" case "$(uname -m)" in *86) export GOARCH=$arch ;; esac export GOROOT=/usr/$libdir/go export GOBIN=/usr/bin export GOPATH=$GOROOT/contrib if [ `id -u` != 0 ]; then export GOPATH=$HOME/go:$GOROOT/contrib export GOBIN=$HOME/go/bin fi ++++++ godoc-path-locations.patch ++++++ diff --git a/src/cmd/godoc/godoc.go b/src/cmd/godoc/godoc.go index f6dc678..0fa85bc 100644 --- a/src/cmd/godoc/godoc.go +++ b/src/cmd/godoc/godoc.go @@ -82,7 +82,35 @@ var ( pkgHandler docServer ) +const ( + SUSE_DOC_DIR = "/usr/share/doc/packages/go-doc/" + SUSE_SRC_DIR = "/usr/share/go" + SUSE_CONTRIB_SRC_DIR = "/usr/share/go/contrib/src/pkg/" +) + func initHandlers() { + // OPENSUSE: Bind godoc & source location + fs.Bind("/doc", OS(SUSE_DOC_DIR), "/doc", bindReplace) + fs.Bind("/src", OS(SUSE_SRC_DIR), "/src", bindBefore) + + d, err := os.Open(SUSE_CONTRIB_SRC_DIR) + if err != nil { + log.Fatalf("cannot read Go contrib source dir:", err) + } + if files, err := d.Readdir(0); err == nil { + for _, file := range files { + if file.IsDir() { + path := SUSE_CONTRIB_SRC_DIR + file.Name() + if *pkgPath != "" { + *pkgPath += ":" + } + *pkgPath += path + } + } + } else { + log.Fatal(err) + } + // Add named directories in -path argument as // subdirectories of src/pkg. for _, p := range filepath.SplitList(*pkgPath) { ++++++ godoc.service ++++++ # systemd service file for Go language API & documentation server # this file is part of the Go programming language package [Unit] Description=godoc - Go API and documentation server After=syslog.target network.target [Service] User=nobody PIDFile=/var/run/godoc.pid ExecStart=/usr/bin/godoc -http=:6060 -index=true ExecStop=/bin/kill -TERM $MAINPID ExecStop=/bin/kill -QUIT $MAINPID KillMode=process KillSignal=SIGKILL SendSIGKILL=yes RestartSec=30 Restart=always [Install] WantedBy=multi-user.target ++++++ macros.go ++++++ # Macros for Go module building. # # Copyright: (c) 2011 Sascha Peilicke <[email protected]> # Copyright: (c) 2012 Graham Anderson <[email protected]> # %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 GOARCH %go_build_ver %(go version | sed 's/^go version //' | tr -d ' ') %go_dir %{_libdir}/go %go_sitedir %{_libdir}/go/pkg %go_sitearch %{_libdir}/go/pkg/linux_%{go_arch} %go_contribdir %{_libdir}/go/contrib/pkg/linux_%{go_arch} %go_contribsrcdir %{_datadir}/go/contrib/src/pkg %go_requires Requires: go-devel = %go_build_ver %go_provides \ Provides: %{name}-devel = %{version} \ Provides: %{name}-devel-static = %{version} %go_disable_brp_strip_static_archive \ %undefine __os_install_post \ %define __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib/rpm/[^/]*/?brp-strip-static-archive %{__strip}!!g') # Prepare the expected Go package build environement. # We need a $GOPATH: go help gopath # We need a valid importpath: go help packages %goprep() \ export GOPATH=%{_builddir}/go \ if [ %# -eq 0 ]; then \ echo "goprep: please specify a valid importpath, see: go help packages" \ exit 1 \ else \ export IMPORTPATH=%1 \ fi \ # create the importpath and move the package there \ mkdir -p $GOPATH/src/$IMPORTPATH && mv ./* $GOPATH/src/$IMPORTPATH \ # now link the old location to the new (for compatibility) \ cd %{_builddir} && rmdir %{_builddir}/%(basename %1) \ ln -s $GOPATH/src/$IMPORTPATH %{_builddir}/%(basename %1) \ # we'll be installing packages/binaries, make the targ dirs \ install -d %{buildroot}%{go_contribdir} \ install -d %{buildroot}%{_bindir} \ %{nil} # %%gobuild macro actually performs the command "go install", but the go # toolchain will install to the $GOPATH which allows us then customise the final # install for the distro default locations. # # gobuild accepts zero or more arguments. Each argument corresponds to # a modifier of the importpath. If no arguments are passed, this is equivalent # to the following go install statement: # # go install [importpath] # # Only the first or last arguement may be ONLY the wildcard argument "..." # if the wildcard argument is passed then the importpath expands to all packages # and binaries underneath it. If the argument contains only the wildcard no further # arguments are considered. # # If no wildcard argument is passed, go install will be invoked on each $arg # subdirectory under the importpath. # # Valid importpath modifier examples: # # example: %gobuild ... # command: go install importpath... # # example: %gobuild /... # command: go install importpath/... (All subdirs NOT including importpath) # # example: %gobuild foo... # command: go install importpath/foo... (All subdirs INCLUDING foo) # # example: %gobuild foo ... (same as foo...) # command: go install importpath/foo... (All subdirs INCLUDING foo) # # example: %gobuild foo/... # commands: go install importpath/foo/... (All subdirs NOT including foo) # # example: %gobuild foo bar # commands: go install importpath/foo # go install importpath/bar # # example: %gobuild foo ... bar # commands: go install importpath/foo... (bar is ignored) # # example: %gobuild foo bar... baz # commands: go install importpath/foo # go install importpath/bar... # go install importpath/baz # # See: go help install, go help packages %gobuild() \ export BUILDFLAGS="-s -v -p 4 -x" \ export GOPATH=%{_builddir}/go:%{_libdir}/go/contrib \ export GOBIN=%{_builddir}/go/bin \ MOD="" \ if [ %# -gt 0 ]; then \ for mod in %*; do \ if [ $mod == "..." ]; then \ MOD=$MOD... \ go install $BUILDFLAGS $IMPORTPATH$MOD \ break \ else \ MOD=/$mod \ go install $BUILDFLAGS $IMPORTPATH$MOD \ fi \ done \ else \ go install $BUILDFLAGS $IMPORTPATH \ fi \ %{nil} # Install all compiled packages and binaries to the buildroot %goinstall() \ export GOPATH=%{_builddir}/go \ install -d %{buildroot}%{go_contribdir} \ TMPPKG=%{_builddir}/go/pkg \ if [ "$(ls -A $TMPPKG)" ]; then \ cp -ar %{_builddir}/go/pkg/linux_%{go_arch}/* %{buildroot}%{go_contribdir} \ fi \ TMPBIN=%{_builddir}/go/bin \ if [ "$(ls -A $TMPBIN)" ]; then \ install -m755 $TMPBIN/* %{buildroot}%{_bindir} \ fi \ %go_disable_brp_strip_static_archive \ %{nil} %gofix() \ export GOPATH=%{_builddir}/go \ if [ %# -eq 0 ]; then \ echo "gofix: please specify a valid importpath, see: go help fix" \ exit 1 \ else \ go fix %1... \ fi \ %{nil} %gotest() \ export GOPATH=%{_builddir}/go:%{_libdir}/go/contrib \ if [ %# -eq 0 ]; then \ echo "gotest: please specify a valid importpath, see: go help test" \ exit 1 \ else \ go test -x %1... \ fi \ %{nil} %godoc() \ install -d %{buildroot}%{go_contribsrcdir} \ cd %{_builddir}/go/src \ find . -name *.go -exec install -Dm644 \{\} %{buildroot}%{go_contribsrcdir}/\{\} \\; \ %{nil} ++++++ opensuse-vim.patch ++++++ diff --git a/misc/vim/autoload/go/complete.vim b/misc/vim/autoload/go/complete.vim index d4ae3b9..ae554bc 100644 --- a/misc/vim/autoload/go/complete.vim +++ b/misc/vim/autoload/go/complete.vim @@ -29,21 +29,35 @@ if len(s:goarch) == 0 endif function! go#complete#Package(ArgLead, CmdLine, CursorPos) + let dirs = [] + + let workspaces = split( $GOPATH, ':' ) + if workspaces != [] + let dirs += workspaces + endif + let goroot = $GOROOT - if len(goroot) == 0 - " should not occur. - return [] + if len(goroot) != 0 + let dirs += [ goroot ] endif + + if len( dirs ) == 0 + " should not happen + return [] + endif + let ret = {} - let root = expand(goroot.'/pkg/'.s:goos.'_'.s:goarch) - for i in split(globpath(root, a:ArgLead.'*'), "\n") - if isdirectory(i) - let i .= '/' - elseif i !~ '\.a$' - continue - endif - let i = substitute(substitute(i[len(root)+1:], '[\\]', '/', 'g'), '\.a$', '', 'g') - let ret[i] = i + for dir in dirs + let root = expand(dir.'/pkg/'.s:goos.'_'.s:goarch) + for i in split(globpath(root, a:ArgLead.'*'), "\n") + if isdirectory(i) + let i .= '/' + elseif i !~ '\.a$' + continue + endif + let i = substitute(substitute(i[len(root)+1:], '[\\]', '/', 'g'), '\.a$', '', 'g') + let ret[i] = i + endfor endfor return sort(keys(ret)) endfunction diff --git a/misc/vim/plugin/godoc.vim b/misc/vim/plugin/godoc.vim index fdb4966..a43d99d 100644 --- a/misc/vim/plugin/godoc.vim +++ b/misc/vim/plugin/godoc.vim @@ -72,7 +72,7 @@ function! s:Godoc(...) if !len(word) let word = expand('<cword>') endif - let word = substitute(word, '[^a-zA-Z0-9\/]', '', 'g') + let word = substitute(word, '[^a-zA-Z0-9\/.-]', '', 'g') if !len(word) return endif ++++++ rpmlintrc ++++++ addFilter("binaryinfo-readelf-failed") # go binaries are suposedly ELF-compliant addFilter("statically-linked-binary") # go doesn't yet support dynamic linking ++++++ verbose-build.patch ++++++ --- go/src/make.bash.orig 2012-05-29 18:30:57.734377736 +0200 +++ go/src/make.bash 2012-05-29 18:30:59.922377826 +0200 @@ -127,7 +127,7 @@ fi echo "# Building packages and commands for $GOOS/$GOARCH." -"$GOTOOLDIR"/go_bootstrap install -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std +"$GOTOOLDIR"/go_bootstrap install -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v -x std echo rm -f "$GOTOOLDIR"/go_bootstrap -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
