pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/x11 New package for xidle. From pkgsrc-wip.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/6acd76b3df0b
branches:  trunk
changeset: 386409:6acd76b3df0b
user:      bsiegert <bsiegert%pkgsrc.org@localhost>
date:      Sat Oct 08 10:06:51 2022 +0000

description:
New package for xidle. From pkgsrc-wip.

xidle uses the XScreenSaver(3) extension to receive inactivity events
when a timeout is specified, running a specific program after the
elapsed time.

xidle also monitors the very corner of the given position for pointer
activity and runs a program if the pointer sits there for more than the
specified number of seconds.

diffstat:

 x11/Makefile                     |   3 +-
 x11/xidle/DESCR                  |   7 ++++++
 x11/xidle/MESSAGE                |   9 ++++++++
 x11/xidle/Makefile               |  43 +++++++++++++++++++++++++++++++++++++++
 x11/xidle/PLIST                  |   3 ++
 x11/xidle/distinfo               |   8 +++++++
 x11/xidle/patches/patch-Makefile |  21 +++++++++++++++++++
 x11/xidle/patches/patch-xidle.1  |  15 +++++++++++++
 x11/xidle/patches/patch-xidle.c  |  44 ++++++++++++++++++++++++++++++++++++++++
 9 files changed, 152 insertions(+), 1 deletions(-)

diffs (199 lines):

diff -r ecc8161357f1 -r 6acd76b3df0b x11/Makefile
--- a/x11/Makefile      Sat Oct 08 10:04:13 2022 +0000
+++ b/x11/Makefile      Sat Oct 08 10:06:51 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.964 2022/09/24 07:01:26 wiz Exp $
+# $NetBSD: Makefile,v 1.965 2022/10/08 10:06:51 bsiegert Exp $
 #
 
 COMMENT=       Packages to support the X Window System
@@ -611,6 +611,7 @@
 SUBDIR+=       xhangglider
 SUBDIR+=       xhost
 SUBDIR+=       xicc
+SUBDIR+=       xidle
 SUBDIR+=       xinit
 SUBDIR+=       xinput
 SUBDIR+=       xisxwayland
