Skip to content

Building from source

yindra edited this page Sep 27, 2019 · 8 revisions

Introduction

This document describes how to build the source code using the Go toolchain.

Pat is dependent on some C libraries, so a C compiler (gcc/clang) must be available in addition to the Go toolchain.

Requirements

  • Git
  • Latest stable Go (>=1.5) with cgo enabled
  • A configured GOPATH

The fast route

If you're building with Go 1.5, be sure to export GO15VENDOREXPERIMENT=1 before running go get. This is not needed with Go 1.6 or later.

$ go get -u github.com/la5nta/pat

go get will download the latest release of Pat (including dependencies), build and install the binary at $GOPATH/bin/pat.

The long route

The source code must live inside your Go workspace ($GOPATH). Clone the repository to $GOPATH/src/github.com/la5nta/pat:

git clone https://github.com/la5nta/pat $GOPATH/src/github.com/la5nta/pat
cd $GOPATH/src/github.com/la5nta/pat

The master branch is the stable branch for Pat, this is where you'll find the latest released Pat version.

Initialize and update all git submodules:

$ git submodule update --init --recursive

Linux only: download and build libax25

$ ./make.bash libax25

Build using the make.bash-script:

$ ./make.bash

The build output is ./pat which is a self-contained binary.

Build tags

Build tags can be used to enable additional features for the build:

  • libhamlib: Link against libhamlib for serial/usb rig control (no rigctld required).
  • libax25: Link against libax25 to enable Linux's AX.25 implementation.

To enable both features when using go get:

$ go get -tags 'libax25 libhamlib' github.com/la5nta/pat

make.bash uses the $TAGS environment variable for this purpose:

$ TAGS="libax25 libhamlib" ./make.bash

Debian packaging

dpkg-buildpackage -d -us -uc
You can’t perform that action at this time.