From 0b0eee2b6ed519535f49b63284166e8d5f5490ea Mon Sep 17 00:00:00 2001 From: John Gebbie Date: Mon, 8 Aug 2022 20:37:27 +0100 Subject: [PATCH] New package: ydotool-1.0.1 --- srcpkgs/ydotool/INSTALL.msg | 6 +++++ srcpkgs/ydotool/files/80-uinput.rules | 3 +++ srcpkgs/ydotool/files/ydotool-workaround | 2 ++ srcpkgs/ydotool/files/ydotoold-workaround | 2 ++ srcpkgs/ydotool/files/ydotoold/run | 2 ++ srcpkgs/ydotool/template | 28 +++++++++++++++++++++++ 6 files changed, 43 insertions(+) create mode 100644 srcpkgs/ydotool/INSTALL.msg create mode 100644 srcpkgs/ydotool/files/80-uinput.rules create mode 100755 srcpkgs/ydotool/files/ydotool-workaround create mode 100755 srcpkgs/ydotool/files/ydotoold-workaround create mode 100755 srcpkgs/ydotool/files/ydotoold/run create mode 100644 srcpkgs/ydotool/template diff --git a/srcpkgs/ydotool/INSTALL.msg b/srcpkgs/ydotool/INSTALL.msg new file mode 100644 index 000000000000..1812d29a7afc --- /dev/null +++ b/srcpkgs/ydotool/INSTALL.msg @@ -0,0 +1,6 @@ +udev rules for uinput has been installed, +to access /dev/uinput, add yourself to group input: + + $ sudo usermod -a -G input $USER + +and then re-login to make it effective. diff --git a/srcpkgs/ydotool/files/80-uinput.rules b/srcpkgs/ydotool/files/80-uinput.rules new file mode 100644 index 000000000000..988d34547f52 --- /dev/null +++ b/srcpkgs/ydotool/files/80-uinput.rules @@ -0,0 +1,3 @@ +## ydotoold fix +## https://github.com/ReimuNotMoe/ydotool/issues/25#issuecomment-535842993 +KERNEL=="uinput", GROUP="input", MODE="0660", OPTIONS+="static_node=uinput" diff --git a/srcpkgs/ydotool/files/ydotool-workaround b/srcpkgs/ydotool/files/ydotool-workaround new file mode 100755 index 000000000000..7264726a6433 --- /dev/null +++ b/srcpkgs/ydotool/files/ydotool-workaround @@ -0,0 +1,2 @@ +#!/bin/sh +YDOTOOL_SOCKET="${YDOTOOL_SOCKET:-/var/lib/ydotoold/socket}" /usr/libexec/ydotool "$@" diff --git a/srcpkgs/ydotool/files/ydotoold-workaround b/srcpkgs/ydotool/files/ydotoold-workaround new file mode 100755 index 000000000000..ae4558078719 --- /dev/null +++ b/srcpkgs/ydotool/files/ydotoold-workaround @@ -0,0 +1,2 @@ +#!/bin/sh +/usr/libexec/ydotoold -p /var/lib/ydotoold/socket -P 660 diff --git a/srcpkgs/ydotool/files/ydotoold/run b/srcpkgs/ydotool/files/ydotoold/run new file mode 100755 index 000000000000..430cefd9bcd9 --- /dev/null +++ b/srcpkgs/ydotool/files/ydotoold/run @@ -0,0 +1,2 @@ +#!/bin/sh +exec chpst -u _ydotoold:input ydotoold 2>&1 diff --git a/srcpkgs/ydotool/template b/srcpkgs/ydotool/template new file mode 100644 index 000000000000..fce12650fb4d --- /dev/null +++ b/srcpkgs/ydotool/template @@ -0,0 +1,28 @@ +# Template file for 'ydotool' +pkgname=ydotool +version=1.0.1 +revision=1 +build_style=cmake +hostmakedepends="pkg-config scdoc" +short_desc="Generic command-line automation tool, works on Wayland and X11" +maintainer="John Gebbie " +license="AGPL-3.0-only" +homepage="https://github.com/ReimuNotMoe/ydotool" +distfiles="https://github.com/ReimuNotMoe/ydotool/archive/v${version}.tar.gz" +checksum=02311cdc608f205711b06a95e5fd71093b2294f4920efc526f5e98a2ddab42b8 + +system_accounts="_ydotoold" +_ydotoold_groups="input" + +# Used instead of /tmp so any group input user can replace the socket. +make_dirs='/var/lib/ydotoold 0775 _ydotoold input' + +post_install() { + vinstall "${DESTDIR}/usr/bin/ydotool" 755 /usr/libexec + vbin "${FILESDIR}/ydotool-workaround" ydotool + vinstall "${DESTDIR}/usr/bin/ydotoold" 755 /usr/libexec + vbin "${FILESDIR}/ydotoold-workaround" ydotoold + vsv ydotoold + vinstall "${FILESDIR}/80-uinput.rules" 644 usr/lib/udev/rules.d + vlicense LICENSE +}