···1-{stdenv, fetchurl, libX11, libXrandr}:
02stdenv.mkDerivation rec {
3 name = "sct";
4- buildInputs = [libX11 libXrandr];
5 src = fetchurl {
6 url = http://www.tedunangst.com/flak/files/sct.c;
7 sha256 = "01f3ndx3s6d2qh2xmbpmhd4962dyh8yp95l87xwrs4plqdz6knhd";
8-9- # Discussion regarding the checksum and the source code can be found in issue #17163
10- # The code seems unmaintained, yet an unknown (probably small change) in the code caused
11- # failed builds as the checksum had changed.
12- # The checksum is updated for now, however, this is unpractical and potentially unsafe
13- # so any future changes might warrant a fork of the (feature complete) project.
14- # The code is under public domain.
15-16 };
17- phases = ["patchPhase" "buildPhase" "installPhase"];
18- patchPhase = ''
19- sed -re "/Xlibint/d" ${src} > sct.c
20- '';
21- buildPhase = "gcc -std=c99 sct.c -o sct -lX11 -lXrandr -lm";
22- installPhase = ''
23- mkdir -p "$out/bin"
24- cp sct "$out/bin"
25- '';
26- meta = {
27- description = ''A minimal utility to set display colour temperature'';
28- maintainers = [stdenv.lib.maintainers.raskin];
29- platforms = with stdenv.lib.platforms; linux ++ freebsd ++ openbsd;
0030 };
31}