FS#40193 - [cinnamon-control-center] Please integrate upower 0.99 patch to fix "Power" module

Attached to Project: Community Packages
Opened by sb56637 (sb56637) - Friday, 02 May 2014, 20:50 GMT
Last edited by Balló György (City-busz) - Thursday, 31 July 2014, 17:26 GMT
Task Type Bug Report
Category Upstream Bugs
Status Closed
Assigned To Balló György (City-busz)
Alexandre Filgueira (faidoc)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 17
Private No

Details

The "Power" module of the Cinnamon System Settings is currently broken. Therefore, hibernate/suspend/screensaver settings can not be adjusted. Upon trying to open it from the console it fails with this error:

----------------
Loading Power module
/usr/bin/python2: symbol lookup error: /usr/lib/cinnamon-control-center-1/panels/libpower.so: undefined symbol: up_client_get_can_hibernate
----------------

The Mint/Cinnamon developers will not want to fix this bug since it only affects the newer upower 0.99 version that Arch uses. Please integrate the following patch to panels/power/cc-power-panel.c :
https://github.com/linuxmint/cinnamon-control-center/commit/5d718737b41584076b0626b570afd99b1e3a6d5c
This patch has been tested to work and fixes the problem for Arch.

Thanks.
This task depends upon

Closed by  Balló György (City-busz)
Thursday, 31 July 2014, 17:26 GMT
Reason for closing:  Fixed
Additional comments about closing:  cinnamon-control-center 2.2.10-2
Comment by loqs (loqs) - Thursday, 15 May 2014, 17:46 GMT
$ cinnamon-settings power
Python module
Loading Power module
/usr/bin/python2: symbol lookup error: /usr/lib/cinnamon-control-center-1/panels/libpower.so: undefined symbol: up_client_get_can_hibernate

This causes cinnamon-settings to exit and no panel is displayed.

$ pacman -Qi cinnamon-control-center
Name : cinnamon-control-center
Version : 2.2.7-1
Description : The Control Center for Cinnamon
Architecture : x86_64
URL : https://github.com/linuxmint/cinnamon-control-center
Licences : GPL
Groups : None
Provides : None
Depends On : cinnamon-settings-daemon cinnamon-translations
cinnamon-menus libgnomekbd network-manager-applet
Optional Deps : gnome-color-manager: for color management tasks [installed]
Required By : cinnamon
Optional For : None
Conflicts With : None
Replaces : None
Installed Size : 6034.00 KiB
Packager : Balló György <ballogyor+arch@gmail.com>
Build Date : Mon 12 May 2014 01:24:05 UTC
Install Date : Thu 15 May 2014 06:50:01 UTC
Install Reason : Explicitly installed
Install Script : Yes
Validated By : Signature

