Sun Feb 6 17:42:47 2022 UTC ()
xfce4-session: adjust two patches

Amend a patch that fixes compilation on non-Linux and non-BSD OSes.
There are several things that could be adjusted differently in the
function in question, but that needs to be discussed upstream. For now,
take the simplest route.

Also, be consistent with upstream's intent that "suspend" means ACPI
state 3, also being consistent with what was patched in xfce4-power-
manager before, too. (Where suspend and resume generally works for me
on NetBSD laptops, state 3 is effective.)


(gutteridge)
diff -r1.93 -r1.94 pkgsrc/x11/xfce4-session/Makefile
diff -r1.34 -r1.35 pkgsrc/x11/xfce4-session/distinfo
diff -r1.1 -r1.2 pkgsrc/x11/xfce4-session/patches/patch-libxfsm_xfsm-shutdown-common.h
diff -r1.2 -r1.3 pkgsrc/x11/xfce4-session/patches/patch-xfce4-session_xfsm-shutdown-fallback.c

cvs diff -r1.93 -r1.94 pkgsrc/x11/xfce4-session/Makefile (expand / switch to unified diff)

--- pkgsrc/x11/xfce4-session/Makefile 2021/12/08 16:07:16 1.93
+++ pkgsrc/x11/xfce4-session/Makefile 2022/02/06 17:42:47 1.94
@@ -1,19 +1,19 @@ @@ -1,19 +1,19 @@
1# $NetBSD: Makefile,v 1.93 2021/12/08 16:07:16 adam Exp $ 1# $NetBSD: Makefile,v 1.94 2022/02/06 17:42:47 gutteridge Exp $
2 2
3PKGREVISION= 1 
4.include "../../meta-pkgs/xfce4/Makefile.common" 3.include "../../meta-pkgs/xfce4/Makefile.common"
5 4
6DISTNAME= xfce4-session-4.16.0 5DISTNAME= xfce4-session-4.16.0
 6PKGREVISION= 2
7CATEGORIES= x11 7CATEGORIES= x11
8MASTER_SITES+= https://archive.xfce.org/src/xfce/xfce4-session/4.16/ 8MASTER_SITES+= https://archive.xfce.org/src/xfce/xfce4-session/4.16/
9 9
10HOMEPAGE= https://docs.xfce.org/xfce/xfce4-session/start 10HOMEPAGE= https://docs.xfce.org/xfce/xfce4-session/start
11COMMENT= Xfce session manager 11COMMENT= Xfce session manager
12 12
13PKGCONFIG_OVERRIDE+= libxfsm/xfce4-session-2.0.pc.in 13PKGCONFIG_OVERRIDE+= libxfsm/xfce4-session-2.0.pc.in
14 14
15BUILD_DEFS+= PKG_SYSCONFBASE 15BUILD_DEFS+= PKG_SYSCONFBASE
16 16
17CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFBASE} 17CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFBASE}
18CONFIGURE_ARGS+= ICEAUTH=${TOOLS_PATH.iceauth} 18CONFIGURE_ARGS+= ICEAUTH=${TOOLS_PATH.iceauth}
19 19

cvs diff -r1.34 -r1.35 pkgsrc/x11/xfce4-session/distinfo (expand / switch to unified diff)

