Skip to content

Instantly share code, notes, and snippets.

@cdelorme
Created August 21, 2014 03:38
Show Gist options
  • Save cdelorme/2389a428959958b79cfc to your computer and use it in GitHub Desktop.
Save cdelorme/2389a428959958b79cfc to your computer and use it in GitHub Desktop.
#!/bin/bash
hg clone -u go1.3.1 https://code.google.com/p/go /tmp/go
(cd /tmp/go/src && GOROOT_FINAL="/usr/lib/go" ./make.bash)
mv /tmp/go /usr/lib/
mkdir -p /usr/share/doc/golang-doc /usr/share/go/
mv /usr/lib/go/src /usr/share/go/
mv /usr/lib/go/doc /usr/share/doc/golang-doc/html
mv /usr/lib/go/favicon.ico /usr/share/doc/golang-doc/
ln -sf /usr/share/go/src /usr/lib/go/src
ln -sf /usr/share/doc/golang-doc/html /usr/lib/go/doc
ln -sf /usr/lib/go/favicon.ico /usr/share/doc/golang-doc/favicon.ico
ln -sf /usr/lib/go/bin/go /usr/local/bin/go
ln -sf /usr/lib/go/bin/gofmt /usr/local/bin/gofmt
@cdelorme
Copy link
Author

Wheezy only comes with golang 1.0.2, and I wanted 1.3. The instructions on golangs website are limited to how to build it, not necessarily "install" it. I reproduced what the .deb package does currently, but with the newer version of the software. I left some of the extra files and folders in the mix, so it's probably a little less clean, but it's not my fault they haven't provided their own simplified install process.

I did not include the dependencies. You should probably prepare it with:

aptitude install devscripts build-essential
aptitude build-dep golang

Also, you can swap the tag -u go1.3.1 with release to get the latest release version instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment