Skip to content

Commit 7d70261

Browse files
committedJan 16, 2018
redshift: fix redshift-gtk, autoreconfHook
1 parent 9d57972 commit 7d70261

File tree

3 files changed

+88
-50
lines changed

3 files changed

+88
-50
lines changed
 
+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,55 @@
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 }:
84

9-
let
10-
mkFlag = flag: name: if flag
11-
then "--enable-${name}"
12-
else "--disable-${name}";
13-
in
145
stdenv.mkDerivation rec {
156
name = "redshift-${version}";
167
version = "1.11";
178

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";
2114
};
2215

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+
];
3020

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
3630
];
3731

38-
enableParallelBuilding = true;
32+
buildInputs = [
33+
geoclue2
34+
gobjectIntrospection
35+
gtk3
36+
libdrm
37+
libxcb
38+
python
39+
];
3940

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 ];
5042

51-
install -Dm644 {.,$out/share/doc/redshift}/redshift.conf.sample
52-
'';
43+
preConfigure = "./bootstrap";
44+
postFixup = "wrapPythonPrograms";
45+
46+
enableParallelBuilding = true;
5347

5448
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";
6350
license = licenses.gpl3Plus;
6451
homepage = http://jonls.dk/redshift;
6552
platforms = platforms.linux;
6653
maintainers = with maintainers; [ mornfall nckx ];
67-
};
54+
};
6855
}

‎pkgs/top-level/all-packages.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -18801,7 +18801,7 @@ with pkgs;
1880118801
};
1880218802

1880318803
redshift = callPackage ../applications/misc/redshift {
18804-
inherit (python3Packages) python pygobject3 pyxdg;
18804+
inherit (python3Packages) python pygobject3 pyxdg wrapPython;
1880518805
};
1880618806

1880718807
redshift-plasma-applet = libsForQt5.callPackage ../applications/misc/redshift-plasma-applet { };

0 commit comments

Comments
 (0)