Golang – setup and producing .debs

Here’s the setup I use for compiling Go binaries, as well as for writing .deb’s to package them and markdown for README’s – notes for me.

Install build pre-requisites:

sudo aptitude install gcc libc6-dev libc6-dev-i386 make \
  markdown build-essential debhelper dh-make fakeroot devscripts

Install Go from source (so can cross-compile). Download from Go Downloads eg go1.0.2.src.tar.gz

sudo tar -C /usr/local -xzf go1.0.2.src.tar.gz ; cd /usr/local/go/src
sudo GOARCH=amd64 ./all.bash ; sudo GOARCH=386 ./all.bash

Add to /etc/profile, source or re-login:

export GOROOT="/usr/local/go"
export PATH="$GOROOT/bin:$PATH"
Tags: , ,

Share This


Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>