From 7d234f517516713f8715509a12edf07ca356c0b8 Mon Sep 17 00:00:00 2001 From: Dominik Honnef Date: Tue, 1 Jul 2014 11:16:18 +0200 Subject: [PATCH 1/4] go: Correctly build (cross-)compilers Without passing the --no-clean flag to make.bash, each build will overwrite the previous one. This means that we always ended up with a single compiler, that for x86_64. --- srcpkgs/go/template | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/srcpkgs/go/template b/srcpkgs/go/template index c4ca645754..f420e94159 100644 --- a/srcpkgs/go/template +++ b/srcpkgs/go/template @@ -32,17 +32,15 @@ do_build() { export GOOS=linux cd src - # ARM build - export GOARCH=arm - bash make.bash - # x86 build - export GOARCH=386 - bash make.bash + # TODO We could very well also build windows and darwin + # cross-compilers here, at no added complexity - # x86_64 build - export GOARCH=amd64 - bash make.bash + # Build ARM, x86 and x86_64 compilers + for arch in arm 386 amd64; do + export GOARCH=$arch + bash make.bash --no-clean + done } do_install() { From 73cbaa45fea789f07ebe14a9819ff0e3545ec350 Mon Sep 17 00:00:00 2001 From: Dominik Honnef Date: Tue, 1 Jul 2014 12:12:22 +0200 Subject: [PATCH 2/4] go: include godoc, vet and cover godoc, vet and cover are part of the official Go distribution, but live in repositories separate from Go itself. --- srcpkgs/go/template | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/srcpkgs/go/template b/srcpkgs/go/template index f420e94159..2cf7d887f0 100644 --- a/srcpkgs/go/template +++ b/srcpkgs/go/template @@ -1,10 +1,10 @@ # Template file for 'go' pkgname=go version=1.3 -revision=1 +revision=2 wrksrc=go -makedepends="ed bison" -depends="perl gawk" +hostmakedepends="mercurial ca-certificates" +depends="perl" short_desc="The Go Programming Language" maintainer="Juan RP " homepage="http://golang.org/" @@ -23,13 +23,22 @@ do_build() { i686*) export GOHOSTARCH=386;; x86_64*) export GOHOSTARCH=amd64;; esac + case "$XBPS_TARGET_MACHINE" in + arm*) targetarch=arm;; + i686*) targetarch=386;; + x86_64*) targetarch=amd64;; + *) targetarch=$GOHOSTARCH;; + esac case "$XBPS_TARGET_MACHINE" in armv6l*) export GOARM=6;; armv7l*) export GOARM=7;; esac + export GOROOT=$PWD export GOROOT_FINAL="/usr/lib/go" export GOOS=linux + export GOPATH=/tmp + mkdir -p $GOPATH/src cd src @@ -41,10 +50,30 @@ do_build() { export GOARCH=$arch bash make.bash --no-clean done + + GOARCH=$targetarch + + hg clone -u release-branch.go${version} \ + --config web.cacerts=/etc/ssl/certs/ca-certificates.crt \ + https://code.google.com/p/go.tools/ \ + $GOPATH/src/code.google.com/p/go.tools + + for tool in godoc vet cover; do + $GOROOT/bin/go install code.google.com/p/go.tools/cmd/${tool} + done } do_install() { vinstall LICENSE 644 usr/share/licenses/go + + # TODO Beginning with Go 1.4, there will be no editor or shell + # integration in the Go distribution anymore (see + # https://codereview.appspot.com/105470043) - While the emacs + # integration has a canonical upstream at + # https://github.com/dominikh/go-mode.el, neither vim, bash nor + # zsh have one (yet). In any case, there'll need to be made a + # decision between pulling 3rd party integration into this + # package, providing extra packages, or doing nothing at all. vinstall misc/bash/go 644 usr/share/bash-completion/completions vinstall misc/emacs/go-mode-load.el 644 usr/share/emacs/site-lisp vinstall misc/emacs/go-mode.el 644 usr/share/emacs/site-lisp From 807a9b1aa8aa38b07bf5fc343af68b31dd65c326 Mon Sep 17 00:00:00 2001 From: Dominik Honnef Date: Tue, 1 Jul 2014 16:18:30 +0200 Subject: [PATCH 3/4] go: change maintainer --- srcpkgs/go/template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srcpkgs/go/template b/srcpkgs/go/template index 2cf7d887f0..9d430ab615 100644 --- a/srcpkgs/go/template +++ b/srcpkgs/go/template @@ -6,7 +6,7 @@ wrksrc=go hostmakedepends="mercurial ca-certificates" depends="perl" short_desc="The Go Programming Language" -maintainer="Juan RP " +maintainer="Dominik Honnef " homepage="http://golang.org/" license="BSD" distfiles="http://golang.org/dl/go${version}.src.tar.gz" From 486cda309f09b11e8f96a91bcebfc5daf85bd07d Mon Sep 17 00:00:00 2001 From: Dominik Honnef Date: Tue, 1 Jul 2014 16:24:49 +0200 Subject: [PATCH 4/4] go: build for all supported OSs --- srcpkgs/go/template | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/srcpkgs/go/template b/srcpkgs/go/template index 9d430ab615..d7e739e4bf 100644 --- a/srcpkgs/go/template +++ b/srcpkgs/go/template @@ -36,21 +36,25 @@ do_build() { export GOROOT=$PWD export GOROOT_FINAL="/usr/lib/go" - export GOOS=linux + export GOOS= + export GOARCH= export GOPATH=/tmp mkdir -p $GOPATH/src cd src - # TODO We could very well also build windows and darwin - # cross-compilers here, at no added complexity - - # Build ARM, x86 and x86_64 compilers - for arch in arm 386 amd64; do - export GOARCH=$arch - bash make.bash --no-clean + GOOS=linux + GOARCH=arm + bash make.bash --no-clean + for os in darwin freebsd linux windows; do + for arch in 386 amd64; do + GOARCH=$arch + GOOS=$os + bash make.bash --no-clean + done done + GOOS=linux GOARCH=$targetarch hg clone -u release-branch.go${version} \