Skip to content
This repository was archived by the owner on Jun 17, 2022. It is now read-only.

Build from source

Jacob Marble edited this page Sep 28, 2015 · 29 revisions

Get ready

Linux

We regularly develop and test with Ubuntu 14.04. Release binaries are built with Debian 7 and Raspbian 7.

Install Go. Don't use your distribution's package because it's either out of date, or will be soon. In particular, Go >= 1.4 is required to build. To check what version of Go you have:

$ go version
go version go1.5.1 linux/arm

Install a few dev packages. The connector uses:

  • build tools to interface with C libraries via cgo
  • CUPS to, you know, print
  • Net-SNMP to collect extra status info directly from printers
  • Avahi to announce it's presence via mDNS/DNS-SD
  • git to clone the GitHub repository

If your distro is based on Debian (Ubuntu, Raspbian, Mint, others) then this one-liner will get all dependencies:

$ sudo apt-get install build-essential libcups2-dev libsnmp-dev libavahi-client-dev git

Fedora 22:

sudo dnf install gcc cups-devel avahi-devel net-snmp-devel

OS X

Install XCode: https://itunes.apple.com/us/app/xcode/id497799835

Install the command line developer tools:

$ xcode-select --install

Accept the license agreement:

$ xcodebuild -license

Other operating systems

It should work on any BSD, but no one has tried yet. If you try, let us know with GitHub issue.

The CUPS Connector is incompatible with Windows. Maybe some day.

Build

$ go get github.com/google/cups-connector/...

You should now have two new binaries: gcp-cups-connector and gcp-cups-connector-util.

Compiling Go

If you need to install Go from source (because there isn't a Go binary for your platform at https://golang.org/dl) then this might help. You will need:

  • git, to clone the GitHub repository
  • C toolchain, to compile the Go compiler

If your Linux distro is based on Debian (Ubuntu, Raspbian, Mint, others):

$ sudo apt-get install git build-essential

Install the Go programming language version 1.4

$ git clone https://go.googlesource.com/go ~/go1.4
$ cd ~/go1.4/src
$ git checkout go1.4.3
$ ./all.bash

Install the Go programming language version 1.5 (this requires Go 1.4; long story)

$ git clone https://go.googlesource.com/go ~/go1.5
$ cd ~/go1.5/src
$ git checkout go1.5.1
$ ./all.bash

Configure Go

$ echo ‘export GOPATH=$HOME/go’ >> ~/.profile
$ echo ‘PATH="$PATH:$HOME/go1.5/bin:$GOPATH/bin">> ~/.profile
$ source ~/.profile
$ go version
go version go1.5.1 linux/arm

Clone this wiki locally