summary refs log tree commit diff
path: root/pkgs/tools/X11/sct/default.nix
blob: 3f6291417e59012159043c36acdbbd311c3d8b46 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{ stdenv, fetchurl, libX11, libXrandr }:

stdenv.mkDerivation rec {
  name = "sct";

  src = fetchurl {
    url = "http://www.tedunangst.com/flak/files/sct.c";
    sha256 = "01f3ndx3s6d2qh2xmbpmhd4962dyh8yp95l87xwrs4plqdz6knhd";
  };

  unpackPhase = "cat ${src} > sct.c";
  patches = [ ./DISPLAY-segfault.patch ];

  buildInputs = [ libX11 libXrandr ];
  buildPhase = "cc sct.c -o sct -lm -lX11 -lXrandr";

  installPhase = "install -Dt $out/bin sct";

  meta = with stdenv.lib; {
    homepage = "https://www.tedunangst.com/flak/post/sct-set-color-temperature";
    description = "A minimal utility to set display colour temperature";
    maintainers = [ maintainers.raskin ];
    license = licenses.publicDomain;
    platforms = with platforms; linux ++ freebsd ++ openbsd;
  };
}