diff -r ecc8161357f1 -r 6acd76b3df0b x11/xidle/DESCR
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/x11/xidle/DESCR   Sat Oct 08 10:06:51 2022 +0000
@@ -0,0 +1,7 @@
+xidle uses the XScreenSaver(3) extension to receive inactivity events
+when a timeout is specified, running a specific program after the
+elapsed time.
+
+xidle also monitors the very corner of the given position for pointer
+activity and runs a program if the pointer sits there for more than the
+specified number of seconds.
diff -r ecc8161357f1 -r 6acd76b3df0b x11/xidle/MESSAGE
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/x11/xidle/MESSAGE Sat Oct 08 10:06:51 2022 +0000
@@ -0,0 +1,9 @@
+===========================================================================
+$NetBSD: MESSAGE,v 1.1 2022/10/08 10:06:51 bsiegert Exp $
+
+Unless told otherwise, xidle will attempt to start xlock(1) as default
+screen locker.
+
+Install x11/xlockmore if you wish for this behaviour to take effect.
+
+===========================================================================
diff -r ecc8161357f1 -r 6acd76b3df0b x11/xidle/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/x11/xidle/Makefile        Sat Oct 08 10:06:51 2022 +0000
@@ -0,0 +1,43 @@
+# $NetBSD: Makefile,v 1.1 2022/10/08 10:06:51 bsiegert Exp $
+
+DISTNAME=      xidle-20220718
+CATEGORIES=    x11
+MASTER_SITES=  https://sehnsucht.multics.org/pub/pkgsrc/distfiles/
+DIST_SUBDIR=   ${PKGNAME_NOREV}
+EXTRACT_SUFX=  .tar.xz
+
+MAINTAINER=    vms%retrobsd.ddns.net@localhost
+HOMEPAGE=      https://man.openbsd.org/xidle.1
+COMMENT=       Run a program on X inactivity
+LICENSE=       isc
+
+MAKEFLAGS+=    X11BASE=${X11BASE}
+MAKEFLAGS+=    MANDIR=${PKGMANDIR}
+MAKEFLAGS+=    CFLAGS=${CFLAGS:Q}
+
+SUBST_CLASSES+=                paths
+SUBST_STAGE.paths=     pre-configure
+SUBST_FILES.paths+=    xidle.c
+SUBST_FILES.paths+=    xidle.1
+SUBST_VARS.paths=      PREFIX
+SUBST_MESSAGE.paths=   Setting default locker's path.
+
+INSTALLATION_DIRS=     bin ${PKGMANDIR}/man1
+
+do-install:
+       ${INSTALL_PROGRAM} ${WRKSRC}/xidle ${DESTDIR}${PREFIX}/bin
+       ${INSTALL_MAN} ${WRKSRC}/xidle.1 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1
+
+.include "../../mk/bsd.prefs.mk"
+
+.if ${OPSYS} == "Linux"        # strtonum()
+LDFLAGS+=   -lbsd
+.include "../../devel/libbsd/buildlink3.mk"
+.endif
+
+.include "../../x11/libXdmcp/buildlink3.mk"
+.include "../../x11/libXScrnSaver/buildlink3.mk"
+.include "../../x11/libXau/buildlink3.mk"
+.include "../../x11/libXext/buildlink3.mk"
+.include "../../x11/libX11/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff -r ecc8161357f1 -r 6acd76b3df0b x11/xidle/PLIST
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/x11/xidle/PLIST   Sat Oct 08 10:06:51 2022 +0000
@@ -0,0 +1,3 @@
+@comment $NetBSD: PLIST,v 1.1 2022/10/08 10:06:51 bsiegert Exp $
+bin/xidle
+man/man1/xidle.1
diff -r ecc8161357f1 -r 6acd76b3df0b x11/xidle/distinfo
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/x11/xidle/distinfo        Sat Oct 08 10:06:51 2022 +0000
@@ -0,0 +1,8 @@
+$NetBSD: distinfo,v 1.1 2022/10/08 10:06:51 bsiegert Exp $
+
+BLAKE2s (xidle-20220718/xidle-20220718.tar.xz) = fb40e18d9bfe7b8379b57390e79e35a7df2f06223632f8c71da4c20244eaff92
+SHA512 (xidle-20220718/xidle-20220718.tar.xz) = f72fdc91a2c9173ca26291d46ed3857624a1be7c44918bf7e985f0dae184eb8c0201c4e0fb0cda5f33e6f488835f7a68e888aebc180c1eca3c4396a67e659c86
+Size (xidle-20220718/xidle-20220718.tar.xz) = 5640 bytes
+SHA1 (patch-Makefile) = f93b2ffc31da13d143dd157d670e299f0568713a
+SHA1 (patch-xidle.1) = dcb4906dd1ca4780925ffd96193afd3cdb3b6401
+SHA1 (patch-xidle.c) = 02058baddefbad2ba42784eba6fce980a1020314
diff -r ecc8161357f1 -r 6acd76b3df0b x11/xidle/patches/patch-Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/x11/xidle/patches/patch-Makefile  Sat Oct 08 10:06:51 2022 +0000
@@ -0,0 +1,21 @@
+$NetBSD: patch-Makefile,v 1.1 2022/10/08 10:06:52 bsiegert Exp $
+
+Portability fixes for pkgsrc.
+
+--- Makefile.orig      2015-05-26 05:22:15.000000000 +0000
++++ Makefile
+@@ -1,6 +1,3 @@
+-# $OpenBSD: Makefile,v 1.7 2011/06/23 22:48:59 naddy Exp $
+-.include <bsd.xconf.mk>
+-
+ PROG= xidle
+ 
+ CPPFLAGS+= -I${X11BASE}/include
+@@ -9,7 +6,4 @@ LDADD+=        -L${X11BASE}/lib -lXss -lXext -l
+ 
+ MANDIR=       ${X11BASE}/man/man
+ 
+-obj: _xenocara_obj
+-
+ .include <bsd.prog.mk>
+-.include <bsd.xorg.mk>
diff -r ecc8161357f1 -r 6acd76b3df0b x11/xidle/patches/patch-xidle.1
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/x11/xidle/patches/patch-xidle.1   Sat Oct 08 10:06:51 2022 +0000
@@ -0,0 +1,15 @@
+$NetBSD: patch-xidle.1,v 1.1 2022/10/08 10:06:52 bsiegert Exp $
+
+Do not hard-code xlock path.
+
+--- xidle.1.orig       2015-05-26 05:22:15.000000000 +0000
++++ xidle.1
+@@ -127,7 +127,7 @@ Run
+ using the flying bats mode if no activity is detected in 300 seconds or the
+ pointer sits in the southwest corner for more than 5 seconds:
+ .Bd -literal -offset indent
+-$ xidle -delay 5 -sw -program "/usr/X11R6/bin/xlock -mode bat" \e
++$ xidle -delay 5 -sw -program "@PREFIX@/bin/xlock -mode bat" \e
+       -timeout 300
+ .Ed
+ .Sh SEE ALSO
diff -r ecc8161357f1 -r 6acd76b3df0b x11/xidle/patches/patch-xidle.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/x11/xidle/patches/patch-xidle.c   Sat Oct 08 10:06:51 2022 +0000
@@ -0,0 +1,44 @@
+$NetBSD: patch-xidle.c,v 1.1 2022/10/08 10:06:52 bsiegert Exp $
+
+Portability fixes:
+
+- Define non-standard compiler attribute extension.
+- Do not hard-code xlock path.
+- Disable pledge.
+- Use libbsd on Linux.
+
+--- xidle.c.orig       2022-07-18 06:17:31.000000000 +0000
++++ xidle.c
+@@ -39,15 +39,21 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
++#ifdef __linux__
++#include <bsd/stdlib.h>
++#endif
+ 
+ #ifndef CLASS_NAME
+ #define CLASS_NAME    "XIdle"
+ #endif
+ 
+ #ifndef PATH_PROG
+-#define PATH_PROG     "/usr/X11R6/bin/xlock"
++#define PATH_PROG     "@PREFIX@/bin/xlock"
+ #endif
+ 
++#ifndef       __dead 
++#define __dead      __attribute__((__noreturn__))
++#endif
+ 
+ enum {
+       north = 0x01,
+@@ -354,9 +360,6 @@ main(int argc, char **argv)
+       if (fd > 2)
+               close(fd);
+ 
+-      if (pledge("stdio proc exec", NULL) == -1)
+-              err(1, "pledge");
+-
+       for (;;) {
+               XEvent ev;
+               u_long mask;



Home | Main Index | Thread Index | Old Index