all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tim Gesthuizen <tim.gesthuizen@yahoo.de>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 34067@debbugs.gnu.org
Subject: [bug#34067] Add input-wacom/inputattach
Date: Sun, 17 Mar 2019 21:36:27 +0100	[thread overview]
Message-ID: <87mult44s4.fsf@yahoo.de> (raw)
In-Reply-To: <87va2jnr12.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 242 bytes --]

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.


[-- Attachment #2: 0001-gnu-Add-inputattach.patch --]
[-- Type: text/x-patch, Size: 2949 bytes --]

From 72a27f6f4d1f6ad171f479b03b531e51c6c997ef Mon Sep 17 00:00:00 2001
From: Tim Gesthuizen <tim.gesthuizen@yahoo.de>
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 © 2018 Manuel Graf <graf@init.at>
 ;;; Copyright © 2018 Pierre Langlois <pierre.langlois@gmx.com>
 ;;; Copyright © 2018 Vasile Dumitrascu <va511e@yahoo.com>
+;;; Copyright © 2019 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
 ;;;
 ;;; 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 "04lnn7v0rm4ppbya140im5d4igcl6c1nrqpgbsr0i8wkral0nv7j"))))
+    (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+)))
-- 
2.21.0


[-- Attachment #3: 0002-gnu-Add-inputattach-service.patch --]
[-- Type: text/x-patch, Size: 4075 bytes --]

From 2dffbe48072e0281651a5200d75c7783de4eacbd Mon Sep 17 00:00:00 2001
From: Tim Gesthuizen <tim.gesthuizen@yahoo.de>
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 (<inputattach-configuration>): 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 setting the guest display
 resolution when the graphical console window resizes.
 @end deffn
 
+@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 © 2018 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2017, 2019 Christopher Baines <mail@cbaines.net>
+;;; Copyright © 2019 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -123,6 +124,10 @@
             enlightenment-desktop-configuration?
             enlightenment-desktop-service-type
 
+            inputattach-configuration
+            inputattach-configuration?
+            inputattach-service-type
+
             %desktop-services))
 
 ;;; Commentary:
@@ -1015,6 +1020,47 @@ thumbnails and makes setuid the programs which enlightenment needs to function
 as expected.")))
 
 \f
+;;;
+;;; inputattach-service-type
+;;;
+
+(define-record-type* <inputattach-configuration>
+  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
+    (($ <inputattach-configuration> 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.")))
+
+\f
 ;;;
 ;;; The default set of desktop services.
 ;;;
-- 
2.21.0


  reply	other threads:[~2019-03-17 20:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-14 12:20 [bug#34067] Add input-wacom/inputattach Tim Gesthuizen
2019-01-20 18:05 ` Ludovic Courtès
2019-03-17 20:36   ` Tim Gesthuizen [this message]
2019-03-18  9:24     ` bug#34067: " Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mult44s4.fsf@yahoo.de \
    --to=tim.gesthuizen@yahoo.de \
    --cc=34067@debbugs.gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.