Skip to content

Compiling from source

Daniel Kondor edited this page Sep 21, 2024 · 2 revisions

Get the sources

Latest sources are available in the git repositories (note that you need both, since the plugins provide essential functionality):
https://github.com/Cairo-Dock/cairo-dock-core
https://github.com/Cairo-Dock/cairo-dock-plug-ins

Download them with git:

git clone https://github.com/Cairo-Dock/cairo-dock-core.git
git clone https://github.com/Cairo-Dock/cairo-dock-plug-ins.git

this will create two subdirectories, cairo-dock-core and cairo-dock-plug-ins. To update them, run the following command in both:

git pull

To switch to an older version (e.g. the latest stable version):

git checkout 3.5.1

To switch back to the latest (likely beta / development) version:

git checkout master

Install the dependencies

Compilation tools:

required: cmake make pkg-config gettext gcc g++ (or any other C / C++ compiler)
optional, for Wayland support: extra-cmake-modules wayland-scanner wayland-protocols
optional, for some plugins: valac python3

Libraries for the core:

required: gtk+-3.0 glib-2.0 gthread-2.0 cairo librsvg-2.0 dbus-1 dbus-glib-1 libxml-2.0 xrender gl glu egl libcurl xtst xcomposite xrandr
optional, for Wayland support: libwayland-dev nlohmann-json gtk-layer-shell

Libraries for the plugins:

Required: cairo librsvg-2.0 dbus-1 dbus-glib-1 libxml-2.0 glib-2.0
Highly Recommended: libalsa libetpan libgnome-menu3 gio-2.0 libxklavier xrandr x11 xxf86vm
gvfs upower-glib zeitgeist-1.0 libexif vte(-2.90) lm_sensors curl wget dbusmenu-glib(-0.4) dbusmenu-gtk(3)(-0.4)
Suggested: ayatana-indicator3 libayatana-ido3 libical libpulse webkitgtk-3.0 ayatana-indicator-messages ayatana-indicator-sound
Optional: fftw3

On recent Debian / Ubuntu, these can be installed with the following command:

sudo apt install cmake make pkg-config gcc g++ gettext build-essential libglib2.0-dev libcairo2-dev librsvg2-dev libdbus-glib-1-dev libxml2-dev libxrender-dev libglu1-mesa-dev libpango1.0-dev libxxf86vm-dev libxtst-dev libxrandr-dev libx11-dev libcurl4-gnutls-dev libgtk-3-dev libdbusmenu-gtk3-dev libasound2-dev libgnome-menu-3-dev libetpan-dev libxklavier-dev libwebkit-dev libexif-dev libvte-2.90-dev libzeitgeist-dev libayatana-ido3-dev libayatana-indicator3-dev libsensors4-dev libupower-glib-dev wget curl extra-cmake-modules libwayland-bin libwayland-dev libegl-dev wayland-protocols valac python3 libgtk-layer-shell-dev nlohmann-json3-dev

Compiling the core

cd cairo-dock-core
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release -Denable-desktop-manager=True
make # or e.g. make -j 4 on a quad-core CPU
sudo make install # as root 
cd ../..

This will install Cairo-Dock and related data under /usr/local with all features (if available). Some useful options:

  • -DCMAKE_BUILD_TYPE=Debug to compile with debug symbols
  • -Denable-desktop-manager=[True/False] whether to install files for a "desktop session" that can be selected from the login manager (uses X11, either Compiz or Metacity and components from gnome-session)
  • -Denable-systemd-service=[True/False] whether to install a Systemd service file (disabled by default) that can be used to auto-start Cairo-Dock
  • -Denable-wayland-support=[True/False] whether to enable Wayland support at all
  • -Denable-wayland-protocols=[True/False] whether to enable Wayland protocols such as foreign-toplevel-management that are required for the taskbar functionality
  • -Denable-egl-support=[True/False] whether to compile support for EGL (required for OpenGL on Wayland, can be used on X11)
  • -Denable-x11-support=[True/False] whether to enable support for X11 specific features at all
  • -Denable-glx-support=[True/False] whether to compile support for GLX (can be used for OpenGL on X11)
  • -Denable-gtk-layer-shell=[True/False] whether the enable using gtk-layer-shell (required for positioning docks on Wayland)

After running cmake, a summary will be printed with compilation options that will be used (and some issues, e.g. if a library is not found). Note that not finding an optional library will not result in an error, just disable the component that requires it.

Compiling the plugins

cd cairo-dock-plug-ins
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make # or e.g. make -j 4 on a quad-core CPU
sudo make install # as root and if you had no errors
cd ../..