Skip to content

Building

Daniel S edited this page Apr 29, 2022 · 14 revisions

Prerequisite

To build this Project you will need git, go (>= 1.18) and if you want to build the frontend node and npm.

Building

Git

Make sure you have git installed or install it via your favorite packet manager.

sudo apt-get install git
brew install git
...

For Windows: https://git-scm.com/

Installing golang

Go to https://golang.org/doc/install for complete instructions. For Mac and Linux you can also use this script to install and setup go faster:

git clone https://github.com/udhos/update-golang
cd update-golang
sudo ./update-golang.sh

after installation check if the go command is available from your commandline.

Installing snd

Decide where you want your source files to be (I put mine in ~/src) and cd there. Then

git clone https://github.com/BigJk/snd
cd ./snd

Download all the dependencies for snd:

go mod tidy

Build snd:

cd ./cmd/app
go build -o ./../../snd -tags="%YOUR_BUILD_TAGS%"
cd ../../

%YOUR_BUILD_TAGS% should be a space separated list of optional features you want to enable.

  • ELECTRON: Launch a dedicated window for the frontend
  • LIBUSB: Enable direct usb printing via libusb-1.0
    • Requires pkg-config` and ```libusb-1.0 to be installed (sudo apt-get install libusb-1.0-0-dev / brew install libusb)
    • For windows check: https://github.com/google/gousb/issues/100
    • To see if libusb is found before building check the result of pkg-config --cflags libusb-1.0

Start snd:

./snd

The web interface is at http://localhost:7123. Don't worry if you are greeted with a not found message. You still need to setup the frontend.

Frontend

You can either download a pre-build version (that may be a bit behind) or build it yourself.

1. Pre-Build:

https://github.com/BigJk/snd/releases and check the latest frontend download

2. Build it yourself:

make sure node and npm are installed. Instructions can be found here.

cd ./frontend
npm i
npm run build

If the frontend was successfully build the not found should be gone after a browser reload.

Clone this wiki locally