diff options
author | Samuli Suominen <ssuominen@gentoo.org> | 2014-05-26 19:37:50 +0000 |
---|---|---|
committer | Samuli Suominen <ssuominen@gentoo.org> | 2014-05-26 19:37:50 +0000 |
commit | cebe659d911d6fe06165cb374914b1e1684fdc9a (patch) | |
tree | 176f24e3e8815427037d61ed8bc2d53968edaa20 /sys-power | |
parent | Initial commit. (diff) | |
download | historical-cebe659d911d6fe06165cb374914b1e1684fdc9a.tar.gz historical-cebe659d911d6fe06165cb374914b1e1684fdc9a.tar.bz2 historical-cebe659d911d6fe06165cb374914b1e1684fdc9a.zip |
Initial commit.
Package-Manager: portage-2.2.10/cvs/Linux x86_64
Manifest-Sign-Key: 0x4868F14D
Diffstat (limited to 'sys-power')
6 files changed, 244 insertions, 2 deletions
diff --git a/sys-power/upower-pm-utils/Manifest b/sys-power/upower-pm-utils/Manifest index ca26675f2556..18af553fade1 100644 --- a/sys-power/upower-pm-utils/Manifest +++ b/sys-power/upower-pm-utils/Manifest @@ -1,7 +1,21 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA256 + AUX upower-pm-utils-0.9.23-clamp_percentage_for_overfull_batt.patch 3396 SHA256 16c43fbd1a31b88b115392ecb29c449bebe0f8e70530fb965dca49cf0925b131 SHA512 6bb869f1e2c5d93983b20bb65f5fc0803709b690f70b17a78204c98afca41a97b60b1c3cf8f564c931f189bd2db1dab00cd42121f5f022b5e8f0f044faf836d7 WHIRLPOOL 2d0dcf6c5d1246a940db43a38d7c5f429331dc69bd3e40fcac5679f3e2663c5ef1927e9e29fc0fabcf7e21e7693486db0f7b703e8dd36eba4be33d8366861074 AUX upower-pm-utils-0.9.23-create-dir-runtime.patch 1164 SHA256 6324c148d436e3f898b73b445411f29a7527c65ffedb574ef658c1eaaa1aa4de SHA512 1aaec53df73aa50fabffaddd380800f7ed78caddc02b16834831aa1faa09c795e0def04493f64d852a9b07b9ef4007352e111c5d7cdc1f1b2ed8043c445751f2 WHIRLPOOL 4347f169597c8e144081673d038809a4f0525410aef7e3ff3b713f22dd28e1d7f4bcc69413be2d3c87e7e228dc8da6cfab7b6a3e63feeafafb6e8dc5d4d3a018 AUX upower-pm-utils-0.9.23-fix-segfault.patch 829 SHA256 c80d1510b3e3d0579ddbec328d2800ab7e112378f9a8ff9ef152d72de50a45c3 SHA512 31a6b5414ddd17cbbcf318da98907d745910e7632ea9a4d4d5c02eaaae87857b5bb88f9ab2f336f7b24637727005fb839f8c9564b82e56ae0065d57b1ce19ad2 WHIRLPOOL 4286fadfbb45b89891ca4aed49b11cde70afa357101f4b9b150d9f68e548af28436fa25a9d8143f7d90daaff0ee22238dd017f10e1e34e58a226553a84724682 DIST upower-0.9.23.tar.xz 425804 SHA256 433252b0a8e9ab4bed7e17ee3ee5b7cef6d527b1f5401ee32212d82a9682981b SHA512 526ef95e43faf61744ba2bbf80bae23bc5c8672130563a87a7f18f00d85b16e2069814ad70dd66ce6ce698037b522d78579cc2135e2af0c2a636230cfa662c6d WHIRLPOOL 1599739198767ea6c70e133d50302a62a5b0b07c3786057b75636167c80b02d8e0ab6cc4781ac08994b249ffb57875bf186923d441e0b10e73c238b6be5b3538 -EBUILD upower-pm-utils-0.9.23.ebuild 2240 SHA256 6e6772c1fc390d6f5b06b20ad4527b95bd258cf6aab48ff1e771171959ed307e SHA512 a1e6f1ad7dcca6a9cedf6d45ffd27885f8681e0dfff5c510ccbdb436cb175b396a3260c52c6f5ddfa8d8eeaa390ccf6f4498309d6b5377a0211cfb0b2993c678 WHIRLPOOL c07037dacf9cb993ec4a2aac27681c013d7f7c9d81f88f3c1ae9d928c6a098ef58890ddaa3ddb0e3a4dc623bc3f7e2b34cb23c55660f4c80974d093ca8c2cc18 -MISC ChangeLog 729 SHA256 7c8d1b221ee508db1242689124f834583bfe8b902c410d862003cd27e8c11337 SHA512 fa84668066e4d34e4d5bf1c291be9af866920a09d25dd8609f94c49ff5b55f346804aaff4a507061389232050a23a5a948feb4ed8cc1aff9c995ac5679b5da29 WHIRLPOOL 76d7f31263ca59e04f4c660bb0ac5548483c3c0d62151d113f9ae4cc23a691655f0b246bde340b3e2c5406eca3055a15b149536be7c3cff62a37ea53e532cf42 +EBUILD upower-pm-utils-0.9.23.ebuild 2255 SHA256 442ab684e5e5e8af6c87a6df6b88b309430faa15297918cf616593601ac97023 SHA512 10fd91cda5c893853e421dc1bfd3a9c077bc3422b09186573d09ce94b309bbd21671128e901c98ad00a5a0a248f2f83703ab41ff3f29ecb729c7fc0fa1ef9a36 WHIRLPOOL d810c390c7a7b664fdc74f068bf4dfc7f047363869a87de5f18dae8edef309184467a5358fe5061abd6927968826245d8cf8d0f08fe9398c5949c7b7b50cda9b +MISC ChangeLog 829 SHA256 537d1cd7a1ee9c1205c0e962877ccce49e5196db13106f6360b7526853a3ef46 SHA512 1c0f325d91ec491eb0cf8ba1a2cbe4f4a05d0da7cd75bec26a17105eab0722d7b85f9e3311bb6e0d885327062da51a828a619a7a0309cab022bfab69a6c595b5 WHIRLPOOL f154c0b7de79a422be82ef2fadf6d8e33bb6bc680b121b1c263dff71d80b64fe2e97ea88fc7cf3e97013637ac1fd5d0a2c3a327ed0a07436865b54f89d2fc802 MISC metadata.xml 239 SHA256 5d929c534d63615358eacbd035a386109d5deebdc7bb562511b4a6338ee2bbb8 SHA512 ab6b74388bf69a67b0d1f4283475f97eb5a731f31b5c9db4ee50b819a846c77d4ef09f63856e31a68b0bfdf18ee3baa6c76720d4345ccadf154385caaf1033bb WHIRLPOOL bcac6415c046557e53bf04579e077fed4d694dee8f7c0faeecf15f3f036137a2c9f0eaa0c492cecef23a45bd5af2c45542acd26641209d3c9be3108bf1ff09a7 +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2.0.22 (GNU/Linux) + +iQEcBAEBCAAGBQJTg5ekAAoJEEdUh39IaPFNhtAH/As6rltkKatEPRnWJRVl1JuR +YWJHyF+EV540PtJfDaLrAZA1gDvpoiIbR2FA06dmYUMZPR0dNGrRvrlE8lAkgobj +MeUBgjARXYG/t/asqnehRq6XeQzMqSRmIRJynS/Fvuqjk314LDM5JWujziM9EYXs +tV2kGruTVE9nYK3E9HBVjuyQxpviYWngokTW25iho6jpm54fS8Lmwm+jRO8MeL42 +j0jW012HBVnFDvtKzPO7WKxG8YIab49ts52BTTQPoPN0KdvYuJYyfDBwCwaOjv3j +IDNTiAeNHikg/7ISMZHh/DQnOJcmVwYNnlJQA051tHSwiYck8RHD6ZWwNPhbZTw= +=pV4+ +-----END PGP SIGNATURE----- diff --git a/sys-power/upower-pm-utils/files/upower-pm-utils-0.9.23-clamp_percentage_for_overfull_batt.patch b/sys-power/upower-pm-utils/files/upower-pm-utils-0.9.23-clamp_percentage_for_overfull_batt.patch new file mode 100644 index 000000000000..6e643c42de5e --- /dev/null +++ b/sys-power/upower-pm-utils/files/upower-pm-utils-0.9.23-clamp_percentage_for_overfull_batt.patch @@ -0,0 +1,72 @@ +From b8fe9902f3c6c50ca6a23e24fcea99582beebc65 Mon Sep 17 00:00:00 2001 +From: Martin Pitt <martinpitt@gnome.org> +Date: Tue, 22 Oct 2013 08:02:51 +0000 +Subject: linux: Clamp percentage for overfull batteries + +Some batteries report energy > energy_full and a percentage ("capacity" +attribute) > 100%. Clamp these within 0 and 100% for both plausibility as well +as to avoid setting an out-of-range property which would then become 0%. + +https://launchpad.net/bugs/1240673 +--- +diff --git a/src/linux/integration-test b/src/linux/integration-test +index 8489bf3..4be1922 100755 +--- a/src/linux/integration-test ++++ b/src/linux/integration-test +@@ -442,6 +442,39 @@ class Tests(unittest.TestCase): + self.assertEqual(self.get_dbus_property('OnLowBattery'), False) + self.stop_daemon() + ++ def test_battery_overfull(self): ++ '''battery which reports a > 100% percentage for a full battery''' ++ ++ self.testbed.add_device('power_supply', 'BAT0', None, ++ ['type', 'Battery', ++ 'present', '1', ++ 'status', 'Full', ++ 'current_now', '1000', ++ 'charge_now', '11000000', ++ 'charge_full', '10000000', ++ 'charge_full_design', '11000000', ++ 'capacity', '110', ++ 'voltage_now', '12000000'], []) ++ ++ self.start_daemon() ++ devs = self.proxy.EnumerateDevices() ++ self.assertEqual(len(devs), 1) ++ bat0_up = devs[0] ++ ++ # should clamp percentage ++ self.assertEqual(self.get_dbus_dev_property(bat0_up, 'Percentage'), 100.0) ++ self.assertEqual(self.get_dbus_dev_property(bat0_up, 'IsPresent'), True) ++ self.assertEqual(self.get_dbus_dev_property(bat0_up, 'State'), ++ UP_DEVICE_STATE_FULLY_CHARGED) ++ self.assertEqual(self.get_dbus_dev_property(bat0_up, 'Energy'), 132.0) ++ # should adjust EnergyFull to reality, not what the battery claims ++ self.assertEqual(self.get_dbus_dev_property(bat0_up, 'EnergyFull'), 132.0) ++ self.assertEqual(self.get_dbus_dev_property(bat0_up, 'EnergyFullDesign'), 132.0) ++ self.assertEqual(self.get_dbus_dev_property(bat0_up, 'Voltage'), 12.0) ++ self.assertEqual(self.get_dbus_dev_property(bat0_up, 'PowerSupply'), True) ++ self.assertEqual(self.get_dbus_dev_property(bat0_up, 'Type'), 2) ++ self.stop_daemon() ++ + def test_battery_temperature(self): + '''battery which reports temperature''' + +diff --git a/src/linux/up-device-supply.c b/src/linux/up-device-supply.c +index 8020277..b953d65 100644 +--- a/src/linux/up-device-supply.c ++++ b/src/linux/up-device-supply.c +@@ -708,6 +708,10 @@ up_device_supply_refresh_battery (UpDeviceSupply *supply) + /* get a precise percentage */ + if (sysfs_file_exists (native_path, "capacity")) { + percentage = sysfs_get_double (native_path, "capacity"); ++ if (percentage < 0.0f) ++ percentage = 0.0f; ++ if (percentage > 100.0f) ++ percentage = 100.0f; + /* for devices which provide capacity, but not {energy,charge}_now */ + if (energy < 0.1f && energy_full > 0.0f) + energy = energy_full * percentage / 100; +-- +cgit v0.9.0.2-2-gbebe diff --git a/sys-power/upower-pm-utils/files/upower-pm-utils-0.9.23-create-dir-runtime.patch b/sys-power/upower-pm-utils/files/upower-pm-utils-0.9.23-create-dir-runtime.patch new file mode 100644 index 000000000000..34340d44ec30 --- /dev/null +++ b/sys-power/upower-pm-utils/files/upower-pm-utils-0.9.23-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-pm-utils/files/upower-pm-utils-0.9.23-fix-segfault.patch b/sys-power/upower-pm-utils/files/upower-pm-utils-0.9.23-fix-segfault.patch new file mode 100644 index 000000000000..3e8976320777 --- /dev/null +++ b/sys-power/upower-pm-utils/files/upower-pm-utils-0.9.23-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-pm-utils/metadata.xml b/sys-power/upower-pm-utils/metadata.xml new file mode 100644 index 000000000000..c03b663ea9ff --- /dev/null +++ b/sys-power/upower-pm-utils/metadata.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <herd>freedesktop</herd> + <maintainer> + <email>freedesktop-bugs@gentoo.org</email> + </maintainer> +</pkgmetadata> diff --git a/sys-power/upower-pm-utils/upower-pm-utils-0.9.23.ebuild b/sys-power/upower-pm-utils/upower-pm-utils-0.9.23.ebuild new file mode 100644 index 000000000000..d04395dcd196 --- /dev/null +++ b/sys-power/upower-pm-utils/upower-pm-utils-0.9.23.ebuild @@ -0,0 +1,90 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-power/upower-pm-utils/upower-pm-utils-0.9.23.ebuild,v 1.1 2014/05/26 19:37:42 ssuominen Exp $ + +EAPI=5 +inherit eutils systemd + +DESCRIPTION="The upstream upower 0.9 git branch for use with sys-power/pm-utils, see sys-power/upower DESCRIPTION for more" +HOMEPAGE="http://upower.freedesktop.org/" +SRC_URI="http://upower.freedesktop.org/releases/upower-${PV}.tar.xz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd" +IUSE="doc +introspection ios kernel_FreeBSD kernel_linux" + +COMMON_DEPEND=">=dev-libs/dbus-glib-0.100 + >=dev-libs/glib-2.22 + sys-apps/dbus + >=sys-auth/polkit-0.110 + introspection? ( dev-libs/gobject-introspection ) + kernel_linux? ( + virtual/libusb:1 + >=virtual/udev-200[gudev] + ios? ( + >=app-pda/libimobiledevice-1:= + >=app-pda/libplist-1:= + ) + ) + !sys-power/upower" +RDEPEND="${COMMON_DEPEND} + kernel_linux? ( >=sys-power/pm-utils-1.4.1 )" +DEPEND="${COMMON_DEPEND} + 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/upower/.*" + +DOCS="AUTHORS HACKING NEWS README" + +S=${WORKDIR}/upower-${PV} + +src_prepare() { + sed -i -e '/DISABLE_DEPRECATED/d' configure || die + + epatch \ + "${FILESDIR}"/${P}-create-dir-runtime.patch \ + "${FILESDIR}"/${P}-fix-segfault.patch \ + "${FILESDIR}"/${P}-clamp_percentage_for_overfull_batt.patch +} + +src_configure() { + local backend myconf + + if use kernel_linux; then + backend=linux + myconf="--enable-deprecated" + elif use kernel_FreeBSD; then + backend=freebsd + else + backend=dummy + fi + + econf \ + --libexecdir="${EPREFIX}"/usr/lib/upower \ + --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 +} |