commit:     97302339c8c2d04c2ea5dae831f03aa8e499694a
Author:     John Helmert III <ajak <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 25 18:53:35 2021 +0000
Commit:     John Helmert III <ajak <AT> gentoo <DOT> org>
CommitDate: Sat Sep 25 20:46:46 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=97302339

app-misc/ckb: fix compatibility with libinput drivers 1.2.0

Closes: https://bugs.gentoo.org/814797
Signed-off-by: John Helmert III <ajak <AT> gentoo.org>

 app-misc/ckb/ckb-0.4.4-r2.ebuild                  | 65 +++++++++++++++++++++++
 app-misc/ckb/files/ckb-0.4.4-libinput-1.2.0.patch | 29 ++++++++++
 2 files changed, 94 insertions(+)

diff --git a/app-misc/ckb/ckb-0.4.4-r2.ebuild b/app-misc/ckb/ckb-0.4.4-r2.ebuild
new file mode 100644
index 00000000000..e5c7f397433
--- /dev/null
+++ b/app-misc/ckb/ckb-0.4.4-r2.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit xdg cmake
+
+DESCRIPTION="Corsair K65/K70/K95 Driver"
+HOMEPAGE="https://github.com/ckb-next/ckb-next";
+SRC_URI="https://github.com/ckb-next/ckb-next/archive/v${PV}.tar.gz -> 
${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="systemd"
+
+RDEPEND="
+       dev-libs/libdbusmenu-qt
+       dev-libs/quazip:0=
+       dev-qt/qtcore:5
+       dev-qt/qtdbus:5
+       dev-qt/qtgui:5
+       dev-qt/qtnetwork:5
+       dev-qt/qtwidgets:5
+       dev-qt/qtx11extras:5
+       media-sound/pulseaudio
+       virtual/libudev:=
+       x11-libs/libX11
+       x11-libs/libxcb:=
+       x11-libs/xcb-util-wm"
+DEPEND="${RDEPEND}"
+BDEPEND="dev-qt/linguist-tools:5"
+
+S="${WORKDIR}/${PN}-next-${PV}"
+
+PATCHES=(
+       "${FILESDIR}/${P}-libinput-1.2.0.patch"
+)
+
+src_configure() {
+       local mycmakeargs=(
+               -DDISABLE_UPDATER=yes
+               -DFORCE_INIT_SYSTEM=$(usex systemd systemd openrc)
+       )
+       cmake_src_configure
+}
+
+src_install() {
+       cmake_src_install
+       dodoc CHANGELOG.md
+
+       newinitd "${FILESDIR}"/ckb.initd ckb-daemon
+}
+
+pkg_postinst() {
+       if [[ -z "${REPLACING_VERSIONS}" ]]; then
+               elog "The ckb daemon will have to be started before use:"
+               elog
+                       if use systemd ; then
+                       elog "# systemctl start ckb-next-daemon"
+               else
+                       elog "# rc-service ckb start"
+               fi
+       fi
+}

diff --git a/app-misc/ckb/files/ckb-0.4.4-libinput-1.2.0.patch 
b/app-misc/ckb/files/ckb-0.4.4-libinput-1.2.0.patch
new file mode 100644
index 00000000000..211d5e4ea01
--- /dev/null
+++ b/app-misc/ckb/files/ckb-0.4.4-libinput-1.2.0.patch
@@ -0,0 +1,29 @@
+From dc4dc54c5ebac7e4b455d8df35076fc044a581a7 Mon Sep 17 00:00:00 2001
+From: Tasos Sahanidis <[email protected]>
+Date: Mon, 20 Sep 2021 14:48:18 +0300
+Subject: [PATCH] Don't enable unneeded axes in mouse device
+
+Specifically, we used to enable HI_RES wheel events without ever
+sending any. This breaks scrolling in latest libinput as it expects
+us to actually send HI_RES events.
+---
+ src/daemon/input_linux.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/src/daemon/input_linux.c b/src/daemon/input_linux.c
+index 68cc0ebb..a9ac8c8e 100644
+--- a/src/daemon/input_linux.c
++++ b/src/daemon/input_linux.c
+@@ -25,8 +25,10 @@ int uinputopen(struct uinput_user_dev* indev, int mouse){
+             ioctl(fd, UI_SET_KEYBIT, i);
+         // Enable mouse axes
+         ioctl(fd, UI_SET_EVBIT, EV_REL);
+-        for(int i = 0; i < REL_CNT; i++)
+-            ioctl(fd, UI_SET_RELBIT, i);
++        ioctl(fd, UI_SET_RELBIT, REL_X);
++        ioctl(fd, UI_SET_RELBIT, REL_Y);
++        ioctl(fd, UI_SET_RELBIT, REL_WHEEL);
++        ioctl(fd, UI_SET_RELBIT, REL_HWHEEL);
+     } else {
+         // Enable common keyboard keys
+         for(int i = KEY_ESC; i <= KEY_MEDIA; i++)

Reply via email to