Installing signal-cli on OpenBSD 7.2

For a while now I wanted to use signal-cli on OpenBSD. However, the only guides I could find on how to install it where outdated. So, after delaying it for a while, I decided to put all of them together, install the program and make a guide out of the process for those who are wanting to do the same.

Note: As is common practice, a shell command preceded by a “#” should be run as root or with equal privileges and one with a preceding “$” should be run as a normal user.

signal-cli

Adapted from https://www.unitedbsd.com/d/389-using-signal-cli-on-openbsd-68.

First of all run:

# pkg_add jdk gmake gcc

and choose jdk-17.

Installing the OpenBSD libmatthew fork

# git clone https://gitlab.com/h3artbl33d/libmatthew.git /usr/local/libmatthew

# export PATH=/usr/local/jdk-17/bin:/usr/local/jdk-17/jre/bin:$PATH

# export JAVA_HOME=/usr/local/jdk-17

# cd /usr/local/libmatthew

In the Makefile change jdk-1.8.0 to jdk-17 (lines 15, 23) and change line 13, “-source 1.5” to “-source 1.7”.

# gmake

# gmake install

# cd

# rm -rf /usr/local/libmatthew

Installing signal-cli itself

# cd /usr/local

# ftp https://github.com/AsamK/signal-cli/releases/download/v0.11.6/signal-cli-0.11.6-Linux.tar.gz

# tar -xzf signal-cli-0.11.6-Linux.tar.gz

# mv signal-cli-0.11.6 signal-cli

# ln -s /usr/local/signal-cli/bin/signal-cli /usr/local/bin/signal-cli

libsignal

For reference confer: https://github.com/AsamK/signal-cli/wiki/Provide-native-lib-for-libsignal. Make sure you have the dependencies as found in the previous link.

I had to addtionally run:

# pkg_add rust bash gsed protobuf

and I had to set my $LIBCLANG_PATH

$ export LIBCLANG_PATH=$(cd / && find ./ -name "*libclang.so*" | grep '/usr/local' | sed 's/\.//' | sed 's/libclang.*$//')

Determine the libsignal-client version (for example):

$ /usr/local/signal-cli/lib/libsignal-client-0.21.1.jar

then go to https://github.com/signalapp/libsignal/releases/ and download the Source-Code for that version (the following will assume you chose the .tar.gz option and downloaded it to your ~/Downloads directory). NOTE: It might also work by skipping the building process and just downloading the .so file, renaming it and copying it to the right location; that, however, I have not tested.

$ cd

$ mv Downloads/libsignal-0.21.1.tar.gz .

$ tar -xzf libsignal-0.21.1.tar.gz

$ mv libsignal-0.21.1 libsignal

$ cd libsignal

$ cd java

$ gsed -i "s/include ':android'//" settings.gradle

$ bash build_jni.sh desktop

$ cd ..

$ cd target/release

# zip -d /usr/local/signal-cli/lib/libsignal-client-0.21.1.jar libsignal_jni.so

# zip /usr/local/signal-cli/lib/libsignal-client-0.21.1.jar libsignal_jni.so

JDBC

This is for Java to be able to interface with a sqlite Database (in our case for retrieving and storing account data; as far as I know). For dependencies refer to: https://github.com/xerial/sqlite-jdbc/blob/master/CONTRIBUTING.md

I did not have to install additional packages; but you might have to.

The script needs the command gcc; which is egcc on OpenBSD. So run (if /usr/local/bin is in your $PATH):

# ln -s egcc /usr/local/bin/gcc

$ cd

$ git clone https://github.com/xerial/sqlite-jdbc

$ cd sqlite-jdbc

$ gmake native

# cp target/sqlite-3.40.1-OpenBSD-x86_64/libsqlitejdbc.so /usr/local/lib/

If you get an error when trying to link your device with signal-cli and that error is JDBC-related, ensure that the above path is in your Java $PATH or try:

# cp -R target/sqlite-3.40.1-OpenBSD-x86_64 /usr/local/lib

I do not know if it does something but might help :-]

CONGRATULATIONS

you have made it and should now have a working signal-cli. I will not guarantee that there are no steps missing; so: if something goes wrong, just fill in the required additional steps yourself.

Have a good chat.

useful Addtions

Make sure to put something like

export JAVA_HOME=/usr/local/jdk-17

into your .profile or a similar file. Otherwise make sure, that this variable is set before you run signal-cli.

Besides that, if you want to use the signal-cli dbus-daemon, then run

$ dbus-launch --exit-with-session signal-cli daemon

You might also want:

# pkg_add libqrencode

for generating a QR code from the linking-url you will be given from signal-cli.

Additionally, you might want to

# pkg_delete bash protobuf

CLI-Interface-Clients

For usability, you may want to consider using one of the following clients:

or use another one or write your own :-].