Gomuks - xbps-src template for Void Linux

2021-03-23

(last time edited: 2021-03-26)

tags: chat, matrix, terminal

Gomuks

Gomuks is a terminal Matrix client written in Go using mautrix and mauview, made by tulir.

blogimg

To simplify some jobs you might need to install xtools.

# xbps-install xtools

Then clone all the void-packages templates repository in your home directory.

$ git clone https://github.com/void-linux/void-packages.git ~/void-packages

Update your void-packages dir regularly, if you just cloned it right now there is no need to do so.

$ git pull -C ~/void-packages

Change directory.

$ cd ~/void-packages

Download/update the binary bootstrap.

$ ./xbps-src bootstrap-update

$ ./xbps-src binary-bootstrap

Create a new template.

$ xnew gomuks

Add the following text in the template.

# Template file for 'gomuks'
pkgname=gomuks
version=0.2.3
revision=1
build_style="go"
go_import_path="maunium.net/go/gomuks"
makedepends="olm-devel"
short_desc="Terminal Matrix client written in Go"
maintainer="me <me@me.com>"
license="AGPL-3.0-or-later"
homepage="https://maunium.net/go/gomuks"
distfiles="https://github.com/tulir/${pkgname}/archive/v${version}.tar.gz"
checksum="a21dc27175abe1f6ec220dda71cec69f6abc982f60237e35100a366934fd9185"

do_install() {
    vbin _build-gomuks-xbps/bin/gomuks
}

Save and run xlint on the template to check for any errors. Templates are stored in this way void-packages/src/$pkg/template.

$ xlint /path/to/template

If you take a look at the template, I managed to get the SHA256 checksum manually by running sha256sum on the .tar file. Yes it could also be obtained using xgensum gomuks but I like doing it manually and then pasting it on the template.

Now let's build. xbps-src will start downloading dependencies and start building, it might take some time depending on your CPU.

$ ./xbps-src pkg gomuks

Since everything was done correctly now I wanna install the package on my system. Do this inside the void-packages directory.

$ xi gomuks

or which is the same but longer and requires your user to be in the sudoers file:

$ sudo xbps-install --repository=~/void-packages/hostdir/binpkgs gomuks

You can now run gomuks in your virtual terminal by just running:

$ gomuks

Happy chatting!