Bug 79565

Summary: UPower 0.9 git branch (like 0.9.23) with ./configure --enable-deprecated
Product: upower Reporter: Samuli Suominen <ssuominen>
Component: generalAssignee: Richard Hughes <richard>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: medium CC: eric.koegel
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Samuli Suominen 2014-06-02 21:20:45 UTC
http://bugzilla.xfce.org/show_bug.cgi?id=10931

# ./configure --enable-deprecated
# make
# make install
# pkg-config --cflags upower-glib
doesn't return -DUPOWER_ENABLE_DEPRECATED

but libupower-glib/up-client.h uses #ifdef three times for guarding the deprecated features

libupower-glib/Makefile.am sets -DUPOWER_ENABLE_DEPRECATED for UPower compile itself, but that doesn't help other programs, like xfce4-power-manager-1.3.0 that uses code within the #ifdef block

so, question is, is the code inside those #ifdef's only for upower? or did someone simply forget to add -DUPOWER_ENABLE_DEPRECATED to upower-glib.pc to Cflags: line when ./configured with --enable-deprecated?

even if you decide to close this bug as obsolete/wontfix now that 0.99.0 is out, could you please reply to the question for me, and for xfce4-power-manager upstream? we, or at least i, are baffled

thanks,
samuli
Comment 1 Richard Hughes 2014-06-04 14:41:28 UTC
The logic was, if I remember correctly, was that the vendor had to decide if the upower should be built with the deprecated functionality, and that the client then had to do that define so that it could use it.
Comment 2 Samuli Suominen 2014-06-04 14:59:03 UTC
(In reply to comment #1)
> The logic was, if I remember correctly, was that the vendor had to decide if
> the upower should be built with the deprecated functionality, and that the
> client then had to do that define so that it could use it.

So, http://git.xfce.org/xfce/xfce4-power-manager/commit/?id=c0d9ea83083058379a83fd96d407479247f06d74 looks fine then, based on that logic.
A bit unorthodox, the upower-glib.pc Cflags: seems to be the most logical location for it :-/
Comment 3 Samuli Suominen 2014-06-04 15:15:49 UTC
Only a word and I'll write such an patch that adds it to Cflags:

I just don't want to waste time on a wrong patch, or a patch that won't be committed due to 0.9 being unmaintained...
Comment 4 Alan Jenkins 2017-08-23 09:09:44 UTC
Can we remove this from the list of open bugs?  Somehow I doubt it's useful or likely to release 0.9.24 with such a patch.
Comment 5 Bastien Nocera 2017-09-08 16:25:08 UTC
(In reply to Samuli Suominen from comment #0)
> http://bugzilla.xfce.org/show_bug.cgi?id=10931
> 
> # ./configure --enable-deprecated
> # make
> # make install
> # pkg-config --cflags upower-glib
> doesn't return -DUPOWER_ENABLE_DEPRECATED
> 
> but libupower-glib/up-client.h uses #ifdef three times for guarding the
> deprecated features
> 
> libupower-glib/Makefile.am sets -DUPOWER_ENABLE_DEPRECATED for UPower
> compile itself, but that doesn't help other programs, like
> xfce4-power-manager-1.3.0 that uses code within the #ifdef block

It's a bit of a mess, because disabling deprecated features in the backend but not in the front-end will cause errors when using, for example, upower -d.

But the 0.99.x branch leading to 1.0 is 4 years old at this point, so it's really past deprecated.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.