summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPacho Ramos <pacho@gentoo.org>2011-06-27 19:05:40 +0000
committerPacho Ramos <pacho@gentoo.org>2011-06-27 19:05:40 +0000
commitf3b9cc0e48e8c36a8e8202a1a4f26fbd51fd8c0e (patch)
tree3bad757d6873c6be0248c75e717ae581ed79c1c4 /gnome-extra/gnome-power-manager
parent^^^ (diff)
downloadgentoo-2-f3b9cc0e48e8c36a8e8202a1a4f26fbd51fd8c0e.tar.gz
gentoo-2-f3b9cc0e48e8c36a8e8202a1a4f26fbd51fd8c0e.tar.bz2
gentoo-2-f3b9cc0e48e8c36a8e8202a1a4f26fbd51fd8c0e.zip
Revision bump including multiple fixes and enhancements: upstream patch for fixing brightness changing, don't close non opened fd preventing crashes, don't use in XFCE, don't crash on systems which don't have XBACKLIGHT. This also includes a backported patch by Andy Botting adding support to control keyboard backlight (bug #366735).
(Portage version: 2.1.9.50/cvs/Linux x86_64)
Diffstat (limited to 'gnome-extra/gnome-power-manager')
-rw-r--r--gnome-extra/gnome-power-manager/ChangeLog16
-rw-r--r--gnome-extra/gnome-power-manager/files/gnome-power-manager-2.32.0-close-fd.patch25
-rw-r--r--gnome-extra/gnome-power-manager/files/gnome-power-manager-2.32.0-convert-percentage.patch31
-rw-r--r--gnome-extra/gnome-power-manager/files/gnome-power-manager-2.32.0-no-xfce.patch38
-rw-r--r--gnome-extra/gnome-power-manager/files/gnome-power-manager-2.32.0-xbacklight-crash.patch21
-rw-r--r--gnome-extra/gnome-power-manager/gnome-power-manager-2.32.0-r2.ebuild125
6 files changed, 255 insertions, 1 deletions
diff --git a/gnome-extra/gnome-power-manager/ChangeLog b/gnome-extra/gnome-power-manager/ChangeLog
index 175b3a508b3c..a20bf9c62e38 100644
--- a/gnome-extra/gnome-power-manager/ChangeLog
+++ b/gnome-extra/gnome-power-manager/ChangeLog
@@ -1,6 +1,20 @@
# ChangeLog for gnome-extra/gnome-power-manager
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/gnome-extra/gnome-power-manager/ChangeLog,v 1.154 2011/05/08 14:24:12 eva Exp $
+# $Header: /var/cvsroot/gentoo-x86/gnome-extra/gnome-power-manager/ChangeLog,v 1.155 2011/06/27 19:05:40 pacho Exp $
+
+*gnome-power-manager-2.32.0-r2 (27 Jun 2011)
+
+ 27 Jun 2011; Pacho Ramos <pacho@gentoo.org>
+ +gnome-power-manager-2.32.0-r2.ebuild,
+ +files/gnome-power-manager-2.32.0-close-fd.patch,
+ +files/gnome-power-manager-2.32.0-convert-percentage.patch,
+ +files/gnome-power-manager-2.32.0-no-xfce.patch,
+ +files/gnome-power-manager-2.32.0-xbacklight-crash.patch:
+ Revision bump including multiple fixes and enhancements: upstream patch for
+ fixing brightness changing, don't close non opened fd preventing crashes,
+ don't use in XFCE, don't crash on systems which don't have XBACKLIGHT. This
+ also includes a backported patch by Andy Botting adding support to control
+ keyboard backlight (bug #366735).
*gnome-power-manager-2.32.0-r1 (08 May 2011)
diff --git a/gnome-extra/gnome-power-manager/files/gnome-power-manager-2.32.0-close-fd.patch b/gnome-extra/gnome-power-manager/files/gnome-power-manager-2.32.0-close-fd.patch
new file mode 100644
index 000000000000..65d1d2bdd77a
--- /dev/null
+++ b/gnome-extra/gnome-power-manager/files/gnome-power-manager-2.32.0-close-fd.patch
@@ -0,0 +1,25 @@
+From 074178fed01bbac4cc3a5e3f90c573614e4de179 Mon Sep 17 00:00:00 2001
+From: Antoine Jacoutot <ajacoutot@openbsd.org>
+Date: Tue, 24 May 2011 11:15:08 +0000
+Subject: Don't try to close a non-opened fd
+
+On OpenBSD we do not use /proc. As a result, gnome-power-manager segfaults on
+startup due to a reverse logic in the code.
+
+Signed-off-by: Richard Hughes <richard@hughsie.com>
+---
+diff --git a/src/gpm-load.c b/src/gpm-load.c
+index eab0129..3b0f572 100644
+--- a/src/gpm-load.c
++++ b/src/gpm-load.c
+@@ -192,7 +192,7 @@ gpm_load_get_cpu_values (long unsigned *cpu_idle, long unsigned *cpu_total)
+ *cpu_total = cpu_user + cpu_nice + cpu_system + *cpu_idle;
+ ret = TRUE;
+ out:
+- if (!fd)
++ if (fd)
+ fclose (fd);
+ return ret;
+ }
+--
+cgit v0.9
diff --git a/gnome-extra/gnome-power-manager/files/gnome-power-manager-2.32.0-convert-percentage.patch b/gnome-extra/gnome-power-manager/files/gnome-power-manager-2.32.0-convert-percentage.patch
new file mode 100644
index 000000000000..bfbb914d2c71
--- /dev/null
+++ b/gnome-extra/gnome-power-manager/files/gnome-power-manager-2.32.0-convert-percentage.patch
@@ -0,0 +1,31 @@
+From 6204c3cbb1b915d788e373485a452a1e571f6a99 Mon Sep 17 00:00:00 2001
+From: Pedro Martinez-Julia <pedromj@um.es>
+Date: Mon, 07 Mar 2011 22:31:40 +0000
+Subject: Fixed #644143, how to convert from percentage to discrete and vice-versa.
+
+Signed-off-by: Richard Hughes <richard@hughsie.com>
+---
+diff --git a/src/egg-discrete.c b/src/egg-discrete.c
+index a051282..fe910cc 100644
+--- a/src/egg-discrete.c
++++ b/src/egg-discrete.c
+@@ -47,7 +47,7 @@ egg_discrete_from_percent (guint percentage, guint levels)
+ egg_warning ("levels is 0!");
+ return 0;
+ }
+- return ((gfloat) percentage * (gfloat) (levels - 1)) / 100.0f;
++ return (guint) ((((gfloat) percentage * (gfloat) (levels - 1)) / 100.0f) + 0.5f);
+ }
+
+ /**
+@@ -69,7 +69,7 @@ egg_discrete_to_percent (guint discrete, guint levels)
+ egg_warning ("levels is 0!");
+ return 0;
+ }
+- return (guint) ((gfloat) discrete * (100.0f / (gfloat) (levels - 1)));
++ return (guint) (((gfloat) discrete * (100.0f / (gfloat) (levels - 1))) + 0.5f);
+ }
+
+ /**
+--
+cgit v0.9
diff --git a/gnome-extra/gnome-power-manager/files/gnome-power-manager-2.32.0-no-xfce.patch b/gnome-extra/gnome-power-manager/files/gnome-power-manager-2.32.0-no-xfce.patch
new file mode 100644
index 000000000000..f0ff41185d08
--- /dev/null
+++ b/gnome-extra/gnome-power-manager/files/gnome-power-manager-2.32.0-no-xfce.patch
@@ -0,0 +1,38 @@
+From 1f9807874036b6dbedb0fd44c02c836046d99cbe Mon Sep 17 00:00:00 2001
+From: Vincent Untz <vuntz@gnome.org>
+Date: Thu, 17 Feb 2011 20:23:50 +0000
+Subject: Do not use g-p-m in XFCE
+
+XFCE now comes with xfce4-power-manager, so g-p-m is just duplicating
+the work.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=642616
+---
+diff --git a/data/gnome-power-manager.desktop.in.in b/data/gnome-power-manager.desktop.in.in
+index 726e156..3e7b821 100644
+--- a/data/gnome-power-manager.desktop.in.in
++++ b/data/gnome-power-manager.desktop.in.in
+@@ -6,7 +6,7 @@ Exec=gnome-power-manager
+ Terminal=false
+ Type=Application
+ Categories=
+-OnlyShowIn=GNOME;XFCE;
++OnlyShowIn=GNOME;
+ X-GNOME-Bugzilla-Bugzilla=GNOME
+ X-GNOME-Bugzilla-Product=gnome-power-manager
+ X-GNOME-Bugzilla-Component=gnome-power-manager
+diff --git a/data/gnome-power-statistics.desktop.in.in b/data/gnome-power-statistics.desktop.in.in
+index 1f9f9c3..8328cea 100644
+--- a/data/gnome-power-statistics.desktop.in.in
++++ b/data/gnome-power-statistics.desktop.in.in
+@@ -6,7 +6,7 @@ Exec=gnome-power-statistics
+ Terminal=false
+ Type=Application
+ Categories=GNOME;GTK;System;Monitor;
+-OnlyShowIn=GNOME;XFCE;
++OnlyShowIn=GNOME;
+ NoDisplay=true
+ StartupNotify=true
+ X-GNOME-Bugzilla-Bugzilla=GNOME
+--
+cgit v0.9
diff --git a/gnome-extra/gnome-power-manager/files/gnome-power-manager-2.32.0-xbacklight-crash.patch b/gnome-extra/gnome-power-manager/files/gnome-power-manager-2.32.0-xbacklight-crash.patch
new file mode 100644
index 000000000000..c97b877d12b6
--- /dev/null
+++ b/gnome-extra/gnome-power-manager/files/gnome-power-manager-2.32.0-xbacklight-crash.patch
@@ -0,0 +1,21 @@
+Description: Don't crash on systems which don't have XBACKLIGHT.
+Author: Chris Coulson <chris.coulson@canonical.com>
+Bug-Ubuntu: https://launchpad.net/bugs/614039
+Bug: http://bugs.gnome.org/627711
+Forwarded: yes, http://bugs.gnome.org/attachment.cgi?id=168554
+
+Index: gnome-power-manager-2.31.91/src/gpm-brightness.c
+===================================================================
+--- gnome-power-manager-2.31.91.orig/src/gpm-brightness.c 2010-09-02 14:54:48.775141000 +1000
++++ gnome-power-manager-2.31.91/src/gpm-brightness.c 2010-09-02 14:54:56.415141000 +1000
+@@ -526,6 +526,10 @@
+ if (!brightness->priv->has_extension)
+ return FALSE;
+
++ /* Return immediately if we can't use XRandR */
++ if (!brightness->priv->has_extension)
++ return FALSE;
++
+ /* do for each screen */
+ length = brightness->priv->resources->len;
+ for (i=0; i<length; i++) {
diff --git a/gnome-extra/gnome-power-manager/gnome-power-manager-2.32.0-r2.ebuild b/gnome-extra/gnome-power-manager/gnome-power-manager-2.32.0-r2.ebuild
new file mode 100644
index 000000000000..208b1cc11dfa
--- /dev/null
+++ b/gnome-extra/gnome-power-manager/gnome-power-manager-2.32.0-r2.ebuild
@@ -0,0 +1,125 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/gnome-extra/gnome-power-manager/gnome-power-manager-2.32.0-r2.ebuild,v 1.1 2011/06/27 19:05:40 pacho Exp $
+
+EAPI="4"
+GNOME_TARBALL_SUFFIX="bz2"
+GCONF_DEBUG="no"
+
+inherit autotools eutils gnome2 virtualx
+
+DESCRIPTION="A session daemon for GNOME that makes it easy to manage your laptop or desktop system"
+HOMEPAGE="http://projects.gnome.org/gnome-power-manager/"
+SRC_URI="${SRC_URI} http://dev.gentoo.org/~pacho/gnome/${PN}-2.32.0-keyboard-backlight.patch.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd"
+IUSE="+applet doc policykit test"
+
+# FIXME: Interactive testsuite (upstream ? I'm so...pessimistic)
+RESTRICT="test"
+
+COMMON_DEPEND=">=dev-libs/glib-2.13.0:2
+ >=x11-libs/gtk+-2.17.7:2
+ >=gnome-base/gnome-keyring-0.6.0
+ >=dev-libs/dbus-glib-0.71
+ >=x11-libs/libnotify-0.4.3
+ >=x11-libs/libwnck-2.10.0:1
+ >=x11-libs/cairo-1
+ >=gnome-base/gconf-2.10:2[policykit?]
+ >=media-libs/libcanberra-0.10[gtk]
+ >=sys-power/upower-0.9.1
+ >=dev-libs/libunique-1.1:1
+ >=x11-apps/xrandr-1.3
+ >=x11-proto/xproto-7.0.15
+ x11-libs/libX11
+ x11-libs/libXext
+ applet? (
+ || ( gnome-base/gnome-panel[bonobo] <gnome-base/gnome-panel-2.32 )
+ )
+"
+RDEPEND="${COMMON_DEPEND}
+ >=sys-auth/consolekit-0.4[policykit?]
+ policykit? ( gnome-extra/polkit-gnome )"
+DEPEND="${COMMON_DEPEND}
+ x11-proto/randrproto
+
+ sys-devel/gettext
+ app-text/scrollkeeper
+ app-text/docbook-xml-dtd:4.3
+ >=dev-util/pkgconfig-0.9
+ >=dev-util/intltool-0.35
+ >=app-text/gnome-doc-utils-0.3.2
+ doc? (
+ app-text/xmlto
+ app-text/docbook-sgml-utils
+ app-text/docbook-xml-dtd:4.4
+ app-text/docbook-sgml-dtd:4.1
+ app-text/docbook-xml-dtd:4.1.2 )"
+
+# docbook-sgml-utils and docbook-sgml-dtd-4.1 used for creating man pages
+# (files under ${S}/man).
+# docbook-xml-dtd-4.4 and -4.1.2 are used by the xml files under ${S}/docs.
+
+pkg_setup() {
+ G2CONF="${G2CONF}
+ $(use_enable applet applets)
+ $(use_enable doc docbook-docs)
+ $(use_enable policykit gconf-defaults)
+ $(use_enable test tests)
+ --enable-compile-warnings=minimum"
+ DOCS="AUTHORS ChangeLog NEWS README TODO"
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-libnotify-0.7.patch
+
+ gnome2_src_prepare
+
+ # Fix intltoolize broken file, see upstream #577133
+ sed "s:'\^\$\$lang\$\$':\^\$\$lang\$\$:g" -i po/Makefile.in.in \
+ || die "sed libtoolize failed"
+
+ # Drop debugger CFLAGS from configure
+ sed -e 's:^CPPFLAGS="$CPPFLAGS -g"$::g' \
+ -i configure.ac configure || die "debugger sed failed"
+
+ # glibc splits this out, whereas other libc's do not tend to
+ if use elibc_glibc; then
+ sed -e 's/-lresolv//' \
+ -i configure.ac configure || die "resolv sed failed"
+ fi
+
+ # Fixed bgo#644143, how to convert from percentage to discrete and vice-versa.
+ epatch "${FILESDIR}/${P}-convert-percentage.patch"
+
+ # Don't try to close a non-opened fd
+ epatch "${FILESDIR}/${P}-close-fd.patch"
+
+ # Do not use g-p-m in XFCE
+ epatch "${FILESDIR}/${PN}-2.32.0-no-xfce.patch"
+
+ # Don't crash on systems which don't have XBACKLIGHT
+ epatch "${FILESDIR}/${PN}-2.32.0-xbacklight-crash.patch"
+
+ # Add keyboard backlight support including dimming on idle and keyboard control
+ epatch "${WORKDIR}/${PN}-2.32.0-keyboard-backlight.patch"
+
+ # FIXME: This is required to prevent maintainer mode after "debugger sed"
+ intltoolize --force --copy --automake || die "intltoolize failed"
+ eautoreconf
+
+ # This needs to be after eautoreconf to prevent problems like bug #356277
+ if ! use doc; then
+ # Remove the docbook2man rules here since it's not handled by a proper
+ # parameter in configure.in.
+ sed -e 's:@HAVE_DOCBOOK2MAN_TRUE@.*::' -i man/Makefile.in \
+ || die "docbook sed failed"
+ fi
+}
+
+src_test() {
+ unset DBUS_SESSION_BUS_ADDRESS
+ dbus-launch Xemake check || die "Test phase failed"
+}