Contents
Building
Profanity uses the Meson build system. This page doesn't go into any detail about Meson, but describes the commands needed to build Profanity, and brief descriptions of the various stages.
You can either download the archive from the homepage or use git, a version control system, to get the latest code.
If you want to get the latest version from git you'll have to do:
git clone https://github.com/profanity-im/profanity
After obtaining the source code, use the following commands to build and install it with no options enabled
cd profanity
meson setup build_run
meson compile -C build_run
meson install -C build_run
The final step requires root privileges.
Various dependencies are required to install Profanity, the
meson setup build_run step will
fail if the minimum dependencies cannot be found.
To enable greater functionality, additional optional dependencies are required. Please read on for instructions for how to get the required and optional dependencies and how to enable different options.
The latest code in master is also kept up to date with development changes
to libstrophe, so a manual build of this library may also be needed
Dependencies
The package names below are from Ubuntu and may differ per distribution.
Build dependencies:
gcc
meson
pkg-config
Required dependencies:
Profanity uses libstrophe.
Profanity also requires development packages of:
ncurses
glib
libcurl
readline
sqlite3
Optional dependencies:
libnotify # Desktop notification support
libxss # Desktop idle time autoaway support
libotr # OTR support
libgpgme # PGP support
libsignal-protocol-c # OMEMO support
libgcrypt # OMEMO support (>= 1.7)
libenchant-2 # Spell check support
gtk3 # Desktop tray icon support
python # Python plugin support
cmocka # To run tests
shared-mime-info # Send files with the correct mime type
gdk-pixbuf2 # Scale the image for `/avatar set`
qrencode # Display OMEMO QR code
xscreensaver # Idle time detection
Distribution details:
To make it easier to install all the required packages in various distributions we collect copy pastes here. These are contributed to users and might be out of date. Feel free to create a pull request to improve this section.
Debian
apt-get install libcaca-dev libnotify-dev libgtk2.0-dev libotr5-dev libssl-dev libstrophe-dev pkg-config python3-dev libexpat1-dev libncursesw5-dev libglib2.0-dev libreadline-dev libgpgme11-dev libcurl4-gnutls-dev uuid-dev libcmocka-dev libgcrypt20-dev libsignal-protocol-c-dev libxss-dev libsqlite3-dev libgdk-pixbuf-2.0-dev libqrencode-dev libenchant-2-dev meson
openSUSE
zypper in gcc meson enchant-devel glib2-devel gtk2-devel libcmocka-devel libcurl-devel libexpat-devel libgpgme-devel libstrophe-devel libnotify-devel libotr-devel libuuid-devel ncurses-devel python3-devel readline-devel libsignal-protocol-c-devel libgcrypt-devel sqlite3-devel gdk-pixbuf-devel qrencode-devel
Alpine Linux (Edge)
apk add build-base meson enchant2-dev libtool pkgconf libmesode-dev ncurses-dev glib-dev curl-dev readline-dev libnotify-dev libxscrnsaver libotr-dev gpgme-dev libsignal-protocol-c-dev libgcrypt-dev gtk+3.0-dev python3-dev cmocka-dev
Note that some of the packages for Alpine Linux are only available in the "testing" repository
Arch Linux
pacman -S --needed base-devel cairo check cmake cmocka curl doxygen expat gcc git gdk-pixbuf2 gpgme gtk3 libcurl.so libgcrypt libgpg-error libncursesw.so libnotify libotr libsignal-protocol-c libstrophe.so libtool libx11 libxss meson openssl pkg-config python qrencode sqlite wget
Fedora
dnf install enchant2-devel expect-devel gcc git glib2-devel glibc-all-langpacks gtk3-devel libXScrnSaver-devel libcmocka-devel libcurl-devel expat-devel libgcrypt-devel gpgme-devel libmicrohttpd-devel libnotify-devel libotr-devel libsignal-protocol-c-devel libtool libuuid-devel meson ncurses-devel python3 python3-devel readline-devel openssl-devel sqlite-devel gdk-pixbuf2-devel qrencode-devel libstrophe-devel
Mac OS
brew install cmocka gettext glib gpgme gtk+3 libomemo-c libotr libstrophe libxscrnsaver meson ninja pkgconf python@3.14 qrencode readline sqlite terminal-notifier
Some required packages are "keg-only", which means they are not symlinked into /usr/local, therefore pkg-config will fail when detecting the libraries and the build will fail. In order to fix this we need to add these packages to the PKG_CONFIG_PATH.
export PKG_CONFIG_PATH="/usr/local/opt/ncurses/lib/pkgconfig:$PKG_CONFIG_PATH"
export PKG_CONFIG_PATH="/usr/local/opt/expat/lib/pkgconfig:$PKG_CONFIG_PATH"
export PKG_CONFIG_PATH="/usr/local/opt/curl/lib/pkgconfig:$PKG_CONFIG_PATH"
export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig:$PKG_CONFIG_PATH"
export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig:$PKG_CONFIG_PATH"
OpenBSD
pkg_add meson cmake gmake cmocka pkgconf readline python-3.12.11 libstrophe curl gpgme glib2 gtk+3 libotr libassuan libgpg-error libgcrypt libsignal-protocol-c sqlite3 enchant2
Explanations:
Profanity is built using the Meson build system.
Input files
meson.build – Definitions to setup profanity to build for the target environment
meson_options.txt – Default settings for input options
These files are the inputs to generating the actual build definitions to compile Profanity.
Preparing for compilation
Once all needed dependencies are installed, setup a minimal build by using
meson setup build_run
This will result in an out of source build directory build_run being
created.
Build Options
Meson requires features to be explicitly enabled.
Nothing is auto-enabled; if you want a feature, you must pass the
corresponding -Doption=enabled flag.
The system libstrophe is used by default; if you instead want to
automatically download and link against libstrophe HEAD from upstream
Git, provide -Dforce_fallback_for=libstrophe flag.
| Feature | Description | Meson option |
|---|---|---|
| Notifications | Desktop notifications support | -Dnotifications=enabled |
| Python Plugins | Support for Python plugins | -Dpython-plugins=enabled |
| C Plugins | Support for C plugins | -Dc-plugins=enabled |
| OTR | Off-the-Record encryption | -Dotr=enabled |
| PGP | PGP encryption support | -Dpgp=enabled |
| OMEMO | OMEMO encryption support | -Domemo=enabled |
| OMEMO Backend | Select OMEMO backend library | -Domemo-backend=libsignal\|libomemo-c |
| QR Code | OMEMO QR code display | -Domemo-qrcode=enabled |
| Icons/Clipboard | GTK tray icons & clipboard | -Dicons-and-clipboard=enabled |
| GDK Pixbuf | Avatar scaling support | -Dgdk-pixbuf=enabled |
| XScreenSaver | Idle time detection | -Dxscreensaver=enabled |
| Spellcheck | Check spelling | -Dspellcheck=enabled |
| Tests | Build unit tests | -Dtests=true |
| Sanitizers | Run-time error detection | -Db_sanitize=address,undefined |
Selecting OMEMO Backend
When building with OMEMO support enabled, you can choose between two
backend libraries: - libsignal: The default backend using
libsignal-protocol-c. - libomemo-c: An
alternative backend using libomemo-c.
Example of choosing the libomemo-c backend:
meson setup build_run -Domemo=enabled -Domemo-backend=libomemo-c
Compiling
The following step will then compile Profanity:
meson compile -C build_run
To clean the build directory before recompiling use:
meson compile --clean -C build_run
Tests
All (functional and unit) tests can be run with:
meson test -C build_run
Unit tests can be run with:
meson test -C build_run "unit tests"
Install
Once you have compiled profanity, the executable can be run using:
./build_run/profanity
To install this version on your system, i.e. to be able to run it from anywhere:
sudo meson install -C build_run
This step is not really necessary when doing development (i.e. you can always run the version just compiled in the project directory), unless you want to have your development version available to any users on your system.