2019-07-04 16:34:40 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub
|
2021-01-17 02:09:27 +00:00
|
|
|
, dbus, cmake, pkg-config, bash-completion
|
2019-10-02 01:37:58 +00:00
|
|
|
, gsl, popt, clightd, systemd, libconfig, libmodule
|
2019-07-04 16:34:40 +00:00
|
|
|
, withGeoclue ? true, geoclue2
|
|
|
|
, withUpower ? true, upower }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "clight";
|
2021-08-22 16:39:56 +00:00
|
|
|
version = "4.7";
|
2019-07-04 16:34:40 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "FedeDP";
|
|
|
|
repo = "Clight";
|
|
|
|
rev = version;
|
2021-08-22 16:39:56 +00:00
|
|
|
sha256 = "sha256-+u50XorUyeDsn4FaKdD0wEtQHkwtiyVDY0IAi0vehEQ=";
|
2019-07-04 16:34:40 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# dbus-1.pc has datadir=/etc
|
|
|
|
SESSION_BUS_DIR = "${placeholder "out"}/share/dbus-1/services";
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
sed -i "s@/usr@$out@" CMakeLists.txt
|
|
|
|
sed -i "s@/etc@$out\0@" CMakeLists.txt
|
|
|
|
sed -i "s@pkg_get_variable(SESSION_BUS_DIR.*@set(SESSION_BUS_DIR $SESSION_BUS_DIR)@" CMakeLists.txt
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
dbus
|
|
|
|
cmake
|
2021-01-17 02:09:27 +00:00
|
|
|
pkg-config
|
2019-07-04 16:34:40 +00:00
|
|
|
bash-completion
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = with lib; [
|
|
|
|
gsl
|
|
|
|
popt
|
|
|
|
upower
|
|
|
|
clightd
|
|
|
|
systemd
|
|
|
|
geoclue2
|
|
|
|
libconfig
|
2019-10-02 01:37:58 +00:00
|
|
|
libmodule
|
2019-07-04 16:34:40 +00:00
|
|
|
] ++ optional withGeoclue geoclue2
|
|
|
|
++ optional withUpower upower;
|
|
|
|
|
2021-02-07 02:59:39 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
# bash-completion.pc completionsdir=${bash-completion.out}
|
|
|
|
"-DBASH_COMPLETIONS_DIR=${placeholder "out"}/share/bash-completions/completions"
|
|
|
|
"-DZSH_COMPLETIONS_DIR=${placeholder "out"}/share/zsh/site-functions"
|
|
|
|
];
|
|
|
|
|
2019-07-04 16:34:40 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "A C daemon that turns your webcam into a light sensor";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/FedeDP/Clight";
|
2019-07-04 16:34:40 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
license = licenses.gpl3;
|
|
|
|
maintainers = with maintainers; [
|
|
|
|
eadwu
|
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|