redshift: fix redshift-gtk, autoreconfHook

+88 -50
+51
pkgs/applications/misc/redshift/575.patch
··· 1 + From 467156efccc5e36a36bec8c0b64cc5a70f14d5ed Mon Sep 17 00:00:00 2001 2 + From: Yegor Timoshenko <yegortimoshenko@riseup.net> 3 + Date: Tue, 16 Jan 2018 11:43:46 +0000 4 + Subject: [PATCH] Fix Autoconf script 5 + 6 + gettext/intltool macros are not used correctly, see: 7 + https://bugs.launchpad.net/inkscape/+bug/1418943 8 + --- 9 + bootstrap | 6 +----- 10 + configure.ac | 5 +---- 11 + 2 files changed, 2 insertions(+), 9 deletions(-) 12 + 13 + diff --git a/bootstrap b/bootstrap 14 + index 0599cf5..40b1dca 100755 15 + --- a/bootstrap 16 + +++ b/bootstrap 17 + @@ -1,7 +1,3 @@ 18 + #!/bin/sh 19 + 20 + -# change to root directory 21 + -cd $(dirname "$0") 22 + - 23 + -autopoint --force && \ 24 + - AUTOPOINT="intltoolize --automake --copy" autoreconf --force --install --verbose 25 + +autoreconf --force --install && intltoolize 26 + diff --git a/configure.ac b/configure.ac 27 + index be0b51a..a2e7c42 100644 28 + --- a/configure.ac 29 + +++ b/configure.ac 30 + @@ -17,6 +17,7 @@ AC_PROG_OBJC # For macOS support modules 31 + AC_LANG([C]) 32 + 33 + AC_PROG_INTLTOOL([0.50]) 34 + +AC_SUBST(LIBINTL) 35 + 36 + AC_CANONICAL_HOST 37 + 38 + @@ -51,10 +52,6 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], [ 39 + ]) 40 + AC_LANG_POP([Objective C]) 41 + 42 + -# Checks for libraries. 43 + -AM_GNU_GETTEXT_VERSION([0.17]) 44 + -AM_GNU_GETTEXT([external]) 45 + - 46 + GETTEXT_PACKAGE=redshift 47 + AC_SUBST(GETTEXT_PACKAGE) 48 + AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Package name for gettext]) 49 + -- 50 + 2.15.1 51 +
+36 -49
pkgs/applications/misc/redshift/default.nix
··· 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 + ]; 20 + 21 + nativeBuildInputs = [ 22 + autoconf 23 + automake 24 + gettext 25 + intltool 26 + libtool 27 + pkgconfig 28 + wrapGAppsHook 29 + wrapPython 30 + ]; 30 31 31 - configureFlags = [ 32 - (mkFlag guiSupport "gui") 33 - (mkFlag drmSupport "drm") 34 - (mkFlag randrSupport "randr") 35 - (mkFlag vidModeSupport "vidmode") 32 + buildInputs = [ 33 + geoclue2 34 + gobjectIntrospection 35 + gtk3 36 + libdrm 37 + libxcb 38 + python 36 39 ]; 37 40 38 - enableParallelBuilding = true; 41 + pythonPath = [ pygobject3 pyxdg ]; 39 42 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" 43 + preConfigure = "./bootstrap"; 44 + postFixup = "wrapPythonPrograms"; 50 45 51 - install -Dm644 {.,$out/share/doc/redshift}/redshift.conf.sample 52 - ''; 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 }
+1 -1
pkgs/top-level/all-packages.nix
··· 18801 18801 }; 18802 18802 18803 18803 redshift = callPackage ../applications/misc/redshift { 18804 - inherit (python3Packages) python pygobject3 pyxdg; 18804 + inherit (python3Packages) python pygobject3 pyxdg wrapPython; 18805 18805 }; 18806 18806 18807 18807 redshift-plasma-applet = libsForQt5.callPackage ../applications/misc/redshift-plasma-applet { };