Compiling

Build uhub from source with CMake.

Prerequisites

  • CMake 3.21 or newer
  • A C compiler — GCC, Clang or MinGW
  • OpenSSL 3.0+ or LibreSSL 3.4+ (TLS is mandatory)
  • SQLite3

Linux, macOS, BSD, Solaris

An out-of-tree build is recommended:

mkdir -p build && cd build
cmake ..
make -j
make install

Default install directories:

Binaries/usr/local/bin/
Configuration files/etc/uhub/
Plug-ins/usr/lib/uhub/
Manual pages/usr/share/man/man1/

Debian & Ubuntu

Install the dependencies:

sudo apt-get install cmake make gcc git libsqlite3-dev libssl-dev

Check out the source code:

git clone https://github.com/janvidar/uhub.git

Then build as described above.

Building against LibreSSL

If both OpenSSL and LibreSSL are installed, point CMake at the LibreSSL prefix:

cmake -DOPENSSL_ROOT_DIR=/path/to/libressl ..

The configure output prints the detected TLS provider, e.g. TLS provider: LibreSSL 3.5.3.

For a sanitizer build that catches bounds bugs, configure with -DCMAKE_C_FLAGS="-fsanitize=address -g -O1" and -DCMAKE_EXE_LINKER_FLAGS="-fsanitize=address".