2015-09-29 03:18:16 +02:00
|
|
|
{ fetchurl, stdenv, gettext, intltool, makeWrapper, pkgconfig
|
|
|
|
, geoclue
|
|
|
|
, guiSupport ? true, gtk3, python, pygobject3, pyxdg
|
|
|
|
, drmSupport ? true, libdrm
|
|
|
|
, randrSupport ? true, libxcb
|
|
|
|
, vidModeSupport ? true, libX11, libXxf86vm
|
2015-07-26 23:22:12 +02:00
|
|
|
}:
|
2011-01-25 00:52:22 +01:00
|
|
|
|
2015-07-26 23:22:12 +02:00
|
|
|
let
|
|
|
|
version = "1.10";
|
|
|
|
mkFlag = flag: name: if flag then "--enable-${name}" else "--disable-${name}";
|
|
|
|
in
|
2015-07-02 19:04:18 +02:00
|
|
|
stdenv.mkDerivation {
|
2013-10-26 19:15:57 +02:00
|
|
|
name = "redshift-${version}";
|
2011-01-25 00:52:22 +01:00
|
|
|
src = fetchurl {
|
2015-07-02 19:04:18 +02:00
|
|
|
sha256 = "19pfk9il5x2g2ivqix4a555psz8mj3m0cvjwnjpjvx0llh5fghjv";
|
|
|
|
url = "https://github.com/jonls/redshift/releases/download/v${version}/redshift-${version}.tar.xz";
|
2011-01-25 00:52:22 +01:00
|
|
|
};
|
|
|
|
|
2015-07-26 23:22:12 +02:00
|
|
|
buildInputs = [ geoclue ]
|
2015-09-29 02:01:33 +02:00
|
|
|
++ stdenv.lib.optionals guiSupport [ gtk3 python pygobject3 pyxdg ]
|
2015-09-28 21:23:24 +02:00
|
|
|
++ stdenv.lib.optionals drmSupport [ libdrm ]
|
|
|
|
++ stdenv.lib.optionals randrSupport [ libxcb ]
|
|
|
|
++ stdenv.lib.optionals vidModeSupport [ libX11 libXxf86vm ];
|
2015-07-26 23:22:12 +02:00
|
|
|
nativeBuildInputs = [ gettext intltool makeWrapper pkgconfig ];
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
(mkFlag guiSupport "gui")
|
|
|
|
(mkFlag drmSupport "drm")
|
|
|
|
(mkFlag randrSupport "randr")
|
|
|
|
(mkFlag vidModeSupport "vidmode")
|
2013-10-26 19:15:57 +02:00
|
|
|
];
|
|
|
|
|
2015-07-26 23:22:12 +02:00
|
|
|
preInstall = stdenv.lib.optionalString guiSupport ''
|
2015-09-29 03:18:16 +02:00
|
|
|
substituteInPlace src/redshift-gtk/redshift-gtk \
|
2015-07-02 19:04:18 +02:00
|
|
|
--replace "/usr/bin/env python3" "${python}/bin/${python.executable}"
|
2013-10-26 19:15:57 +02:00
|
|
|
'';
|
2015-07-26 23:22:12 +02:00
|
|
|
|
|
|
|
postInstall = stdenv.lib.optionalString guiSupport ''
|
2015-09-29 02:01:33 +02:00
|
|
|
wrapProgram "$out/bin/redshift-gtk" \
|
|
|
|
--prefix PYTHONPATH : "$PYTHONPATH" \
|
|
|
|
--prefix GI_TYPELIB_PATH : "$GI_TYPELIB_PATH"
|
2013-10-26 19:15:57 +02:00
|
|
|
'';
|
2015-07-26 23:22:12 +02:00
|
|
|
|
2013-11-03 01:03:45 +01:00
|
|
|
meta = with stdenv.lib; {
|
2015-07-02 19:04:18 +02:00
|
|
|
inherit version;
|
|
|
|
description = "Gradually change screen color temperature";
|
2011-01-25 00:52:22 +01:00
|
|
|
longDescription = ''
|
|
|
|
The color temperature is set according to the position of the
|
|
|
|
sun. A different color temperature is set during night and
|
|
|
|
daytime. During twilight and early morning, the color
|
|
|
|
temperature transitions smoothly from night to daytime
|
|
|
|
temperature to allow your eyes to slowly adapt.
|
2015-07-02 19:04:18 +02:00
|
|
|
'';
|
|
|
|
license = licenses.gpl3Plus;
|
2014-09-13 13:51:39 +02:00
|
|
|
homepage = http://jonls.dk/redshift;
|
2013-11-03 01:03:45 +01:00
|
|
|
platforms = platforms.linux;
|
2015-07-02 19:04:18 +02:00
|
|
|
maintainers = with maintainers; [ mornfall nckx ];
|
2011-01-25 00:52:22 +01:00
|
|
|
};
|
2013-06-07 02:13:54 +02:00
|
|
|
}
|