diff --git a/pkgs/applications/misc/redshift/575.patch b/pkgs/applications/misc/redshift/575.patch new file mode 100644 index 000000000000..d731d8ec43ad --- /dev/null +++ b/pkgs/applications/misc/redshift/575.patch @@ -0,0 +1,51 @@ +From 467156efccc5e36a36bec8c0b64cc5a70f14d5ed Mon Sep 17 00:00:00 2001 +From: Yegor Timoshenko +Date: Tue, 16 Jan 2018 11:43:46 +0000 +Subject: [PATCH] Fix Autoconf script + +gettext/intltool macros are not used correctly, see: +https://bugs.launchpad.net/inkscape/+bug/1418943 +--- + bootstrap | 6 +----- + configure.ac | 5 +---- + 2 files changed, 2 insertions(+), 9 deletions(-) + +diff --git a/bootstrap b/bootstrap +index 0599cf5..40b1dca 100755 +--- a/bootstrap ++++ b/bootstrap +@@ -1,7 +1,3 @@ + #!/bin/sh + +-# change to root directory +-cd $(dirname "$0") +- +-autopoint --force && \ +- AUTOPOINT="intltoolize --automake --copy" autoreconf --force --install --verbose ++autoreconf --force --install && intltoolize +diff --git a/configure.ac b/configure.ac +index be0b51a..a2e7c42 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -17,6 +17,7 @@ AC_PROG_OBJC # For macOS support modules + AC_LANG([C]) + + AC_PROG_INTLTOOL([0.50]) ++AC_SUBST(LIBINTL) + + AC_CANONICAL_HOST + +@@ -51,10 +52,6 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], [ + ]) + AC_LANG_POP([Objective C]) + +-# Checks for libraries. +-AM_GNU_GETTEXT_VERSION([0.17]) +-AM_GNU_GETTEXT([external]) +- + GETTEXT_PACKAGE=redshift + AC_SUBST(GETTEXT_PACKAGE) + AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Package name for gettext]) +-- +2.15.1 + diff --git a/pkgs/applications/misc/redshift/default.nix b/pkgs/applications/misc/redshift/default.nix index 3fe0503d7f9d..92745a404c38 100644 --- a/pkgs/applications/misc/redshift/default.nix +++ b/pkgs/applications/misc/redshift/default.nix @@ -1,68 +1,55 @@ -{ fetchurl, stdenv, gettext, intltool, makeWrapper, pkgconfig -, geoclue2 -, guiSupport ? true, hicolor_icon_theme, librsvg, gtk3, python, pygobject3, pyxdg -, drmSupport ? true, libdrm -, randrSupport ? true, libxcb -, vidModeSupport ? true, libX11, libXxf86vm -}: +{ stdenv, fetchFromGitHub, fetchurl, autoconf, automake, gettext, intltool +, libtool, pkgconfig, wrapGAppsHook, wrapPython, geoclue2, gobjectIntrospection +, gtk3, python, pygobject3, pyxdg, libdrm, libxcb }: -let - mkFlag = flag: name: if flag - then "--enable-${name}" - else "--disable-${name}"; -in stdenv.mkDerivation rec { name = "redshift-${version}"; version = "1.11"; - src = fetchurl { - sha256 = "0ngkwj7rg8nfk806w0sg443w6wjr91xdc0zisqfm5h2i77wm1qqh"; - url = "https://github.com/jonls/redshift/releases/download/v${version}/redshift-${version}.tar.xz"; + src = fetchFromGitHub { + owner = "jonls"; + repo = "redshift"; + rev = "v${version}"; + sha256 = "0jfi4wqklqw2rm0r2xwalyzir88zkdvqj0z5id0l5v20vsrfiiyj"; }; - buildInputs = [ geoclue2 ] - ++ stdenv.lib.optionals guiSupport [ hicolor_icon_theme librsvg gtk3 - python pygobject3 pyxdg ] - ++ stdenv.lib.optionals drmSupport [ libdrm ] - ++ stdenv.lib.optionals randrSupport [ libxcb ] - ++ stdenv.lib.optionals vidModeSupport [ libX11 libXxf86vm ]; - nativeBuildInputs = [ gettext intltool makeWrapper pkgconfig ]; - - configureFlags = [ - (mkFlag guiSupport "gui") - (mkFlag drmSupport "drm") - (mkFlag randrSupport "randr") - (mkFlag vidModeSupport "vidmode") + patches = [ + # https://github.com/jonls/redshift/pull/575 + ./575.patch ]; + nativeBuildInputs = [ + autoconf + automake + gettext + intltool + libtool + pkgconfig + wrapGAppsHook + wrapPython + ]; + + buildInputs = [ + geoclue2 + gobjectIntrospection + gtk3 + libdrm + libxcb + python + ]; + + pythonPath = [ pygobject3 pyxdg ]; + + preConfigure = "./bootstrap"; + postFixup = "wrapPythonPrograms"; + enableParallelBuilding = true; - preInstall = stdenv.lib.optionalString guiSupport '' - substituteInPlace src/redshift-gtk/redshift-gtk \ - --replace "/usr/bin/env python3" "${python}/bin/${python.executable}" - ''; - postInstall = stdenv.lib.optionalString guiSupport '' - wrapProgram "$out/bin/redshift-gtk" \ - --set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE" \ - --prefix PYTHONPATH : "$PYTHONPATH" \ - --prefix GI_TYPELIB_PATH : "$GI_TYPELIB_PATH" \ - --prefix XDG_DATA_DIRS : "$out/share:${hicolor_icon_theme}/share" - - install -Dm644 {.,$out/share/doc/redshift}/redshift.conf.sample - ''; - meta = with stdenv.lib; { - description = "Gradually change screen color temperature"; - 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. - ''; + description = "Screen color temperature manager"; license = licenses.gpl3Plus; homepage = http://jonls.dk/redshift; platforms = platforms.linux; maintainers = with maintainers; [ mornfall nckx ]; - }; + }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 06a6eaec0a28..9393a1f17ff4 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18801,7 +18801,7 @@ with pkgs; }; redshift = callPackage ../applications/misc/redshift { - inherit (python3Packages) python pygobject3 pyxdg; + inherit (python3Packages) python pygobject3 pyxdg wrapPython; }; redshift-plasma-applet = libsForQt5.callPackage ../applications/misc/redshift-plasma-applet { };