patch to fix
diff --git a/panels/power/cc-power-panel.c b/panels/power/cc-power-panel.c
index fb8e1b4..43bd2f4 100644
--- a/panels/power/cc-power-panel.c
+++ b/panels/power/cc-power-panel.c
@@ -934,10 +934,18 @@ disable_unavailable_combo_items (CcPowerPanel *self,
-1);
switch (value_tmp) {
case CSD_POWER_ACTION_SUSPEND:
+#if ! UP_CHECK_VERSION(0,99,0)
enabled = cc_login1("CanSuspend") || up_client_get_can_suspend (self->priv->up_client);
+#else
+ enabled = cc_login1("CanSuspend");
+#endif
break;
case CSD_POWER_ACTION_HIBERNATE:
+#if ! UP_CHECK_VERSION(0,99,0)
enabled = cc_login1("CanHibernate") || up_client_get_can_hibernate (self->priv->up_client);
+#else
+ enabled = cc_login1("CanSuspend");
+#endif
break;
default:
enabled = TRUE;
Comment by loqs (loqs) - Thursday, 15 May 2014, 18:31 GMT Comment by Balló György (City-busz) - Thursday, 15 May 2014, 20:38 GMT
Thanks for the patch. I'll check it soon.
Comment by loqs (loqs) - Tuesday, 20 May 2014, 13:18 GMT
https://github.com/linuxmint/cinnamon-control-center/issues/65#issuecomment-43609656
Quote from leigh123linux on the issue upstream:
This issue isn't caused by upower-1.0 changes, in fact it's been deprecated since upower-0.9.20

http://cgit.freedesktop.org/upower/commit/?h=0.9&id=372c2f8d2922add987683a24b5d69902e05e2f97

and is fixed by this commit

https://github.com/linuxmint/cinnamon-control-center/commit/7d53209d99c6e5ea6c79d70a27ddef09298de7bf

something else is broken in arch, -1 for this patch being merged.
Issue was then closed upstream

from the upower sources libupower-glib/up-client.h
#ifdef UPOWER_ENABLE_DEPRECATED
gboolean up_client_get_can_hibernate (UpClient *client);
#endif
.....
#ifdef UPOWER_ENABLE_DEPRECATED
gboolean up_client_get_can_suspend (UpClient *client);
#endif

Unless upower is built with --enable-deprecated the functions will be undefined (cinnamon-control-centre does not check this at build or runtime) The patch checks against the current API version as upower does not provide a macro to check for versions greater than or equal to 0.92 and avoids using deprecated functions that may not be built. New patch attached to check at configure time if the deprecated functions are available (assumes if one of the deprecated functions is available the other will be ) Accidentally attached patch and can not delete duplicate. Do the maintainers want to discuss the patch / issue with upstream?
Comment by loqs (loqs) - Wednesday, 21 May 2014, 15:10 GMT
Simpler patch for arch as upstream closed the issue. Increment upower-glib version check to 0.9.2 when functions became deprecated and remove use of the functions.
Comment by Jan de Groot (JGC) - Wednesday, 28 May 2014, 11:32 GMT
Upstream is wrong. When compiling against recent upower, their code will throw "warning: implicit declaration of up_client_get_can_*" messages. As it's compiled to a library, the linker doesn't complain either and the result is a library with an undefined symbol that will never get resolved.

This is C code that gets compiled, not PHP code.
Comment by loqs (loqs) - Wednesday, 28 May 2014, 12:17 GMT
@Jan de Groot Could I persuade you or one of the other arch developers / maintainers to discuss this directly with upstream https://github.com/linuxmint/cinnamon-control-center/issues/65
I have had no success so far and am not sure I am even being listened to any more.
Comment by Alben Roland (coaxguy99) - Friday, 30 May 2014, 00:45 GMT
I am a newbie here. Would one of you be able to list the terminal commands to download and apply this patch? I tried to figure it out by reading the wiki on applying patches but the more I read, the more confused I became. Thanks in advance for your assistance!
Comment by Alben Roland (coaxguy99) - Friday, 30 May 2014, 16:07 GMT
Please help me if you can. I need a power applet to inform me at least of the % of battery left and I really want to stay with Arch and Cinnamon and should be able to if someone can just explain to me step-by-step how to download and apply the patch and get the applet to work. Sorry for posting again so soon but this is something I would like to fix on my laptop this weekend, if possible, because I will be traveling with it beginning this Sunday and would like to know when it is critical to find an outlet to re-charge. Don't know if this helps, but I'm using the 32-bit version and it is completely up to date.
Comment by loqs (loqs) - Friday, 30 May 2014, 18:01 GMT Comment by Claire Farron (clfarron4) - Monday, 09 June 2014, 16:05 GMT
If you're really lost, I'm hosting a patched x86_64 build here: https://drive.google.com/folderview?id=0B_6_fEdsgx-laTR0eE1MWmRtRkk&usp=drive_web

Download it to a folder, go to that folder in the terminal and install it with "pacman -U ./cinnamon-control-center-2.2.9-1.1-x86_64.pkg.tar.xz" (without the quotes).
Comment by Alben Roland (coaxguy99) - Monday, 09 June 2014, 17:16 GMT
Hi Claire Farron, yes, I am lost. Thank you so much for your answer. Would it be possible for you to create a patch for the 32-bit version? I'm running on an old IBM T60 with the CoreDuo processor (32-bit) so x86_64 is not an option for me. In the meantime, I found a power app that is working so it isn't critical but I would like to switch to the Cinnamon applet, if possible.
Comment by Claire Farron (clfarron4) - Monday, 09 June 2014, 20:49 GMT
@coaxguy99: OK, scratch what I said earlier, I'm building it now. It should be in the i686 folder of the link I posted above soon.
Comment by Claire Farron (clfarron4) - Monday, 09 June 2014, 21:40 GMT
There we go, a 32bit build: https://drive.google.com/folderview?id=0B_6_fEdsgx-lZHBTX0lsQkFNQTA&usp=drive_web

@Alad: I not going to put a patched package in the AUR that is going to be obsolete within the next few weeks. I also can't be bothered.
Comment by Alben Roland (coaxguy99) - Wednesday, 11 June 2014, 18:56 GMT
@Claire... That worked for me. Thank you so much!
Comment by Alad Wenter (Alad) - Saturday, 14 June 2014, 21:05 GMT
Why is this on google drive and not AUR?
Comment by Alad Wenter (Alad) - Saturday, 14 June 2014, 21:28 GMT
... that said, control center (2.2.9-1) seems to work fine for me
Comment by Alexandre Filgueira (faidoc) - Saturday, 14 June 2014, 21:33 GMT
I've updated the cinnamon package with a patched power applet while it get's fixed upstream. Thanks to robin92
Comment by Claire Farron (clfarron4) - Sunday, 29 June 2014, 21:26 GMT
  • Field changed: Percent Complete (100% → 0%)
Power applet fixed in the [cinnamon] package.

Issue here is that the Power Module of [cinnamon-control-center] is still broken in [community], though I am providing fixed version via my Google Drive.
Comment by Claire Farron (clfarron4) - Sunday, 29 June 2014, 22:06 GMT
Just done builds of 2.2.10. Issue persisted for me.

Here's a patched version of 2.2.10: https://drive.google.com/folderview?id=0B_6_fEdsgx-laTR0eE1MWmRtRkk&usp=drive_web#list
Comment by Alad Wenter (Alad) - Sunday, 29 June 2014, 23:35 GMT
@Claire: Yeah, because "I can't be bothered" really fits the Arch way, right? Besides, it's easy to ask on the AUR mailing list to remove a package if it's obsolete. Right now, a third-party binary should be a pretty big hurdle for most users.
Comment by Alad Wenter (Alad) - Sunday, 29 June 2014, 23:58 GMT
Here. Includes upower_arch.patch from 21 May 2014, 16:10 GMT+1

https://aur.archlinux.org/packages/cinnamon-control-center-upower/
Comment by sb56637 (sb56637) - Sunday, 13 July 2014, 14:38 GMT
@Alad: Excellent, fixes the broken Power module of the Cinnamon Control Center. Thanks very much!
Comment by loqs (loqs) - Sunday, 20 July 2014, 17:58 GMT

Loading...