summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuli Suominen <ssuominen@gentoo.org>2014-06-04 21:25:54 +0000
committerSamuli Suominen <ssuominen@gentoo.org>2014-06-04 21:25:54 +0000
commit25f3b5e605eaa05c748236e73cb8c91728bd79b3 (patch)
treeefd9cbb12babf047eea5b3a0018ff7bcaa564667 /sys-power
parentVersion bump (diff)
downloadgentoo-2-25f3b5e605eaa05c748236e73cb8c91728bd79b3.tar.gz
gentoo-2-25f3b5e605eaa05c748236e73cb8c91728bd79b3.tar.bz2
gentoo-2-25f3b5e605eaa05c748236e73cb8c91728bd79b3.zip
backport upstream fixes
(Portage version: 2.2.10/cvs/Linux x86_64, signed Manifest commit with key 4868F14D)
Diffstat (limited to 'sys-power')
-rw-r--r--sys-power/upower/ChangeLog20
-rw-r--r--sys-power/upower/files/upower-0.99.0-create-dir-runtime.patch34
-rw-r--r--sys-power/upower/files/upower-0.99.0-fix-segfault.patch24
-rw-r--r--sys-power/upower/files/upower-0.99.0-fix-shutdown-on-boot.patch75
-rw-r--r--sys-power/upower/files/upower-0.99.0-fix-typing-error.patch22
-rw-r--r--sys-power/upower/upower-0.99.0-r1.ebuild86
6 files changed, 254 insertions, 7 deletions
diff --git a/sys-power/upower/ChangeLog b/sys-power/upower/ChangeLog
index 2fa982a18dab..82e1a1debe01 100644
--- a/sys-power/upower/ChangeLog
+++ b/sys-power/upower/ChangeLog
@@ -1,6 +1,16 @@
# ChangeLog for sys-power/upower
# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-power/upower/ChangeLog,v 1.153 2014/06/02 23:09:30 ssuominen Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-power/upower/ChangeLog,v 1.154 2014/06/04 21:25:54 ssuominen Exp $
+
+*upower-0.99.0-r1 (04 Jun 2014)
+
+ 04 Jun 2014; Samuli Suominen <ssuominen@gentoo.org> +upower-0.99.0-r1.ebuild,
+ +files/upower-0.99.0-create-dir-runtime.patch,
+ +files/upower-0.99.0-fix-segfault.patch,
+ +files/upower-0.99.0-fix-shutdown-on-boot.patch,
+ +files/upower-0.99.0-fix-typing-error.patch:
+ Backport fixes from git master (segfaulting, creating directories on fly,
+ shutting down on boot, and typing errors)
02 Jun 2014; Samuli Suominen <ssuominen@gentoo.org> -upower-0.9.23-r2.ebuild:
old
@@ -27,11 +37,6 @@
Stabilize for everyone (only non-arch specific minor bugfixes when comparing
to current stable, which is -r0)
- 26 May 2014; Samuli Suominen <ssuominen@gentoo.org> upower-0.99.0.ebuild:
- This release is mainly for use with sys-apps/systemd because upstream removed
- support for sys-power/pm-utils completely from git master. The 0.9 branch is
- for sys-power/pm-utils use. Adjust ebuild accordingly.
-
28 Mar 2014; Rick Farina <zerochaos@gentoo.org> upower-0.9.23-r2.ebuild,
upower-0.99.0.ebuild:
reverting deps on lib[g]udev due to bug #506114
@@ -77,7 +82,8 @@
27 Feb 2014; Samuli Suominen <ssuominen@gentoo.org> +upower-0.99.0.ebuild:
Version bump without KEYWORDS because of major API change. Introduce subslot
- 0/2 based on libupower-glib.so SONAME.
+ 0/2 based on libupower-glib.so SONAME. Notice that upstream removed support
+ for hibernate and suspend in this version.
27 Feb 2014; Samuli Suominen <ssuominen@gentoo.org> upower-0.9.23.ebuild:
amd64 stable wrt #496532
diff --git a/sys-power/upower/files/upower-0.99.0-create-dir-runtime.patch b/sys-power/upower/files/upower-0.99.0-create-dir-runtime.patch
new file mode 100644
index 000000000000..34340d44ec30
--- /dev/null
+++ b/sys-power/upower/files/upower-0.99.0-create-dir-runtime.patch
@@ -0,0 +1,34 @@
+From b9cff29978113aefe3ad18521f383f12ab099a34 Mon Sep 17 00:00:00 2001
+From: Cosimo Cecchi <cosimo@endlessm.com>
+Date: Tue, 25 Feb 2014 09:43:04 +0000
+Subject: Create the history directory at runtime
+
+In addition to build time - this increases compatibilty with OSTree,
+which starts out with an empty /var.
+
+Signed-off-by: Richard Hughes <richard@hughsie.com>
+---
+diff --git a/src/up-history.c b/src/up-history.c
+index f9d0fdf..795b093 100644
+--- a/src/up-history.c
++++ b/src/up-history.c
+@@ -414,6 +414,7 @@ up_history_set_directory (UpHistory *history, const gchar *dir)
+ {
+ g_free (history->priv->dir);
+ history->priv->dir = g_strdup (dir);
++ g_mkdir_with_parents (dir, 0755);
+ }
+
+ /**
+@@ -887,7 +888,8 @@ up_history_init (UpHistory *history)
+ history->priv->data_time_full = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
+ history->priv->data_time_empty = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
+ history->priv->max_data_age = UP_HISTORY_DEFAULT_MAX_DATA_AGE;
+- history->priv->dir = g_build_filename (HISTORY_DIR, NULL);
++
++ up_history_set_directory (history, HISTORY_DIR);
+ }
+
+ /**
+--
+cgit v0.9.0.2-2-gbebe
diff --git a/sys-power/upower/files/upower-0.99.0-fix-segfault.patch b/sys-power/upower/files/upower-0.99.0-fix-segfault.patch
new file mode 100644
index 000000000000..3e8976320777
--- /dev/null
+++ b/sys-power/upower/files/upower-0.99.0-fix-segfault.patch
@@ -0,0 +1,24 @@
+From 0d64bbddaa0078ef148d609a3cfad854cf00d7de Mon Sep 17 00:00:00 2001
+From: Martin Pitt <martinpitt@gnome.org>
+Date: Fri, 08 Nov 2013 13:59:50 +0000
+Subject: lib: Fix segfault on getting property when daemon is not running
+
+This fixes "upower --version" when the daemon is not running, and thus the
+client proxy is NULL.
+---
+diff --git a/libupower-glib/up-client.c b/libupower-glib/up-client.c
+index 35d7b5d..17fb02d 100644
+--- a/libupower-glib/up-client.c
++++ b/libupower-glib/up-client.c
+@@ -322,6 +322,9 @@ up_client_get_property (GObject *object,
+ UpClient *client;
+ client = UP_CLIENT (object);
+
++ if (client->priv->proxy == NULL)
++ return;
++
+ switch (prop_id) {
+ case PROP_DAEMON_VERSION:
+ g_value_set_string (value, up_client_glue_get_daemon_version (client->priv->proxy));
+--
+cgit v0.9.0.2-2-gbebe
diff --git a/sys-power/upower/files/upower-0.99.0-fix-shutdown-on-boot.patch b/sys-power/upower/files/upower-0.99.0-fix-shutdown-on-boot.patch
new file mode 100644
index 000000000000..76fdcc876a2b
--- /dev/null
+++ b/sys-power/upower/files/upower-0.99.0-fix-shutdown-on-boot.patch
@@ -0,0 +1,75 @@
+From dbf7eb7e557674a9b888a088f1cae4f36b77e14d Mon Sep 17 00:00:00 2001
+From: Bastien Nocera <hadess@hadess.net>
+Date: Wed, 23 Apr 2014 13:34:24 +0000
+Subject: daemon: Fix shutdown on boot on some machines
+
+On the Lenovo A600 all-in-one, there's a HCI/HID dual-mode Broadcom
+device which will try to get the battery level of the supplied
+mouse and keyboard, but will usually fail to do so.
+
+So we have a battery of type "battery" (it's not either a mouse or
+a keyboard, as it's supposed to handle both) but our display device
+battery code doesn't check whether those batteries are power supplies
+or not, using this "empty" (0% after the check timed out) battery in
+the shutdown policy.
+
+Check better for power supply devices, not all the "battery" types
+are power supply batteries, they might be non-power supply ones
+from unknown device types.
+---
+diff --git a/src/up-daemon.c b/src/up-daemon.c
+index df0a7b7..ef90be4 100644
+--- a/src/up-daemon.c
++++ b/src/up-daemon.c
+@@ -208,6 +208,7 @@ up_daemon_update_display_battery (UpDaemon *daemon)
+ gdouble energy_rate = 0.0;
+ gint64 time_to_empty = 0;
+ gint64 time_to_full = 0;
++ gboolean power_supply = FALSE;
+
+ device = g_ptr_array_index (array, i);
+ g_object_get (device,
+@@ -219,6 +220,7 @@ up_daemon_update_display_battery (UpDaemon *daemon)
+ "energy-rate", &energy_rate,
+ "time-to-empty", &time_to_empty,
+ "time-to-full", &time_to_full,
++ "power-supply", &power_supply,
+ NULL);
+
+ /* When we have a UPS, it's either a desktop, and
+@@ -236,7 +238,8 @@ up_daemon_update_display_battery (UpDaemon *daemon)
+ is_present_total = TRUE;
+ break;
+ }
+- if (kind != UP_DEVICE_KIND_BATTERY)
++ if (kind != UP_DEVICE_KIND_BATTERY ||
++ power_supply == FALSE)
+ continue;
+
+ /* If one battery is charging, then the composite is charging
+@@ -389,17 +392,21 @@ up_daemon_refresh_battery_devices (UpDaemon *daemon)
+ guint i;
+ GPtrArray *array;
+ UpDevice *device;
+- UpDeviceKind type;
+
+ /* refresh all devices in array */
+ array = up_device_list_get_array (daemon->priv->power_devices);
+ for (i=0; i<array->len; i++) {
++ UpDeviceKind type;
++ gboolean power_supply;
++
+ device = (UpDevice *) g_ptr_array_index (array, i);
+ /* only refresh battery devices */
+ g_object_get (device,
+ "type", &type,
++ "power-supply", &power_supply,
+ NULL);
+- if (type == UP_DEVICE_KIND_BATTERY)
++ if (type == UP_DEVICE_KIND_BATTERY &&
++ power_supply)
+ up_device_refresh_internal (device);
+ }
+ g_ptr_array_unref (array);
+--
+cgit v0.9.0.2-2-gbebe
diff --git a/sys-power/upower/files/upower-0.99.0-fix-typing-error.patch b/sys-power/upower/files/upower-0.99.0-fix-typing-error.patch
new file mode 100644
index 000000000000..d972e96a0511
--- /dev/null
+++ b/sys-power/upower/files/upower-0.99.0-fix-typing-error.patch
@@ -0,0 +1,22 @@
+From d650df8af80b734f6c44a0acb2080493330b8836 Mon Sep 17 00:00:00 2001
+From: Bastien Nocera <hadess@hadess.net>
+Date: Wed, 23 Apr 2014 13:20:37 +0000
+Subject: lib: Fix typo in g-i annotation
+
+Missing colon.
+---
+diff --git a/libupower-glib/up-client.c b/libupower-glib/up-client.c
+index 17fb02d..582fac9 100644
+--- a/libupower-glib/up-client.c
++++ b/libupower-glib/up-client.c
+@@ -131,7 +131,7 @@ up_client_get_devices (UpClient *client)
+ * @client: a #UpClient instance.
+ *
+ * Get the composite display device.
+- * Return value: (transfer full) a #UpClient object, or %NULL on error.
++ * Return value: (transfer full): a #UpClient object, or %NULL on error.
+ *
+ * Since: 1.0
+ **/
+--
+cgit v0.9.0.2-2-gbebe
diff --git a/sys-power/upower/upower-0.99.0-r1.ebuild b/sys-power/upower/upower-0.99.0-r1.ebuild
new file mode 100644
index 000000000000..ac830d5a352d
--- /dev/null
+++ b/sys-power/upower/upower-0.99.0-r1.ebuild
@@ -0,0 +1,86 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-power/upower/upower-0.99.0-r1.ebuild,v 1.1 2014/06/04 21:25:54 ssuominen Exp $
+
+EAPI=5
+inherit eutils systemd
+
+DESCRIPTION="D-Bus abstraction for enumerating power devices and querying history and statistics"
+HOMEPAGE="http://upower.freedesktop.org/"
+SRC_URI="http://${PN}.freedesktop.org/releases/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0/2" # based on SONAME of libupower-glib.so
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd"
+IUSE="doc +introspection ios kernel_FreeBSD kernel_linux"
+
+RDEPEND=">=dev-libs/dbus-glib-0.100
+ >=dev-libs/glib-2.30
+ sys-apps/dbus:=
+ >=sys-auth/polkit-0.110
+ introspection? ( dev-libs/gobject-introspection )
+ kernel_linux? (
+ virtual/libusb:1
+ virtual/libgudev:=
+ virtual/udev
+ ios? (
+ >=app-pda/libimobiledevice-1:=
+ >=app-pda/libplist-1:=
+ )
+ )"
+DEPEND="${RDEPEND}
+ dev-libs/libxslt
+ app-text/docbook-xsl-stylesheets
+ dev-util/intltool
+ virtual/pkgconfig
+ doc? (
+ dev-util/gtk-doc
+ app-text/docbook-xml-dtd:4.1.2
+ )"
+
+QA_MULTILIB_PATHS="usr/lib/${PN}/.*"
+
+DOCS="AUTHORS HACKING NEWS README"
+
+src_prepare() {
+ sed -i -e '/DISABLE_DEPRECATED/d' configure || die
+
+ epatch \
+ "${FILESDIR}"/${P}-create-dir-runtime.patch \
+ "${FILESDIR}"/${P}-fix-shutdown-on-boot.patch \
+ "${FILESDIR}"/${P}-fix-segfault.patch \
+ "${FILESDIR}"/${P}-fix-typing-error.patch
+}
+
+src_configure() {
+ local backend myconf
+
+ if use kernel_linux; then
+ backend=linux
+ elif use kernel_FreeBSD; then
+ backend=freebsd
+ else
+ backend=dummy
+ fi
+
+ econf \
+ --libexecdir="${EPREFIX}"/usr/lib/${PN} \
+ --localstatedir="${EPREFIX}"/var \
+ $(use_enable introspection) \
+ --disable-static \
+ ${myconf} \
+ --enable-man-pages \
+ $(use_enable doc gtk-doc) \
+ --disable-tests \
+ --with-html-dir="${EPREFIX}"/usr/share/doc/${PF}/html \
+ --with-backend=${backend} \
+ $(use_with ios idevice) \
+ "$(systemd_with_utildir)" \
+ "$(systemd_with_unitdir)"
+}
+
+src_install() {
+ default
+ keepdir /var/lib/upower #383091
+ prune_libtool_files
+}