--- pkgsrc/x11/xfce4-session/distinfo 2021/11/30 14:31:09 1.34
+++ pkgsrc/x11/xfce4-session/distinfo 2022/02/06 17:42:47 1.35
@@ -1,13 +1,13 @@ @@ -1,13 +1,13 @@
1$NetBSD: distinfo,v 1.34 2021/11/30 14:31:09 gutteridge Exp $ 1$NetBSD: distinfo,v 1.35 2022/02/06 17:42:47 gutteridge Exp $
2 2
3BLAKE2s (xfce4-session-4.16.0.tar.bz2) = c47d2336881178cc04dccf92d345e58e39118644636993ab5228833601cf8119 3BLAKE2s (xfce4-session-4.16.0.tar.bz2) = c47d2336881178cc04dccf92d345e58e39118644636993ab5228833601cf8119
4SHA512 (xfce4-session-4.16.0.tar.bz2) = fd74b24d0c2762b5a99883b62ca9447c3683e42e9e39193d0f60e02b8c1ad77a3dfff4df6f3b3c345d8ea3d4c4ef93485e9b5586862bab85d4b37110d3400fad 4SHA512 (xfce4-session-4.16.0.tar.bz2) = fd74b24d0c2762b5a99883b62ca9447c3683e42e9e39193d0f60e02b8c1ad77a3dfff4df6f3b3c345d8ea3d4c4ef93485e9b5586862bab85d4b37110d3400fad
5Size (xfce4-session-4.16.0.tar.bz2) = 875504 bytes 5Size (xfce4-session-4.16.0.tar.bz2) = 875504 bytes
6SHA1 (patch-ac) = acbb27c79b5b6f37ff106c6cbbc87d00ecfe19f5 6SHA1 (patch-ac) = acbb27c79b5b6f37ff106c6cbbc87d00ecfe19f5
7SHA1 (patch-config.h.in) = 30e2ae1ea70a99a83f11523e940081b661add69b 7SHA1 (patch-config.h.in) = 30e2ae1ea70a99a83f11523e940081b661add69b
8SHA1 (patch-configure) = 155a85a71b42fb360d97c4fda87d54a16f567c87 8SHA1 (patch-configure) = 155a85a71b42fb360d97c4fda87d54a16f567c87
9SHA1 (patch-libxfsm_xfsm-shutdown-common.h) = da51714e0924a0ab28f7da1b161659763dff81d2 9SHA1 (patch-libxfsm_xfsm-shutdown-common.h) = 4712465218a6bc9beb740203e820203d08b06c06
10SHA1 (patch-scripts_Makefile.in) = 042c3d9c632a57f9acfc8dab43aa6bca8ec69097 10SHA1 (patch-scripts_Makefile.in) = 042c3d9c632a57f9acfc8dab43aa6bca8ec69097
11SHA1 (patch-settings_xfce4-session.xml) = 7e990e73d8dab022f3ebd2d4daa24ebc8dcf95a1 11SHA1 (patch-settings_xfce4-session.xml) = 7e990e73d8dab022f3ebd2d4daa24ebc8dcf95a1
12SHA1 (patch-xfce4-session_xfsm-shutdown-fallback.c) = 6f37dbba8dfb1c4f31b16f395c3e4244466eb0aa 12SHA1 (patch-xfce4-session_xfsm-shutdown-fallback.c) = bd3133e9f1dc4a2069203d75058710fe66623c0e
13SHA1 (patch-xfsm-shutdown-helper_main.c) = db2dc4a7ce729b72092fa2777fd178cb3b7be258 13SHA1 (patch-xfsm-shutdown-helper_main.c) = db2dc4a7ce729b72092fa2777fd178cb3b7be258

cvs diff -r1.1 -r1.2 pkgsrc/x11/xfce4-session/patches/patch-libxfsm_xfsm-shutdown-common.h (expand / switch to unified diff)

--- pkgsrc/x11/xfce4-session/patches/patch-libxfsm_xfsm-shutdown-common.h 2019/05/23 02:56:07 1.1
+++ pkgsrc/x11/xfce4-session/patches/patch-libxfsm_xfsm-shutdown-common.h 2022/02/06 17:42:47 1.2
@@ -1,16 +1,16 @@ @@ -1,16 +1,16 @@
1$NetBSD: patch-libxfsm_xfsm-shutdown-common.h,v 1.1 2019/05/23 02:56:07 gutteridge Exp $ 1$NetBSD: patch-libxfsm_xfsm-shutdown-common.h,v 1.2 2022/02/06 17:42:47 gutteridge Exp $
2 2
3Add NetBSD commands. 3Add NetBSD commands.
4 4
5--- libxfsm/xfsm-shutdown-common.h.orig 2019-05-05 22:00:21.000000000 +0000 5--- libxfsm/xfsm-shutdown-common.h.orig 2019-05-05 22:00:21.000000000 +0000
6+++ libxfsm/xfsm-shutdown-common.h 6+++ libxfsm/xfsm-shutdown-common.h
7@@ -70,4 +70,9 @@ 7@@ -70,4 +70,9 @@
8 #define UP_BACKEND_HIBERNATE_COMMAND "/usr/sbin/ZZZ" 8 #define UP_BACKEND_HIBERNATE_COMMAND "/usr/sbin/ZZZ"
9 #endif 9 #endif
10  10
11+#ifdef BACKEND_TYPE_NETBSD 11+#ifdef BACKEND_TYPE_NETBSD
12+#define UP_BACKEND_SUSPEND_COMMAND "/sbin/sysctl -w hw.acpi.sleep.state=1" 12+#define UP_BACKEND_SUSPEND_COMMAND "/sbin/sysctl -w hw.acpi.sleep.state=3"
13+#define UP_BACKEND_HIBERNATE_COMMAND "/sbin/sysctl -w hw.acpi.sleep.state=4" 13+#define UP_BACKEND_HIBERNATE_COMMAND "/sbin/sysctl -w hw.acpi.sleep.state=4"
14+#endif 14+#endif
15+ 15+
16 #endif /* __XFSM_SHUTDOWN_COMMON_H_ */ 16 #endif /* __XFSM_SHUTDOWN_COMMON_H_ */

cvs diff -r1.2 -r1.3 pkgsrc/x11/xfce4-session/patches/patch-xfce4-session_xfsm-shutdown-fallback.c (expand / switch to unified diff)

