Source: golang Version: 1.4.2-2 Severity: wishlist It would be nice to have Go on arm64. Upstream has it. According to https://github.com/golang/go/milestones they are aiming to release 1.5 around Jul 31 so perhaps you'll want to wait till then, or perhaps a 1.5~pre would be a good idea at some point.
If anyone is keen for a preview, the following recipe seems to work. However, I have not checked it on any other architectures and I have not checked the upstream issue tracker to see if this version has any known major problems. Also, check the attached patch for "xx". # Refer to http://build.golang.org/ and pick a commit that did not # fail any critical tests, for example 71274e485715. # On a Debian system which has golang, for example amd64: sudo apt-get build-dep golang sudo apt-get install golang git mkdir /tmp/go1 cd /tmp/go1 git clone https://go.googlesource.com/go cd go/src git checkout 71274e485715 export GOROOT_BOOTSTRAP=/usr/lib/go GOOS=linux GOARCH=arm64 ./bootstrap.bash scp ../../go-linux-arm64-bootstrap.tbz ... # On a Debian unstable arm64 system: sudo apt-get build-dep golang sudo apt-get install golang git mkdir /tmp/go1 /tmp/go2 cd /tmp/go1 tar xjf .../go-linux-arm64-bootstrap.tbz cd /tmp/go2 wget http://http.debian.net/debian/pool/main/g/golang/golang_1.4.2-2.debian.tar.xz git clone https://go.googlesource.com/go cd go git checkout 71274e485715 tar xJf ../golang_1.4.2-2.debian.tar.xz patch -p1 < .../golang-1.5~pre20150504-1.patch export GOROOT_BOOTSTRAP=/tmp/go1/go-linux-arm64-bootstrap debian/rules gencontrol dpkg-buildpackage -b A slight problem with this recipe is that you must set GOROOT_BOOTSTRAP. Even if you have built and installed golang_1.5~pre20150504-1_all.deb, if you want to rebuild it using this recipe you have to set GOROOT_BOOTSTRAP=/usr/lib/go before running dpkg-buildpackage -b. Presumably that wouldn't happen on a buildd. So for this recipe to become a source package this would have to be fixed. Perhaps the fix is to add a line in debian/rules to set GOROOT_BOOTSTRAP, but I'm not sure about the right way to do it.
diff --git a/README b/README index e69de29..ccc9bd6 100644 --- a/README +++ b/README @@ -0,0 +1 @@ +xx diff --git a/VERSION b/VERSION index e69de29..c239c60 100644 --- a/VERSION +++ b/VERSION @@ -0,0 +1 @@ +1.5 diff --git a/debian/changelog b/debian/changelog index 867b3f4..dcac765 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +golang (2:1.5~pre20150504-1) unstable; urgency=medium + + * Unofficial experiment + + -- xx <[email protected]> Tue, 05 May 2015 12:00:00 +0000 + golang (2:1.4.2-2) unstable; urgency=medium * Move "go" and "gofmt" into "/usr/lib/go" and use alternatives to provide diff --git a/debian/control.base b/debian/control.base index 94e2823..965e205 100644 --- a/debian/control.base +++ b/debian/control.base @@ -13,7 +13,7 @@ Standards-Version: 3.9.6 Homepage: http://golang.org/ Package: golang-go -Architecture: i386 amd64 armel armhf +Architecture: i386 amd64 arm64 armel armhf Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, golang-src (>= ${source:Version}), golang-go-linux-${go:Hostarch} (= ${source:Version}) @@ -41,7 +41,7 @@ Replaces: golang-weekly-src, golang-go (<< 2:1-3~) Conflicts: golang-weekly-src Provides: golang-weekly-src Breaks: golang-go (<< 2:1-3~) -Architecture: i386 amd64 armel armhf +Architecture: i386 amd64 arm64 armel armhf Depends: ${shlibs:Depends}, ${misc:Depends} Description: Go programming language compiler - source files The Go programming language is an open source project to make diff --git a/debian/golang-src.install b/debian/golang-src.install index f245da9..f034ba5 100644 --- a/debian/golang-src.install +++ b/debian/golang-src.install @@ -1,3 +1,2 @@ src /usr/share/go/ test /usr/share/go/ -include /usr/share/go/ diff --git a/debian/rules b/debian/rules index b2545c2..87aa316 100755 --- a/debian/rules +++ b/debian/rules @@ -13,7 +13,7 @@ bindir := /bin # The variables $$os and $$arch can be used inside such a loop. FOR_GO_ARCH := for os in $$(echo linux freebsd windows darwin netbsd); do \ archs="amd64 386"; \ - [ "$$os" = "linux" ] || [ "$$os" = "freebsd" ] && archs="amd64 arm 386"; \ + [ "$$os" = "linux" ] || [ "$$os" = "freebsd" ] && archs="amd64 arm arm64 386"; \ for arch in $$(echo $$archs); do FOR_GO_ARCH_END := done; done @@ -50,14 +50,15 @@ gencontrol: cat debian/control.base >> debian/control.tmp ${FOR_GO_ARCH} \ BUILDARCHS=all; \ - [ "$$os" = "linux" ] && BUILDARCHS="i386 amd64 armel armhf"; \ + [ "$$os" = "linux" ] && BUILDARCHS="i386 amd64 arm64 armel armhf"; \ sed -e "s,@OS@,$$os,g; s,@ARCH@,$$arch,g; s,@BUILDARCHS@,$$BUILDARCHS,g" debian/control.cross >> debian/control.tmp; \ ${FOR_GO_ARCH_END} mv debian/control.tmp debian/control override_dh_install: -${FOR_GO_ARCH} \ - echo "pkg/$${os}_$${arch} /usr/lib/go/pkg/" > debian/golang-go-$$os-$$arch.install; \ + echo "pkg/include /usr/lib/go/pkg/" > debian/golang-go-$$os-$$arch.install; \ + echo "pkg/$${os}_$${arch} /usr/lib/go/pkg/" >> debian/golang-go-$$os-$$arch.install; \ [ "$$arch" = "amd64" ] && [ "$$os" = "linux" ] && echo "pkg/linux_amd64_race /usr/lib/go/pkg" >> debian/golang-go-$$os-$$arch.install; \ echo "golang-go-$$os-$$arch: arch-independent-package-contains-binary-or-object" > debian/golang-go-$$os-$$arch.lintian-overrides; \ ${FOR_GO_ARCH_END} @@ -72,14 +73,6 @@ override_dh_install: mv pkg/$$file $(CURDIR)/debian/golang-go/usr/lib/go/pkg/$$file; \ done dh_install --fail-missing - # Remove .syso files of the race detector; it is not used yet and the files are arch-dependent. - find $(CURDIR)/debian/golang-src/usr/share/go/src/runtime/race -type f -name '*.syso' -delete - # Remove Plan9 rc(1) scripts - find $(CURDIR)/debian/golang-src/usr/share/go/src -type f -name "*.rc" -delete - # Remove empty /usr/share/go/src from golang-go, it is provided by golang-src - find $(CURDIR)/debian/golang-go/usr/share/go/src -type d -delete - # Subsequently, /usr/share/go is empty, too, so remove - find $(CURDIR)/debian/golang-go/usr/share/go -type d -delete # For some reason, Go cross-compiles a handful of tools: {yacc,fix,api,vet,cgo}. # Delete those, as they cannot be ran anyway. # This is tracked upstream at https://code.google.com/p/go/issues/detail?id=5667 @@ -177,6 +170,8 @@ ifeq ($(DEB_BUILD_ARCH_CPU), i386) GOHOSTARCH := 386 else ifeq ($(DEB_BUILD_ARCH_CPU), amd64) GOHOSTARCH := amd64 +else ifeq ($(DEB_BUILD_ARCH_CPU), arm64) + GOHOSTARCH := arm64 else ifeq ($(DEB_BUILD_ARCH_CPU), arm) GOHOSTARCH := arm else ifeq ($(DEB_BUILD_ARCH_CPU), armhf) @@ -191,6 +186,10 @@ ifeq ($(DEB_HOST_ARCH_CPU), i386) else ifeq ($(DEB_HOST_ARCH_CPU), amd64) GOARCH := amd64 GOPREFIX := 6 +else ifeq ($(DEB_HOST_ARCH_CPU), arm64) + GOARCH := arm64 +# xx What is this "GOPREFIX"? + GOPREFIX := 6 else ifeq ($(DEB_HOST_ARCH_CPU), arm) GOARCH := arm GOPREFIX := 5

