Author: mtasaka
Update of /cvs/free/rpms/cairo-dock/devel
In directory old02.ovh.rpmfusion.lan:/tmp/cvs-serv30648
Modified Files:
cairo-dock.spec
Added Files:
cairo-dock-plugins-3.3.2-upower-099-r3083-modified.patch
cairo-dock-plugins-3.3.2-upower-099-r3084-modified.patch
Log Message:
* Mon Jun 16 2014 Mamoru TASAKA <mtasaka(a)fedoraproject.org> - 3.3.2-2
- Fix build with upower 0.99
cairo-dock-plugins-3.3.2-upower-099-r3083-modified.patch:
CMakeLists.txt | 43 +++++++++++++++++++++++++++++++------------
logout/src/CMakeLists.txt | 35 +++++++++++++++++++++--------------
2 files changed, 52 insertions(+), 26 deletions(-)
--- NEW FILE cairo-dock-plugins-3.3.2-upower-099-r3083-modified.patch ---
--- cairo-dock-plugins-3.3.2/CMakeLists.txt.upower0 2013-10-29 19:27:30.000000000 +0900
+++ cairo-dock-plugins-3.3.2/CMakeLists.txt 2014-06-16 14:00:42.543802818 +0900
@@ -152,6 +152,14 @@
set (shared_filesdatadir "${pluginsdatadir}/shared-files")
add_subdirectory (shared-files)
+
+
+################################################################################
+# STATIC LIBS AND DEPENDENCES USED BY MORE THAN ONE PLUG-IN #
+################################################################################
+
+
+
############# STATIC LIBRARIES ################
message (STATUS "> Static Libraries:")
@@ -337,6 +345,29 @@
endif()
endif()
+############# UPOWER #####################
+message (STATUS "> UPower:")
+enable_if_not_defined (enable-upower-support)
+if (enable-upower-support)
+ pkg_check_modules (UPOWER upower-glib) # useful for Powermanager too.
+endif()
+if (UPOWER_FOUND)
+ set (with_upower_support yes)
+ STRING (REGEX REPLACE "\\..*" "" UPOWER_MAJOR
"${UPOWER_VERSION}") # 2.28.3 => 2
+ STRING (REGEX REPLACE "[0-9]*\\.([^ ]+)" "\\1" UPOWER_MINOR
"${UPOWER_VERSION}") # 2.28.3 => 2.28
+ STRING (REGEX REPLACE "\\.[0-9]*" "" UPOWER_MINOR
"${UPOWER_MINOR}") # 2.28 => 28
+ if (${UPOWER_MAJOR} GREATER 0 OR ${UPOWER_MINOR} GREATER 89)
+ message (STATUS " Your version of UPower no longer supports logout
features")
+ else()
+ set (UPOWER_SUPPORTS_LOGOUT 1)
+ endif()
+else()
+ set (with_upower_support no)
+ message (STATUS "Could not find upower-glib; Logout and PowerManager plugin
won't be built with UPower support.")
+ message (WARNING "This module is required to compile LogOut and PowerManager applet
with UPower support: upower-glib")
+ set (MODULES_MISSING "${MODULES_MISSING} upower-glib")
+endif()
+
############# DISTRIBUTION #################
message (STATUS "> Distribution:")
# We try to detect if the user is on Ubuntu to know which bus we have to use...
@@ -965,18 +996,6 @@
############# LOGOUT #################
message (STATUS "> Logout:")
-enable_if_not_defined (enable-upower-support)
-if (enable-upower-support)
- pkg_check_modules (UPOWER upower-glib) # useful for Powermanager too.
-endif()
-if (UPOWER_FOUND)
- set (with_upower_support yes)
-else()
- set (with_upower_support no)
- message (STATUS "Could not find upower-glib; Logout and PowerManager plugin
won't be built with UPower support.")
- message (WARNING "This module is required to compile LogOut and PowerManager applet
with UPower support: upower-glib")
- set (MODULES_MISSING "${MODULES_MISSING} upower-glib")
-endif()
set (GETTEXT_LOGOUT ${GETTEXT_PLUGINS})
set (VERSION_LOGOUT "2.0.3")
set (PACKAGE_LOGOUT "cd-logout")
--- cairo-dock-plugins-3.3.2/logout/src/CMakeLists.txt.upower0 2013-10-03
20:04:33.000000000 +0900
+++ cairo-dock-plugins-3.3.2/logout/src/CMakeLists.txt 2014-06-16 14:01:03.155216380
+0900
@@ -20,22 +20,29 @@
add_definitions (-DMY_APPLET_GETTEXT_DOMAIN="${GETTEXT_LOGOUT}")
add_definitions (-DMY_APPLET_DOCK_VERSION="${dock_version}")
add_definitions (-DMY_APPLET_ICON_FILE="icon.svg")
-if (${UPOWER_FOUND})
- add_definitions (-DCD_UPOWER_AVAILABLE="1")
-endif()
+if (UPOWER_SUPPORTS_LOGOUT)
+ add_definitions (-DCD_UPOWER_AVAILABLE="1")
+
+ include_directories (
+ ${UPOWER_INCLUDE_DIRS}
+ ${PACKAGE_INCLUDE_DIRS})
+
+ link_directories (
+ ${UPOWER_LIBRARY_DIRS}
+ ${PACKAGE_LIBRARY_DIRS})
+
+ target_link_libraries (${PACKAGE_LOGOUT}
+ ${UPOWER_LIBRARIES}
+ ${PACKAGE_LIBRARIES})
+else()
+ include_directories (${PACKAGE_INCLUDE_DIRS})
-include_directories (
- ${UPOWER_INCLUDE_DIRS}
- ${PACKAGE_INCLUDE_DIRS})
-
-link_directories (
- ${UPOWER_LIBRARY_DIRS}
- ${PACKAGE_LIBRARY_DIRS})
-
-target_link_libraries (${PACKAGE_LOGOUT}
- ${UPOWER_LIBRARIES}
- ${PACKAGE_LIBRARIES})
+ link_directories (${PACKAGE_LIBRARY_DIRS})
+
+ target_link_libraries (${PACKAGE_LOGOUT}
+ ${PACKAGE_LIBRARIES})
+endif()
########### install files ###############
cairo-dock-plugins-3.3.2-upower-099-r3084-modified.patch:
CMakeLists.txt | 5 +-
logout/src/CMakeLists.txt | 2
powermanager/src/CMakeLists.txt | 5 +-
powermanager/src/powermanager-menu-functions.c | 16 ------
powermanager/src/powermanager-struct.h | 4 -
powermanager/src/powermanager-upower.c | 62 +++----------------------
powermanager/src/powermanager-upower.h | 10 ----
7 files changed, 18 insertions(+), 86 deletions(-)
--- NEW FILE cairo-dock-plugins-3.3.2-upower-099-r3084-modified.patch ---
--- cairo-dock-plugins-3.3.2/CMakeLists.txt.upower1 2014-06-16 14:01:49.819680691 +0900
+++ cairo-dock-plugins-3.3.2/CMakeLists.txt 2014-06-16 14:01:49.821680926 +0900
@@ -357,9 +357,10 @@
STRING (REGEX REPLACE "[0-9]*\\.([^ ]+)" "\\1" UPOWER_MINOR
"${UPOWER_VERSION}") # 2.28.3 => 2.28
STRING (REGEX REPLACE "\\.[0-9]*" "" UPOWER_MINOR
"${UPOWER_MINOR}") # 2.28 => 28
if (${UPOWER_MAJOR} GREATER 0 OR ${UPOWER_MINOR} GREATER 89)
- message (STATUS " Your version of UPower no longer supports logout
features")
+ message (STATUS " Your version of UPower no longer supports suspend/hibernate
features")
+ set (with_upower_support "yes (0.99+)")
else()
- set (UPOWER_SUPPORTS_LOGOUT 1)
+ set (UPOWER_SUPPORTS_SUSPEND_HIBERNATE 1)
endif()
else()
set (with_upower_support no)
--- cairo-dock-plugins-3.3.2/logout/src/CMakeLists.txt.upower1 2014-06-16
14:01:49.822681043 +0900
+++ cairo-dock-plugins-3.3.2/logout/src/CMakeLists.txt 2014-06-16 14:02:34.010855358
+0900
@@ -21,7 +21,7 @@
add_definitions (-DMY_APPLET_DOCK_VERSION="${dock_version}")
add_definitions (-DMY_APPLET_ICON_FILE="icon.svg")
-if (UPOWER_SUPPORTS_LOGOUT)
+if (UPOWER_SUPPORTS_SUSPEND_HIBERNATE)
add_definitions (-DCD_UPOWER_AVAILABLE="1")
include_directories (
--- cairo-dock-plugins-3.3.2/powermanager/src/CMakeLists.txt.upower1 2013-10-03
20:04:33.000000000 +0900
+++ cairo-dock-plugins-3.3.2/powermanager/src/CMakeLists.txt 2014-06-16 14:01:49.822681043
+0900
@@ -25,7 +25,10 @@
add_definitions (-DMY_APPLET_DOCK_VERSION="${dock_version}")
add_definitions (-DMY_APPLET_ICON_FILE="icon.png")
if (${UPOWER_FOUND})
- add_definitions (-DCD_UPOWER_AVAILABLE="1")
+ add_definitions (-DCD_UPOWER_AVAILABLE=1)
+ if (NOT UPOWER_SUPPORTS_SUSPEND_HIBERNATE)
+ add_definitions (-DCD_UPOWER_0_99=1)
+ endif()
endif()
include_directories (
---
cairo-dock-plugins-3.3.2/powermanager/src/powermanager-menu-functions.c.upower1 2013-10-03
20:04:33.000000000 +0900
+++ cairo-dock-plugins-3.3.2/powermanager/src/powermanager-menu-functions.c 2014-06-16
14:01:49.822681043 +0900
@@ -90,19 +90,5 @@
if (bAddSeparator)
CD_APPLET_ADD_SEPARATOR_IN_MENU (CD_APPLET_MY_MENU);
-
- // Power actions (Hibernate/Suspend)
- #ifdef CD_UPOWER_AVAILABLE // if Upower is available, we should be able to suspend; if
not, then it's probably just a problem with consolekit, which should be fixed by the
user; so show the items to give the user a hint about the problem.
- pMenuItem = CD_APPLET_ADD_IN_MENU (D_("Hibernate"), cd_power_hibernate,
CD_APPLET_MY_MENU);
- if (! cd_power_can_hibernate ())
- gtk_widget_set_sensitive (pMenuItem, FALSE);
- pMenuItem = CD_APPLET_ADD_IN_MENU (D_("Suspend"), cd_power_suspend,
CD_APPLET_MY_MENU);
- if (! cd_power_can_suspend ())
- gtk_widget_set_sensitive (pMenuItem, FALSE);
- #else
- if (cd_power_can_hibernate ())
- CD_APPLET_ADD_IN_MENU (D_("Hibernate"), cd_power_hibernate,
CD_APPLET_MY_MENU);
- if (cd_power_can_suspend ())
- CD_APPLET_ADD_IN_MENU (D_("Suspend"), cd_power_suspend, CD_APPLET_MY_MENU);
- #endif
+
CD_APPLET_ON_BUILD_MENU_END
--- cairo-dock-plugins-3.3.2/powermanager/src/powermanager-struct.h.upower1 2013-10-03
20:04:33.000000000 +0900
+++ cairo-dock-plugins-3.3.2/powermanager/src/powermanager-struct.h 2014-06-16
14:01:49.823681160 +0900
@@ -22,10 +22,6 @@
#include <cairo-dock.h>
#ifdef CD_UPOWER_AVAILABLE
-/* to access suspend/resume functionality on Upower 0.9
- * even if we use first logind, we only use logind via DBus
- */
-#define UPOWER_ENABLE_DEPRECATED
#include <upower.h>
#endif
--- cairo-dock-plugins-3.3.2/powermanager/src/powermanager-upower.c.upower1 2013-10-03
20:04:33.000000000 +0900
+++ cairo-dock-plugins-3.3.2/powermanager/src/powermanager-upower.c 2014-06-16
14:01:49.823681160 +0900
@@ -48,7 +48,11 @@
UpClient *pUPowerClient = up_client_new ();
// get the list of devices.
- if (pUPowerClient == NULL || ! up_client_enumerate_devices_sync (pUPowerClient, NULL,
NULL))
+ if (pUPowerClient == NULL
+ #ifndef CD_UPOWER_0_99 // no longer available with UPower 0.99+
+ || ! up_client_enumerate_devices_sync (pUPowerClient, NULL, NULL)
+ #endif
+ )
{
cd_warning ("couldn't get devices from UPower daemon");
if (pUPowerClient)
@@ -182,6 +186,7 @@
CD_APPLET_LEAVE ();
}
+#ifndef CD_UPOWER_0_99 // no longer used with UPower 0.99+
static void _on_device_changed (G_GNUC_UNUSED UpDevice *pDevice, G_GNUC_UNUSED gpointer
data)
{
CD_APPLET_ENTER;
@@ -194,6 +199,7 @@
update_icon ();
CD_APPLET_LEAVE ();
}
+#endif
// Can be launched the first time (with the Task) or when a device is added/removed
after.
static gboolean _cd_upower_update_state (CDSharedMemory *pSharedMemory)
@@ -248,6 +254,7 @@
g_free (cVendor);
g_free (cModel);
+ #ifndef CD_UPOWER_0_99 // no longer used with UPower 0.99+
if (myData.pTask != NULL // only the first time
|| myData.pBatteryDeviceList == NULL // or if it's a new device
|| g_list_find (myData.pBatteryDeviceList, pDevice) == NULL)
@@ -262,6 +269,7 @@
iSignalID = g_signal_connect (pDevice, "changed", G_CALLBACK
(_on_device_changed), NULL);
myData.pSignalIDList = g_list_append (myData.pSignalIDList, GINT_TO_POINTER
(iSignalID));
}
+ #endif
bFirst = FALSE;
}
@@ -364,38 +372,6 @@
}
}
-gboolean cd_power_hibernate (void)
-{
- if (myData.pUPowerClient != NULL)
- return up_client_hibernate_sync (myData.pUPowerClient, NULL, NULL);
- else
- return FALSE;
-}
-
-gboolean cd_power_suspend (void)
-{
- if (myData.pUPowerClient != NULL)
- return up_client_suspend_sync (myData.pUPowerClient, NULL, NULL);
- else
- return FALSE;
-}
-
-gboolean cd_power_can_hibernate (void)
-{
- if (myData.pUPowerClient != NULL)
- return up_client_get_can_hibernate (myData.pUPowerClient);
- else
- return FALSE;
-}
-
-gboolean cd_power_can_suspend (void)
-{
- if (myData.pUPowerClient != NULL)
- return up_client_get_can_suspend (myData.pUPowerClient);
- else
- return FALSE;
-}
-
#else // code without libupower
void cd_powermanager_start (void)
@@ -408,24 +384,4 @@
}
-gboolean cd_power_hibernate (void)
-{
- return FALSE;
-}
-
-gboolean cd_power_suspend (void)
-{
- return FALSE;
-}
-
-gboolean cd_power_can_hibernate (void)
-{
- return FALSE;
-}
-
-gboolean cd_power_can_suspend (void)
-{
- return FALSE;
-}
-
#endif
--- cairo-dock-plugins-3.3.2/powermanager/src/powermanager-upower.h.upower1 2013-10-03
20:04:33.000000000 +0900
+++ cairo-dock-plugins-3.3.2/powermanager/src/powermanager-upower.h 2014-06-16
14:01:49.823681160 +0900
@@ -27,14 +27,4 @@
void cd_upower_stop (void);
-
-gboolean cd_power_hibernate (void);
-
-gboolean cd_power_suspend (void);
-
-gboolean cd_power_can_hibernate (void);
-
-gboolean cd_power_can_suspend (void);
-
-
#endif
Index: cairo-dock.spec
===================================================================
RCS file: /cvs/free/rpms/cairo-dock/devel/cairo-dock.spec,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -r1.73 -r1.74
--- cairo-dock.spec 16 Jun 2014 03:08:58 -0000 1.73
+++ cairo-dock.spec 16 Jun 2014 05:06:44 -0000 1.74
@@ -29,7 +29,7 @@
%global build_webkit 1
%global build_xfce 1
-%global fedora_main_rel 1
+%global fedora_main_rel 2
%global fedora_rel %{?pre_release:0.}%{fedora_main_rel}%{?betaver:.%betaver}
@@ -66,6 +66,10 @@
Source0:
http://launchpad.net/cairo-dock-core/%{urlver}/%{mainver}%{?betaver:-%bet...
Source2:
http://launchpad.net/cairo-dock-plug-ins/%{urlver}/%{mainver}%{?betaver:-...
%endif
+#
http://bazaar.launchpad.net/~cairo-dock-team/cairo-dock-plug-ins/plug-ins...
+#
http://bazaar.launchpad.net/~cairo-dock-team/cairo-dock-plug-ins/plug-ins...
+Patch0: cairo-dock-plugins-3.3.2-upower-099-r3083-modified.patch
+Patch1: cairo-dock-plugins-3.3.2-upower-099-r3084-modified.patch
BuildRequires: cmake
@@ -326,6 +330,10 @@
# C. plug-ins
cd ../plug-ins
+# Patch
+%patch0 -p1 -b .upower0
+%patch1 -p1 -b .upower1
+
## permission
for dir in */
do
@@ -636,6 +644,9 @@
%{_libdir}/pkgconfig/*.pc
%changelog
+* Mon Jun 16 2014 Mamoru TASAKA <mtasaka(a)fedoraproject.org> - 3.3.2-2
+- Fix build with upower 0.99
+
* Mon Jun 16 2014 Mamoru TASAKA <mtasaka(a)fedoraproject.org> - 3.3.2-1
- Update to 3.3.2