--- pkgsrc/x11/xfce4-session/patches/patch-xfce4-session_xfsm-shutdown-fallback.c 2020/03/03 05:06:20 1.2
+++ pkgsrc/x11/xfce4-session/patches/patch-xfce4-session_xfsm-shutdown-fallback.c 2022/02/06 17:42:47 1.3
@@ -1,30 +1,31 @@ @@ -1,30 +1,31 @@
1$NetBSD: patch-xfce4-session_xfsm-shutdown-fallback.c,v 1.2 2020/03/03 05:06:20 gutteridge Exp $ 1$NetBSD: patch-xfce4-session_xfsm-shutdown-fallback.c,v 1.3 2022/02/06 17:42:47 gutteridge Exp $
2 2
3Fix compilation on OSes other than Linux and the *BSDs. 3Fix compilation on OSes other than Linux and the *BSDs.
4 4
5--- xfce4-session/xfsm-shutdown-fallback.c.orig 2019-05-17 12:46:28.000000000 +0000 5--- xfce4-session/xfsm-shutdown-fallback.c.orig 2020-11-06 23:08:55.000000000 +0000
6+++ xfce4-session/xfsm-shutdown-fallback.c 6+++ xfce4-session/xfsm-shutdown-fallback.c
7@@ -371,7 +371,9 @@ xfsm_shutdown_fallback_try_action (XfsmS 7@@ -373,7 +373,9 @@ xfsm_shutdown_fallback_try_action (XfsmS
8 GError **error) 8 GError **error)
9 { 9 {
10 const gchar *xfsm_helper_action; 10 const gchar *xfsm_helper_action;
 11- const gchar *cmd __attribute__((unused));
11+#ifdef __BACKEND_TYPE_BSD__ 12+#ifdef __BACKEND_TYPE_BSD__
12 const gchar *cmd __attribute__((unused)); 13+ const gchar *cmd;
13+#endif 14+#endif
14 gboolean ret = FALSE; 15 gboolean ret = FALSE;
15 gint exit_status = 0; 16 gint exit_status = 0;
16 #ifdef HAVE_POLKIT 17 #ifdef HAVE_POLKIT
17@@ -382,29 +384,39 @@ xfsm_shutdown_fallback_try_action (XfsmS 18@@ -384,29 +386,39 @@ xfsm_shutdown_fallback_try_action (XfsmS
18 { 19 {
19 case XFSM_SHUTDOWN_SHUTDOWN: 20 case XFSM_SHUTDOWN_SHUTDOWN:
20 xfsm_helper_action = "shutdown"; 21 xfsm_helper_action = "shutdown";
21+#ifdef __BACKEND_TYPE_BSD__ 22+#ifdef __BACKEND_TYPE_BSD__
22 cmd = POWEROFF_CMD; 23 cmd = POWEROFF_CMD;
23+#endif 24+#endif
24 break; 25 break;
25 case XFSM_SHUTDOWN_RESTART: 26 case XFSM_SHUTDOWN_RESTART:
26 xfsm_helper_action = "restart"; 27 xfsm_helper_action = "restart";
27+#ifdef __BACKEND_TYPE_BSD__ 28+#ifdef __BACKEND_TYPE_BSD__
28 cmd = REBOOT_CMD; 29 cmd = REBOOT_CMD;
29+#endif 30+#endif
30 break; 31 break;
@@ -44,13 +45,22 @@ Fix compilation on OSes other than Linux @@ -44,13 +45,22 @@ Fix compilation on OSes other than Linux
44+#endif 45+#endif
45 /* On hibernate we try to lock the screen */ 46 /* On hibernate we try to lock the screen */
46 if (!lock_screen (error)) 47 if (!lock_screen (error))
47 return FALSE; 48 return FALSE;
48 break; 49 break;
49 case XFSM_SHUTDOWN_HYBRID_SLEEP: 50 case XFSM_SHUTDOWN_HYBRID_SLEEP:
50 xfsm_helper_action = "hybrid-sleep"; 51 xfsm_helper_action = "hybrid-sleep";
51+#ifdef __BACKEND_TYPE_BSD__ 52+#ifdef __BACKEND_TYPE_BSD__
52 cmd = UP_BACKEND_HIBERNATE_COMMAND; 53 cmd = UP_BACKEND_HIBERNATE_COMMAND;
53+#endif 54+#endif
54 /* On hybrid sleep we try to lock the screen */ 55 /* On hybrid sleep we try to lock the screen */
55 if (!lock_screen (error)) 56 if (!lock_screen (error))
56 return FALSE; 57 return FALSE;
 58@@ -434,7 +446,7 @@ xfsm_shutdown_fallback_try_action (XfsmS
 59 #endif
 60 if (!ret)
 61 {
 62- g_set_error (error, 1, 0, "Failed to %s (%s)", xfsm_helper_action, cmd);
 63+ g_set_error (error, 1, 0, "Failed to %s", xfsm_helper_action);
 64 }
 65 return ret;
 66 }