x11-misc/xautolock: Use waitpid() instead of wait3()
authorJeroen Roovers <jer@gentoo.org>
Tue, 15 Jan 2019 10:34:18 +0000 (11:34 +0100)
committerJeroen Roovers <jer@gentoo.org>
Tue, 15 Jan 2019 10:34:57 +0000 (11:34 +0100)
Fixes: https://bugs.gentoo.org/675242
Package-Manager: Portage-2.3.55, Repoman-2.3.12
Signed-off-by: Jeroen Roovers <jer@gentoo.org>
x11-misc/xautolock/files/xautolock-2.2_p5_p1-waitpid.patch [new file with mode: 0644]
x11-misc/xautolock/metadata.xml
x11-misc/xautolock/xautolock-2.2_p5_p1-r1.ebuild [new file with mode: 0644]

diff --git a/x11-misc/xautolock/files/xautolock-2.2_p5_p1-waitpid.patch b/x11-misc/xautolock/files/xautolock-2.2_p5_p1-waitpid.patch
new file mode 100644 (file)
index 0000000..98d96b2
--- /dev/null
@@ -0,0 +1,25 @@
+--- a/src/engine.c
++++ b/src/engine.c
+@@ -210,22 +210,14 @@ evaluateTriggers (Display* d)
+ #else /* VMS */
+   if (lockerPid)
+   {
+-#if !defined (UTEKV) && !defined (SYSV) && !defined (SVR4)
+-    union wait  status;      /* childs process status */
+-#else /* !UTEKV && !SYSV && !SVR4 */
+     int         status = 0;  /* childs process status */
+-#endif /* !UTEKV && !SYSV && !SVR4 */
+     if (unlockNow && !disabled)
+     {
+       (void) kill (lockerPid, SIGTERM);
+     }
+-#if !defined (UTEKV) && !defined (SYSV) && !defined (SVR4)
+-    if (wait3 (&status, WNOHANG, 0))
+-#else /* !UTEKV && !SYSV && !SVR4 */
+     if (waitpid (-1, &status, WNOHANG)) 
+-#endif /* !UTEKV && !SYSV && !SVR4 */
+     {
+      /*
+       *  If the locker exited normally, we disable any pending kill
index 2ba8e9e851e413eb2cfe9eadf6be043f82631998..b822c45366ac15ba2930e6b0d6012926bb56a21d 100644 (file)
@@ -5,4 +5,15 @@
                <email>desktop-misc@gentoo.org</email>
                <name>Gentoo Desktop Miscellaneous Project</name>
        </maintainer>
+<longdescription lang='en'>
+If no user activity is detected after a set timeout, xautolock runs a program
+for you. If you want that program (with optional arguments) to be a screen
+locker, then one of these packages might fit your purpose:
+       x11-misc/alock
+       x11-misc/i3lock
+       x11-misc/slim
+       x11-misc/slock
+       x11-misc/xlockmore
+       x11-misc/xtrlock
+</longdescription>
 </pkgmetadata>
diff --git a/x11-misc/xautolock/xautolock-2.2_p5_p1-r1.ebuild b/x11-misc/xautolock/xautolock-2.2_p5_p1-r1.ebuild
new file mode 100644 (file)
index 0000000..63dd367
--- /dev/null
@@ -0,0 +1,54 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit toolchain-funcs versionator
+
+DESCRIPTION="An automatic X screen-locker/screen-saver"
+HOMEPAGE="http://www.ibiblio.org/pub/Linux/X11/screensavers/"
+
+DEB_REV_MAJ="$(get_version_component_range 3)"
+DEB_REV_MIN="$(get_version_component_range 4)"
+DEB_REVISION="${DEB_REV_MAJ/p}.${DEB_REV_MIN/p}"
+SRC_URI="
+       ${HOMEPAGE}/${P/_p*/}.tgz
+       mirror://debian/pool/main/x/${PN}/${PN}_${PV/_p*/}-${DEB_REVISION}.debian.tar.xz
+"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~sparc ~x86"
+
+RDEPEND="
+       x11-libs/libXScrnSaver
+"
+DEPEND="
+       ${RDEPEND}
+       app-text/rman
+       x11-base/xorg-proto
+       x11-misc/imake
+"
+PATCHES=(
+       "${WORKDIR}"/debian/patches/10-fix-memory-corruption.patch
+       "${WORKDIR}"/debian/patches/11-fix-no-dpms.patch
+       "${WORKDIR}"/debian/patches/12-fix-manpage.patch
+       "${WORKDIR}"/debian/patches/13-fix-hppa-build.patch
+       "${FILESDIR}"/${PN}-2.2_p5_p1-waitpid.patch
+)
+S=${WORKDIR}/${P/_p*}
+
+src_configure() {
+       xmkmf || die
+}
+
+src_compile() {
+       emake \
+               CC="$(tc-getCC)" \
+               CDEBUGFLAGS="${CFLAGS}" \
+               EXTRA_LDOPTIONS="${LDFLAGS}"
+}
+
+src_install () {
+       dobin xautolock
+       newman xautolock.man xautolock.1
+       dodoc Changelog Readme Todo
+}