-
Notifications
You must be signed in to change notification settings - Fork 27
Build
Please note that at least on Ubuntu and Fedora, -devel packages are splitted from their main package. You'll need them.
Remember to install your distro devel packages too, eg: build-essential
on Ubuntu or base-devel
on arch.
- libsystemd >= 234 (systemd/sd-bus.h) or elogind (elogind/sd-bus.h)
- libpopt (popt.h)
- gsl (gsl/gsl_multifit.h, gsl/gsl_statistics_double.h)
- libconfig (libconfig.h)
- libmodule >= 5.0.0
- gcc or clang
- cmake >= 3.5
- pkg-config
- dbus-1 (needed to let pkg-config find SESSION_BUS_DIR variable)
- bash-completion (needed only if you wish to have a bash completion script for clight)
- systemd (to fetch some systemd unit related variables)
- libsystemd
- libpopt
- gsl
- libconfig
- libmodule
- Clightd >= 5.0
- Geoclue2 to automatically retrieve user location (no geoclue and no user position specified will disable GAMMA support)
-
Upower to honor timeouts between captures, to use different ambient brightness -> screen backlight matching coefficients, to change dimmer timeout and to change dpms timeouts depending on ac state.
It is also used to add support for keyboard backlight.
Please note that libmodule must be built from source, where it is not packaged!
Install needed dependencies;
On Ubuntu:
$ sudo apt install build-essential cmake libsystemd-dev libpopt-dev libconfig-dev libgsl-dev
On Fedora:
$ sudo dnf install @development-tools cmake systemd-devel popt-devel libconfig-devel gsl-devel
On OpenSuse:
$ sudo zypper install --type pattern devel_basis
$ sudo zypper install cmake systemd-devel popt-devel libconfig-devel gsl-devel
Then, to build clight 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" \
..
$ make
# make install
$ cpack -G RPM
And finally install generated RPM package.
$ cpack -G DEB
And finally install generated DEB package.
That's it.
OpenSuse offers Clight in its repositories; to install it:
- Go to “Clight” page at: https://software.opensuse.org/package/Clight
- Select your distro version
- Click on “display experimental package”
- Click on “one click installation”
- Accept opening one click file with Yast
- Accept all steps by clicking “Next” and finally “Terminate”
Warning : you must fill the root password blindly, be cautious.
If you type the wrong password then just abandon the procedure and repeat it.
This procedure installs bot Clight and Clightd; moreover, it adds a new hardware
repo.
As both Clight and Clightd depend upon libmodule, and Clightd depends upon ddcutil too, user brianread108 developed a tiny build script that automatically manages all dependencies:
#!/bin/sh
echo "Building Clight and its dependencies..."
###########################################################
# To build from latest release instead of -devel version, #
# Comment out following lines and uncomment the next ones #
###########################################################
echo "* Getting Sources from git "
git clone https://github.com/FedeDP/Clight.git
git clone https://github.com/FedeDP/Clightd.git
git clone https://github.com/FedeDP/libmodule.git
git clone https://github.com/rockowitz/ddcutil.git
###########################################################
# To build from latest release, uncomment following lines #
# If needed, update tag name #
###########################################################
# echo "* Getting Sources from latest tags "
# git clone -b '4.0' --single-branch --depth 1 https://github.com/FedeDP/Clight.git
# git clone -b '4.0' --single-branch --depth 1 https://github.com/FedeDP/Clightd.git
# git clone -b '5.0.0' --single-branch --depth 1 https://github.com/FedeDP/libmodule.git
# git clone -b 'v0.9.7' --single-branch --depth 1 https://github.com/rockowitz/ddcutil.git
cd ddcutil
echo "* Building ddcutil"
./autogen.sh
./configure --prefix=/usr
make
sudo make install
cd ..
cd libmodule
echo "* Building Libmodule"
mkdir build
cd build
cmake \
-G "Unix Makefiles" \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_BUILD_TYPE="Release" \
..
make
sudo make install
cd ../..
cd Clightd
echo "* Building clightd"
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_SCREEN=1 -DENABLE_DPMS=1 \
..
make
sudo make install
cd ../..
cd Clight
echo "* Building clight"
mkdir build
cd build
cmake \
-G "Unix Makefiles" \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_BUILD_TYPE="Release" \
..
make
sudo make install
echo "Done...Enjoy Clight!"