summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorten Linderud2021-01-07 22:01:57 +0100
committerMorten Linderud2021-01-07 22:01:57 +0100
commit2b48a0137bb109e7508e1949eb75fa5d5bf3fa1b (patch)
tree47b8c064850afabb65fc77f74c1b1a575f613438
downloadaur-2b48a0137bb109e7508e1949eb75fa5d5bf3fa1b.tar.gz
import from community
-rw-r--r--.SRCINFO20
-rw-r--r--PKGBUILD42
-rw-r--r--g15daemon-1.9.5.3-config-write.patch12
-rw-r--r--g15daemon-1.9.5.3-recv-oob-answer.patch11
-rw-r--r--g15daemon-1.9.5.3-uinput.patch35
-rw-r--r--g15daemon.service11
6 files changed, 131 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..93914fd89f0
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,20 @@
+pkgbase = g15daemon
+ pkgdesc = A daemon that makes it possible to use the G-Buttons and draw on the G15 LCD
+ pkgver = 1.9.5.3
+ pkgrel = 10
+ url = https://sourceforge.net/projects/g15daemon/
+ arch = x86_64
+ license = GPL
+ depends = libg15render>=1.2
+ source = https://downloads.sourceforge.net/g15daemon/g15daemon-1.9.5.3.tar.bz2
+ source = g15daemon.service
+ source = g15daemon-1.9.5.3-uinput.patch
+ source = g15daemon-1.9.5.3-config-write.patch
+ source = g15daemon-1.9.5.3-recv-oob-answer.patch
+ sha512sums = 3dfeee7e9c0db1014f20e4c489cd4f277a880dc9928d4a2d8ef7a1ceaadfc491f0ffaac8d2a38f07f883f96862d7441500be2415b326f1495c94f86ff467ae4b
+ sha512sums = 45867c1737cbca98c8a069b30b383404c39438d70179fbd53a91f09921205c9739826ea7868388216219a6b24e4dee6814714a6d162c10dfb4a663a4efa8145d
+ sha512sums = be9e8edf9c17c0dfe1d72ec011a4bce97972cb66f05b5fa1fe0839fefd194e1ace40429bd054e7e670064074c0b017b0c33237f7c6964de821bcd119cdd83b4b
+ sha512sums = 7d6250bc5e8e2c9a0a045ef15d4a0d747e21f7da3cc577cb4ffc8dd8d0baa47a9005276475524c2ca8cca6bb9155549dcb781780d8c76cdec2926923b4bb22d9
+ sha512sums = 1adb4486e4275b83bb06c6a912cc020cdc56c7c86822ad35ded823fe768d6bed3248081a62c071fd8268a86cb7240610732f9a87c7eb787ce9734c448eec583d
+
+pkgname = g15daemon
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..63801c79c11
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,42 @@
+# Maintainer: Evgeniy Alekseev <arcanis.arch at gmail dot com>
+# Contributor: Valeriy Lyasotskiy <onestep@ukr.net>
+
+pkgname=g15daemon
+pkgver=1.9.5.3
+pkgrel=10
+pkgdesc="A daemon that makes it possible to use the G-Buttons and draw on the G15 LCD"
+arch=('x86_64')
+url="https://sourceforge.net/projects/g15daemon/"
+license=('GPL')
+depends=('libg15render>=1.2')
+source=(https://downloads.sourceforge.net/${pkgname}/${pkgname}-${pkgver}.tar.bz2
+ g15daemon.service
+ ${pkgname}-${pkgver}-uinput.patch
+ ${pkgname}-${pkgver}-config-write.patch
+ ${pkgname}-${pkgver}-recv-oob-answer.patch)
+sha512sums=('3dfeee7e9c0db1014f20e4c489cd4f277a880dc9928d4a2d8ef7a1ceaadfc491f0ffaac8d2a38f07f883f96862d7441500be2415b326f1495c94f86ff467ae4b'
+ '45867c1737cbca98c8a069b30b383404c39438d70179fbd53a91f09921205c9739826ea7868388216219a6b24e4dee6814714a6d162c10dfb4a663a4efa8145d'
+ 'be9e8edf9c17c0dfe1d72ec011a4bce97972cb66f05b5fa1fe0839fefd194e1ace40429bd054e7e670064074c0b017b0c33237f7c6964de821bcd119cdd83b4b'
+ '7d6250bc5e8e2c9a0a045ef15d4a0d747e21f7da3cc577cb4ffc8dd8d0baa47a9005276475524c2ca8cca6bb9155549dcb781780d8c76cdec2926923b4bb22d9'
+ '1adb4486e4275b83bb06c6a912cc020cdc56c7c86822ad35ded823fe768d6bed3248081a62c071fd8268a86cb7240610732f9a87c7eb787ce9734c448eec583d')
+
+prepare() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ patch -Np1 -i "${srcdir}/${pkgname}-${pkgver}-uinput.patch"
+ patch -Np1 -i "${srcdir}/${pkgname}-${pkgver}-config-write.patch"
+ patch -Np1 -i "${srcdir}/${pkgname}-${pkgver}-recv-oob-answer.patch"
+}
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ CFLAGS+=' -fcommon' # https://wiki.gentoo.org/wiki/Gcc_10_porting_notes/fno_common
+ ./configure --prefix=/usr --sbindir=/usr/bin --disable-static
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make DESTDIR="${pkgdir}" install
+ install -D -m 644 "${srcdir}/g15daemon.service" \
+ "${pkgdir}/usr/lib/systemd/system/g15daemon.service"
+}
diff --git a/g15daemon-1.9.5.3-config-write.patch b/g15daemon-1.9.5.3-config-write.patch
new file mode 100644
index 00000000000..6f52d231f2e
--- /dev/null
+++ b/g15daemon-1.9.5.3-config-write.patch
@@ -0,0 +1,12 @@
+diff -Nuar g15daemon-1.9.5.3.orig/g15daemon/utility_funcs.c g15daemon-1.9.5.3/g15daemon/utility_funcs.c
+--- g15daemon-1.9.5.3.orig/g15daemon/utility_funcs.c 2008-01-26 07:02:07.000000000 +0200
++++ g15daemon-1.9.5.3/g15daemon/utility_funcs.c 2011-11-09 09:19:43.000000000 +0200
+@@ -356,7 +356,7 @@
+ config_items_t * item=NULL;
+ char line[1024];
+
+- config_fd = open(filename,O_CREAT|O_RDWR|O_TRUNC);
++ config_fd = open(filename,O_CREAT|O_RDWR|O_TRUNC, 0644);
+ if(config_fd){
+ snprintf(line,1024,"# G15Daemon Configuration File\n# any items entered before a [section] header\n# will be in the Global config space\n# comments you wish to keep should start with a semicolon';'\n");
+ write(config_fd,line,strlen(line));
diff --git a/g15daemon-1.9.5.3-recv-oob-answer.patch b/g15daemon-1.9.5.3-recv-oob-answer.patch
new file mode 100644
index 00000000000..adb4dccc444
--- /dev/null
+++ b/g15daemon-1.9.5.3-recv-oob-answer.patch
@@ -0,0 +1,11 @@
+--- g15daemon-1.9.5.3.orig/libg15daemon_client/g15daemon_net.c
++++ g15daemon-1.9.5.3/libg15daemon_client/g15daemon_net.c
+@@ -217,7 +217,7 @@
+ if(poll(pfd,1,100)>0){
+ if(pfd[0].revents & POLLPRI && !(pfd[0].revents & POLLERR || pfd[0].revents & POLLHUP || pfd[0].revents & POLLNVAL)) {
+ memset(packet,0,sizeof(packet));
+- msgret = recv(sock, packet, 10 , MSG_OOB);
++ msgret = recv(sock, packet, sizeof(packet) , MSG_OOB);
+ if (msgret < 1) {
+ return -1;
+ }
diff --git a/g15daemon-1.9.5.3-uinput.patch b/g15daemon-1.9.5.3-uinput.patch
new file mode 100644
index 00000000000..f91843281cd
--- /dev/null
+++ b/g15daemon-1.9.5.3-uinput.patch
@@ -0,0 +1,35 @@
+Index: g15daemon-1.9.5.3/g15daemon/g15_plugin_uinput.c
+===================================================================
+--- g15daemon-1.9.5.3/plugins/g15_plugin_uinput.c
++++ g15daemon-1.9.5.3/plugins/g15_plugin_uinput.c
+@@ -125,6 +125,14 @@
+ event.value = G15KEY_DOWN;
+
+ write (uinp_fd, &event, sizeof(event));
++
++ /* Need to write sync event */
++ memset(&event, 0, sizeof(event));
++ event.type = EV_SYN;
++ event.code = SYN_REPORT;
++ event.value = 0;
++ write(uinp_fd, &event, sizeof(event));
++
+ }
+
+ static void g15_uinput_keyup(unsigned char code)
+@@ -137,6 +145,14 @@
+ event.value = G15KEY_UP;
+
+ write (uinp_fd, &event, sizeof(event));
++
++ /* Need to write sync event */
++ memset(&event, 0, sizeof(event));
++ event.type = EV_SYN;
++ event.code = SYN_REPORT;
++ event.value = 0;
++ write(uinp_fd, &event, sizeof(event));
++
+ }
+
+ void (*keyup)(unsigned char code) = &g15_uinput_keyup;
+
diff --git a/g15daemon.service b/g15daemon.service
new file mode 100644
index 00000000000..46855ea408e
--- /dev/null
+++ b/g15daemon.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Logitech G15 Support Daemon
+Documentation=man:g15daemon(1)
+
+[Service]
+Type=forking
+PIDFile=/run/g15daemon.pid
+ExecStart=/usr/bin/g15daemon
+
+[Install]
+WantedBy=multi-user.target