Skip to content
Federico Di Pierro edited this page Sep 21, 2023 · 27 revisions

Build time switches:

  • ENABLE_GAMMA=1 (to enable gamma support)
  • ENABLE_DPMS=1 (to enable dpms support)
  • ENABLE_DDC=1 (to enable ddcutil support)
  • ENABLE_SCREEN=1 (to enable screen emitted backlight computation support, X only)
  • ENABLE_YOCTOLIGHT=1 (to enable YoctoLight ALS devices support)
  • ENABLE_PIPEWIRE=1 (to enable Pipewire camera sensor). Technical preview.

Build deps

  • libsystemd >= 221 or elogind
  • libudev or libeudev
  • libmodule 5.x (module/module_easy.h, module/modules_easy.h, module/map.h)
  • libjpeg-turbo (jpeglib.h)
  • polkit-gobject-1
  • dbus-1 (needed to let pkg-config find SESSION_BUS_DIR variable)
  • cmake >= 3.5
  • gcc or clang
  • pkg-config

Needed only if built with gamma support:

  • libxrandr
  • libx11
  • libwayland
  • libdrm
  • wayland-scanner

Needed only if built with dpms support:

  • libxext
  • libx11
  • libwayland
  • libdrm
  • wayland-scanner

Needed only if built with screen support:

  • libx11
  • libwayland
  • wayland-scanner

Needed only if built with ddcutil support:

  • ddcutil >= 0.9.5

Needed only if built with Yoctolight sensor support:

  • libusb1

Needed only if built with Pipewire sensor support:

  • libpipewire-0.3

Runtime deps:

  • shared objects from build libraries
  • polkit

Build instructions:

NOTE: Clightd is NOT API-compatible with libmodule master. Please use latest 5.x tag!

Install needed dependencies;
On Debian based distros:

$ sudo apt install build-essential pkg-config cmake libsystemd-dev libxrandr-dev libxext-dev policykit-1 libpolkit-gobject-1-dev libjpeg-dev libusb-dev libwayland-dev libdrm-dev libddcutil-dev libusb-1.0-0-dev libudev-dev

If libddcutil-dev is missing, you need to manually build and install it from source to support external monitors.

On Fedora:

$ sudo dnf install @development-tools cmake systemd-devel libXrandr-devel libXext-devel polkit-devel libjpeg-turbo-devel libusb1-devel wayland-devel libdrm-devel ddcutil-lib dbus-devel

On OpenSuse:

$ sudo zypper install --type pattern devel_basis
$ sudo zypper install cmake systemd-devel libXrandr-devel libXext-devel polkit-devel libjpeg-turbo-devel libusb-1_0-devel wayland-devel libdrm-devel libddcutil3 dbus-1-devel

If ddcutil-lib is missing, you need to manually build and install it from source to support external monitors.


Plus, you have to manually install libmodule and, where missing ddcutil from sources.

Then, to build clightd, you just need to issue a:

$ mkdir build
$ cd build
$ cmake \
    -G "Unix Makefiles" \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_INSTALL_LIBDIR=lib \
    -DCMAKE_BUILD_TYPE="Release" \
    -DENABLE_DDC=1 -DENABLE_GAMMA=1 -DENABLE_DPMS=1 -DENABLE_SCREEN=1 -DENABLE_YOCTOLIGHT=1 \
    ..
$ make

Installation - Generic OS

# make install

Installation - Red Hat

$ cpack -G RPM

And finally install generated RPM package.

Installation - Debian / Ubuntu

$ cpack -G DEB

And finally install generated DEB package.

Uninstallation

To uninstall Clightd, since CMake does not offer an uninstall target, you can run:

xargs rm < install_manifest.txt

from within the build folder.
Relevant stackoverflow thread: https://stackoverflow.com/questions/41471620/cmake-support-make-uninstall.