From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:41291) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h5cWm-0002HR-D5 for guix-patches@gnu.org; Sun, 17 Mar 2019 16:37:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h5cWk-0005R8-TX for guix-patches@gnu.org; Sun, 17 Mar 2019 16:37:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:34263) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h5cWk-0005Qy-Jd for guix-patches@gnu.org; Sun, 17 Mar 2019 16:37:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1h5cWk-0002y5-5b for guix-patches@gnu.org; Sun, 17 Mar 2019 16:37:02 -0400 Subject: [bug#34067] Add input-wacom/inputattach Resent-Message-ID: References: <87fttvl9b1.fsf@yahoo.de> <87va2jnr12.fsf@gnu.org> From: Tim Gesthuizen In-reply-to: <87va2jnr12.fsf@gnu.org> Date: Sun, 17 Mar 2019 21:36:27 +0100 Message-ID: <87mult44s4.fsf@yahoo.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 34067@debbugs.gnu.org --=-=-= Content-Type: text/plain Hi Ludo, sorry for the long delay! For now I guess it would be the best to not package the actual driver and rely on the one that is merged into linux-libre. I reduced the patches to only add inputattach and the service type for it. Tim. --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=0001-gnu-Add-inputattach.patch Content-Transfer-Encoding: quoted-printable >From 72a27f6f4d1f6ad171f479b03b531e51c6c997ef Mon Sep 17 00:00:00 2001 From: Tim Gesthuizen Date: Sat, 5 Jan 2019 20:55:14 +0100 Subject: [PATCH 1/2] gnu: Add inputattach * gnu/packages/linux.scm (inputattach): New variable. --- gnu/packages/linux.scm | 43 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index ffd376de45..1755032f91 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -32,6 +32,7 @@ ;;; Copyright =C2=A9 2018 Manuel Graf ;;; Copyright =C2=A9 2018 Pierre Langlois ;;; Copyright =C2=A9 2018 Vasile Dumitrascu +;;; Copyright =C2=A9 2019 Tim Gesthuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -5134,3 +5135,45 @@ the correct permissions and ownership, and then pack= them up, or one would have to construct the archives directly, without using the archiver.") (home-page "http://freshmeat.sourceforge.net/projects/fakeroot") (license license:gpl3+))) + +(define-public inputattach + (package + (name "inputattach") + (version "0.42.0") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/linuxwacom/input-wacom.git") + (commit (string-append "input-wacom-" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "04lnn7v0rm4ppbya140im5d4igcl6c1nrqpgbsr0i8wkral0nv= 7j")))) + (build-system gnu-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (delete 'bootstrap) + (delete 'configure) + (replace 'build + (lambda* (#:key inputs #:allow-other-keys) + (with-directory-excursion "inputattach" + (invoke (string-append (assoc-ref inputs "gcc") + "/bin/gcc") + "-o" "inputattach" "inputattach.c")) + #t)) + (delete 'check) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let ((target-dir (string-append + (assoc-ref outputs "out") + "/bin/"))) + (mkdir-p target-dir) + (copy-file "inputattach/inputattach" + (string-append target-dir + "inputattach")) + #t)))))) + (home-page "https://linuxwacom.github.io/") + (synopsis "Dispatch input peripherals events to a device file") + (description "inputattach dispatches input events from several device +types and interfaces and translates so that the X server can use them.") + (license license:gpl2+))) --=20 2.21.0 --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=0002-gnu-Add-inputattach-service.patch Content-Transfer-Encoding: quoted-printable >From 2dffbe48072e0281651a5200d75c7783de4eacbd Mon Sep 17 00:00:00 2001 From: Tim Gesthuizen Date: Sat, 5 Jan 2019 23:28:18 +0100 Subject: [PATCH 2/2] gnu: Add inputattach service Add a service that runs inputattach as a daemon to translate events from serial ports. * gnu/services/desktop.scm (): New record type. * gnu/services/desktop.scm (inputattach-service-type): New service type. * doc/guix.texi (Miscellaneous Services): Add inputattach Service subsubheading. --- doc/guix.texi | 16 ++++++++++++++ gnu/services/desktop.scm | 46 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi index 9fb5cff06d..38d5daccd7 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -22306,6 +22306,22 @@ that enables sharing the clipboard with a vm and s= etting the guest display resolution when the graphical console window resizes. @end deffn =20 +@cindex inputattach +@subsubheading inputattach Service + +@deftp {Data Type} inputattach-configuration +@table @asis +@item @code{device-type} The type of device to connect to. +@item @code{device} The device file to connect to the device. +@item @code{log-file} The file to log messages to. +@end table +@end deftp + +@deffn {Scheme Procedure} inputattach-service-type +Return a service that runs inputattach on a device and +dispatches events from it. +@end deffn + @subsection Dictionary Services @cindex dictionary The @code{(gnu services dict)} module provides the following service: diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm index ce63969dc8..16687236eb 100644 --- a/gnu/services/desktop.scm +++ b/gnu/services/desktop.scm @@ -8,6 +8,7 @@ ;;; Copyright =C2=A9 2018 Efraim Flashner ;;; Copyright =C2=A9 2018 Ricardo Wurmus ;;; Copyright =C2=A9 2017, 2019 Christopher Baines +;;; Copyright =C2=A9 2019 Tim Gesthuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -123,6 +124,10 @@ enlightenment-desktop-configuration? enlightenment-desktop-service-type =20 + inputattach-configuration + inputattach-configuration? + inputattach-service-type + %desktop-services)) =20 ;;; Commentary: @@ -1015,6 +1020,47 @@ thumbnails and makes setuid the programs which enlig= htenment needs to function as expected."))) =20 +;;; +;;; inputattach-service-type +;;; + +(define-record-type* + inputattach-configuration + make-inputattach-configuration + inputattach-configuration? + (device-type inputattach-configuration-devicetype + (default "wacom")) + (device inputattach-configuration-device + (default "/dev/ttyS0")) + (log-file inputattach-configuration-log-file + (default #f))) + +(define inputattach-shepherd-service + (match-lambda + (($ type device log-file) + (list (shepherd-service + (provision '(inputattach)) + (requirement '(udev)) + (documentation "inputattach daemon") + (start #~(make-forkexec-constructor + (list (string-append #$inputattach + "/bin/inputattach") + (string-append "--" #$type) + #$device) + #:log-file #$log-file)) + (stop #~(make-kill-destructor))))))) + +(define inputattach-service-type + (service-type + (name 'inputattach) + (extensions + (list (service-extension shepherd-root-service-type + inputattach-shepherd-service))) + (default-value (inputattach-configuration)) + (description "Return a service that runs inputattach on a device and +dispatches events from it."))) + + ;;; ;;; The default set of desktop services. ;;; --=20 2.21.0 --=-=-=--