|
1 |
| -{ fetchurl, stdenv, gettext, intltool, makeWrapper, pkgconfig |
2 |
| -, geoclue2 |
3 |
| -, guiSupport ? true, hicolor_icon_theme, librsvg, gtk3, python, pygobject3, pyxdg |
4 |
| -, drmSupport ? true, libdrm |
5 |
| -, randrSupport ? true, libxcb |
6 |
| -, vidModeSupport ? true, libX11, libXxf86vm |
7 |
| -}: |
| 1 | +{ stdenv, fetchFromGitHub, fetchurl, autoconf, automake, gettext, intltool |
| 2 | +, libtool, pkgconfig, wrapGAppsHook, wrapPython, geoclue2, gobjectIntrospection |
| 3 | +, gtk3, python, pygobject3, pyxdg, libdrm, libxcb }: |
8 | 4 |
|
9 |
| -let |
10 |
| - mkFlag = flag: name: if flag |
11 |
| - then "--enable-${name}" |
12 |
| - else "--disable-${name}"; |
13 |
| -in |
14 | 5 | stdenv.mkDerivation rec {
|
15 | 6 | name = "redshift-${version}";
|
16 | 7 | version = "1.11";
|
17 | 8 |
|
18 |
| - src = fetchurl { |
19 |
| - sha256 = "0ngkwj7rg8nfk806w0sg443w6wjr91xdc0zisqfm5h2i77wm1qqh"; |
20 |
| - url = "https://github.com/jonls/redshift/releases/download/v${version}/redshift-${version}.tar.xz"; |
| 9 | + src = fetchFromGitHub { |
| 10 | + owner = "jonls"; |
| 11 | + repo = "redshift"; |
| 12 | + rev = "v${version}"; |
| 13 | + sha256 = "0jfi4wqklqw2rm0r2xwalyzir88zkdvqj0z5id0l5v20vsrfiiyj"; |
21 | 14 | };
|
22 | 15 |
|
23 |
| - buildInputs = [ geoclue2 ] |
24 |
| - ++ stdenv.lib.optionals guiSupport [ hicolor_icon_theme librsvg gtk3 |
25 |
| - python pygobject3 pyxdg ] |
26 |
| - ++ stdenv.lib.optionals drmSupport [ libdrm ] |
27 |
| - ++ stdenv.lib.optionals randrSupport [ libxcb ] |
28 |
| - ++ stdenv.lib.optionals vidModeSupport [ libX11 libXxf86vm ]; |
29 |
| - nativeBuildInputs = [ gettext intltool makeWrapper pkgconfig ]; |
| 16 | + patches = [ |
| 17 | + # https://github.com/jonls/redshift/pull/575 |
| 18 | + ./575.patch |
| 19 | + ]; |
30 | 20 |
|
31 |
| - configureFlags = [ |
32 |
| - (mkFlag guiSupport "gui") |
33 |
| - (mkFlag drmSupport "drm") |
34 |
| - (mkFlag randrSupport "randr") |
35 |
| - (mkFlag vidModeSupport "vidmode") |
| 21 | + nativeBuildInputs = [ |
| 22 | + autoconf |
| 23 | + automake |
| 24 | + gettext |
| 25 | + intltool |
| 26 | + libtool |
| 27 | + pkgconfig |
| 28 | + wrapGAppsHook |
| 29 | + wrapPython |
36 | 30 | ];
|
37 | 31 |
|
38 |
| - enableParallelBuilding = true; |
| 32 | + buildInputs = [ |
| 33 | + geoclue2 |
| 34 | + gobjectIntrospection |
| 35 | + gtk3 |
| 36 | + libdrm |
| 37 | + libxcb |
| 38 | + python |
| 39 | + ]; |
39 | 40 |
|
40 |
| - preInstall = stdenv.lib.optionalString guiSupport '' |
41 |
| - substituteInPlace src/redshift-gtk/redshift-gtk \ |
42 |
| - --replace "/usr/bin/env python3" "${python}/bin/${python.executable}" |
43 |
| - ''; |
44 |
| - postInstall = stdenv.lib.optionalString guiSupport '' |
45 |
| - wrapProgram "$out/bin/redshift-gtk" \ |
46 |
| - --set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE" \ |
47 |
| - --prefix PYTHONPATH : "$PYTHONPATH" \ |
48 |
| - --prefix GI_TYPELIB_PATH : "$GI_TYPELIB_PATH" \ |
49 |
| - --prefix XDG_DATA_DIRS : "$out/share:${hicolor_icon_theme}/share" |
| 41 | + pythonPath = [ pygobject3 pyxdg ]; |
50 | 42 |
|
51 |
| - install -Dm644 {.,$out/share/doc/redshift}/redshift.conf.sample |
52 |
| - ''; |
| 43 | + preConfigure = "./bootstrap"; |
| 44 | + postFixup = "wrapPythonPrograms"; |
| 45 | + |
| 46 | + enableParallelBuilding = true; |
53 | 47 |
|
54 | 48 | meta = with stdenv.lib; {
|
55 |
| - description = "Gradually change screen color temperature"; |
56 |
| - longDescription = '' |
57 |
| - The color temperature is set according to the position of the |
58 |
| - sun. A different color temperature is set during night and |
59 |
| - daytime. During twilight and early morning, the color |
60 |
| - temperature transitions smoothly from night to daytime |
61 |
| - temperature to allow your eyes to slowly adapt. |
62 |
| - ''; |
| 49 | + description = "Screen color temperature manager"; |
63 | 50 | license = licenses.gpl3Plus;
|
64 | 51 | homepage = http://jonls.dk/redshift;
|
65 | 52 | platforms = platforms.linux;
|
66 | 53 | maintainers = with maintainers; [ mornfall nckx ];
|
67 |
| - }; |
| 54 | + }; |
68 | 55 | }
|
0 commit comments