1{ lib, stdenv, fetchFromGitHub, libX11, libXScrnSaver, libXext, glib, dbus, pkg-config, systemd }:
2
3stdenv.mkDerivation {
4 pname = "lightum";
5 version = "unstable-2014-06-07";
6
7 src = fetchFromGitHub {
8 owner = "poliva";
9 repo = "lightum";
10 rev = "123e6babe0669b23d4c1dfa5511088608ff2baa8";
11 sha256 = "sha256-dzWUVY2srgk6BM6jZ7FF+snxnPopz3fx9nq+mVkmogc=";
12 };
13
14 nativeBuildInputs = [ pkg-config ];
15
16 buildInputs = [
17 dbus
18 glib
19 libX11
20 libXScrnSaver
21 libXext
22 systemd
23 ];
24
25 patchPhase = ''
26 substituteInPlace Makefile \
27 --replace "libsystemd-login" "libsystemd"
28 '';
29
30 installPhase = ''
31 make install prefix=$out bindir=$out/bin docdir=$out/share/doc \
32 mandir=$out/share/man INSTALL="install -c" INSTALLDATA="install -c -m 644"
33 '';
34
35 meta = {
36 description = "MacBook automatic light sensor daemon";
37 homepage = "https://github.com/poliva/lightum";
38 license = lib.licenses.gpl2;
39 maintainers = with lib.maintainers; [ puffnfresh ];
40 platforms = lib.platforms.linux;
41 };
42}