GNU bug report logs - #34067
Add input-wacom/inputattach

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Tim Gesthuizen <tim.gesthuizen@HIDDEN>; dated Mon, 14 Jan 2019 12:22:02 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 14 Jan 2019 12:21:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jan 14 07:21:25 2019
Received: from localhost ([127.0.0.1]:58348 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gj1Ey-0000PR-Fl
	for submit <at> debbugs.gnu.org; Mon, 14 Jan 2019 07:21:24 -0500
Received: from eggs.gnu.org ([209.51.188.92]:42627)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <tim.gesthuizen@HIDDEN>) id 1gj1Ev-0000PE-Di
 for submit <at> debbugs.gnu.org; Mon, 14 Jan 2019 07:21:15 -0500
Received: from lists.gnu.org ([209.51.188.17]:34373)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <tim.gesthuizen@HIDDEN>)
 id 1gj1Ep-000209-01
 for submit <at> debbugs.gnu.org; Mon, 14 Jan 2019 07:21:07 -0500
Received: from eggs.gnu.org ([209.51.188.92]:52791)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <tim.gesthuizen@HIDDEN>) id 1gj1Em-0001cZ-Am
 for guix-patches@HIDDEN; Mon, 14 Jan 2019 07:21:06 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM,
 RCVD_IN_DNSWL_NONE autolearn=disabled version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <tim.gesthuizen@HIDDEN>) id 1gj1Eh-0001tX-VV
 for guix-patches@HIDDEN; Mon, 14 Jan 2019 07:21:03 -0500
Received: from sonic310-12.consmr.mail.ir2.yahoo.com ([77.238.177.33]:42139)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <tim.gesthuizen@HIDDEN>)
 id 1gj1Eh-0001pk-5a
 for guix-patches@HIDDEN; Mon, 14 Jan 2019 07:20:59 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s2048;
 t=1547468456; bh=OcK9Ub4uUKEYrGufOzIaCT2bWAHBNDVQppchb6Ef6xY=;
 h=From:To:Subject:Date:From:Subject;
 b=G0zjfK9tCja/+ECc2F9Oee2x/AqeMh3Ri158lNXqvz8RnyzExVg0uJbA6qTz+9B95HEUbVcXtC4gUM8RekPQAYPlcZxc5ljZqfRaSBpvfrt3PapxykDeHXQ9fVj6rpdhiFVwx4ettzmX6MwQOs+8FPsqqQF4zx2KpJoNBCBE78B/L8qbK9MAc8mb0R8gQIXPbm3vbmPAXg7SD+LuKBPBQj4ZoVLdygmYlPlvR27ohNXAUTUZpwG9C1VelkT2E+nTS1FnzjEmWltxEZpmDSCSIgtTMD7tdu6s8v8I8pb8+lvBm5RKvL0pZJFZrs3AGERR6xGIbuGSdZ5LCF8yJZJuiA==
X-YMail-OSG: iIuP9G0VM1k6Xs6JpP7_x2pvKkxxyRYz33kmmycQtIbS8hg9U7CKVqQXF4MTRuX
 ocMC296WTF6acrUIHZU.aaPKGlij0RA6XzkgH14BVIKbjr.7_VzBnozRjUsBgINowkX2GGyFVJWN
 R1kCFhY8koTlJdCPuHKKi8cWZegqt2o8uzEbDk7qnggGcvrF1HJKjb90GiYmxLffRG6DyniFR9Tr
 MCN.QEU43zbE69aFExkZ9lASAHmjLg1nJae3GfeMfr_pgTfpPYsOTvKtKILJ.Gp5fkeQnJc1EQZ9
 fNL0F2Dp5Cb8oI_tPd1RzPqmU6fb525QM4G4wf7el.GfrrCBRxhIASo5qkljnPmuCK3cjHXTDNMh
 zBunwFcvQDacrQOp5niSx9CHJwIn4iUc_Qdl.Quv4qTtSN998A9yd.qVV456s9TIXxXo1gGxlKy8
 Gff.GG7b3tXvJBizoMVY2ZuCle_70YnbD1VaenmbGogAnHzNmwaSLMEG_nRlGoDxu0If7JvvO.lJ
 ciS03O4uZUR4CpHN4H0DBK2nxGbWL0592Zm59EY.FopfOOBM9C7d0_bfBVxGqSCWg49e9ASrQdWh
 Zwm9oaHja8AJ7.hOgggp0F0ezmALysMM3s9WmVRxy.yu0GeDO38CFnFSjdQeDiAylPYRexSOeRO4
 5rK65hqEQ198PIWUvpYUSZVYSqdLwXZA4mIm3au3FThqGqjoT0EiWhFBPmbF1_XtgmvV.oWvuDA_
 MEfKZBQ5dm_cfFeiwPCqadREi792bdXsRl4VChtpPtz2khd7yZ0GaYnkM1p5C45LSRg4Xb2002M4
 S1I3BTflwX_lkVNajXEDvEuo7YMYTB5wlPO.tFD2JmAZQ5E_MXF95VLuE6z.zn21CDZyHL95QnS1
 HFNRzIhD.6hOahVF9y2xEgAMlnuev.eFZNQQt.UXOd8T8cF0SMr7Dicd2eDrfpIy2fPUh3hEUaEL
 DCHpJhb15.AoWxlPM0eOz_g8QnS0WNG60dF6rqELpeWn8G3vFmX8aqeMdrcyp4TYLOLqkd1eg8w9
 F7FVNgg77zcU0sOc5Afgn0uQ6CvlWoaRY4f6P0F1cxrclTw--
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic310.consmr.mail.ir2.yahoo.com with HTTP; Mon, 14 Jan 2019 12:20:56 +0000
Received: from pD954F60F.dip0.t-ipconnect.de (EHLO finkpad) ([217.84.246.15])
 by smtp412.mail.ir2.yahoo.com (Oath Hermes SMTP Server) with ESMTPA
 ID 11b16769087e01753f7336ba7232007f for <guix-patches@HIDDEN>;
 Mon, 14 Jan 2019 12:20:52 +0000 (UTC)
From: Tim Gesthuizen <tim.gesthuizen@HIDDEN>
To: guix-patches@HIDDEN
Subject: Add input-wacom/inputattach
Date: Mon, 14 Jan 2019 13:20:50 +0100
Message-ID: <87fttvl9b1.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x
X-Received-From: 77.238.177.33
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Spam-Score: 0.7 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.3 (/)

--=-=-=
Content-Type: multipart/signed; boundary="==-=-=";
	micalg=pgp-sha256; protocol="application/pgp-signature"

--==-=-=
Content-Type: text/plain

Hi,
I added the following changes in order to get the touchscreen on my
thinkpad x200t to work.

Quick summary:

- Add functions to locate modules for linux-libre.
- Change linux-libre to not include non deterministic symlinks to dead
  items and package the source in separate output.
- Add input-wacom driver and inputattach.
- Add an inputattach service type that starts inputattach as a daemon.
- Document the new service type

There are some things worth discussing about these patches:

- firmware.scm for input-wacom is probably not quite the optimal file.
- linux-libre gains quite some size from packaging its build tree
- Lots of small things
- Maybe other things

It would be nice if someone could review the patches.

Tim.


--==-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEKUiC5+8BRKEri5fa0uWPaa77GdUFAlw8fqIACgkQ0uWPaa77
GdXscggAoC5rn7fDEnIazaYcaOXGMto8z3Mcxu44nxZA4gEOqhky0M/PpbIgVSjd
An3LLxf3PF75Wc66i51cduPzYBnVX9wZ+ekIvBvUUvMvuR7JVlzQ6O6NfAVY6+ax
KsuQX4r6bNsMVQJH4ky0u2KJX5TaEZWi4gEVSIFX0CTBlILewILEpm6M3iDQegRu
z2ZV0gEYjXtbRpuI59AbaJ2UyjIopEfnjwFTVCmWK8WD1ZKkw4ziGMHJERKpxoxh
h4L7tqfW0tkdNjRZ3ZHGglInVdL79fdTsxnuPhfiVOVK/7/S/1rg7njBsgkqmDp3
h0fuhb3+QSE/oAV8LtaySAdjLeRiEg==
=wX5B
-----END PGP SIGNATURE-----
--==-=-=--

--=-=-=
Content-Type: text/x-patch; charset=utf-8
Content-Disposition: inline;
 filename=0001-gnu-Add-linux-libre-fill-version.patch
Content-Transfer-Encoding: quoted-printable

From 9c5fc83d9d5a162fb3d4662c3e66cd77918159da Mon Sep 17 00:00:00 2001
From: Tim Gesthuizen <tim.gesthuizen@HIDDEN>
Date: Wed, 9 Jan 2019 18:40:42 +0100
Subject: [PATCH 1/7] gnu: Add linux-libre-fill-version

linux-libre-fill-version adds a patch version to the version if it is
missing.

* gnu/packages/linux.scm (linux-libre-fill-version): New function
---
 gnu/packages/linux.scm | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index d8f37e705..aa18fba10 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -32,6 +32,7 @@
 ;;; Copyright =C2=A9 2018 Manuel Graf <graf@HIDDEN>
 ;;; Copyright =C2=A9 2018 Pierre Langlois <pierre.langlois@HIDDEN>
 ;;; Copyright =C2=A9 2018 Vasile Dumitrascu <va511e@HIDDEN>
+;;; Copyright =C2=A9 2019 Tim Gesthuizen <tim.gesthuizen@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -124,7 +125,8 @@
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-2)
   #:use-module (srfi srfi-26)
-  #:use-module (ice-9 match))
+  #:use-module (ice-9 match)
+  #:use-module (ice-9 regex))
=20
 (define-public (system->linux-architecture arch)
   "Return the Linux architecture name for ARCH, a Guix system name such as
@@ -278,6 +280,14 @@ for ARCH and optionally VARIANT, or #f if there is no =
such configuration."
                     options)
                "\n"))
=20
+(define-public (linux-libre-fill-version version)
+  "If the patch number of the linux-libre version is 0 it is left out. Add=
 the
+patch number to the version if it is missing."
+  (if (string-match "^[0-9]+\\.[0-9]+$"
+                    version)
+      (string-append version ".0")
+      version))
+
 (define* (make-linux-libre version hash supported-systems
                            #:key
                            ;; A function that takes an arch and a variant.
--=20
2.20.1


--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline;
 filename=0002-gnu-Add-linux-libre-module-path.patch

From 24f65c10bcfc8349778d024f039528997c9e7da9 Mon Sep 17 00:00:00 2001
From: Tim Gesthuizen <tim.gesthuizen@HIDDEN>
Date: Wed, 9 Jan 2019 17:56:21 +0100
Subject: [PATCH 2/7] gnu: Add linux-libre-module-path

Add a function that evaluates to the module path where the modules for
linux-libre in a specific version are stored.

* gnu/packages/linux.scm (linux-libre-module-path): New function
---
 gnu/packages/linux.scm | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index aa18fba10..ccad6eba0 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -288,6 +288,13 @@ patch number to the version if it is missing."
       (string-append version ".0")
       version))
 
+(define-public (linux-libre-module-path version)
+  "Return the install directory for modules for linux-libre in version
+VERSION."
+  (string-append "/lib/modules/"
+                 (linux-libre-fill-version version)
+                 "-gnu"))
+
 (define* (make-linux-libre version hash supported-systems
                            #:key
                            ;; A function that takes an arch and a variant.
-- 
2.20.1


--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline;
 filename=0003-gnu-linux-libre-Copy-source-to-the-store.patch

From e771153f957e1bd41dbef32bf6f7e997f9a732f5 Mon Sep 17 00:00:00 2001
From: Tim Gesthuizen <tim.gesthuizen@HIDDEN>
Date: Fri, 4 Jan 2019 12:22:34 +0100
Subject: [PATCH 3/7] gnu: linux-libre: Copy source to the store

The source code is needed by some kernel modules to compile. The item in the
store only symlinks the build directory in /tmp which is not reachable later
on and is a source of non determinism for the store item.
This patch deletes the symlinks and copies the source to a separate output.

* gnu/packages/linux.scm (linux-libre):
[outputs]: Add output source
[arguments]: Add phase to copy source to the store item.
---
 gnu/packages/linux.scm | 37 ++++++++++++++++++++++++++++++++++++-
 1 file changed, 36 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index ccad6eba0..50c348b15 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -343,10 +343,12 @@ VERSION."
             '())
            ((? string? config)
             `(("kconfig" ,config))))))
+    (outputs '("out" "source"))
     (arguments
      `(#:modules ((guix build gnu-build-system)
                   (guix build utils)
                   (srfi srfi-1)
+                  (ice-9 format)
                   (ice-9 match))
        #:phases
        (modify-phases %standard-phases
@@ -421,7 +423,40 @@ VERSION."
                        (string-append "INSTALL_PATH=" out)
                        (string-append "INSTALL_MOD_PATH=" out)
                        "INSTALL_MOD_STRIP=1"
-                       "modules_install")))))
+                       "modules_install"))))
+         ;; After installing the source and build directories are symlinked to
+         ;; the build location in /tmp and are not reachable later on. Copying
+         ;; the files to a separate output keeps them available.
+         (add-after 'install 'copy-source
+           (lambda* (#:key outputs #:allow-other-keys)
+             ;; The patch is left out in the official kernel version numbering
+             ;; if it is 0. The module path is however always constructed with
+             ;; major.minor.patch.
+             (let* ((out (assoc-ref outputs "out"))
+                    (source (assoc-ref outputs "source"))
+                    (basesubdir ,(linux-libre-module-path version))
+                    (source-dir (string-append out basesubdir "/source"))
+                    (build-dir (string-append out basesubdir "/build")))
+               (for-each (lambda (file)
+                            (when (symbolic-link? file)
+                              (delete-file file)))
+                         (list source-dir build-dir))
+               (let ((source-dest (string-append source
+                                                 basesubdir
+                                                 "/source"))
+                     (build-dest (string-append source
+                                                basesubdir
+                                                "/build")))
+                 (mkdir-p (string-append source basesubdir))
+                 (format #t "Copying source to ~a\n"
+                         source-dest)
+                 (with-output-to-port (%make-void-port "w")
+                   (lambda _ (copy-recursively (getcwd) source-dest
+                                          #:follow-symlinks? #t
+                                          #:keep-mtime? #t)))
+                 ;; source-dir content = build-dir content
+                 (symlink source-dest build-dest))
+               #t))))
        #:tests? #f))
     (home-page "https://www.gnu.org/software/linux-libre/")
     (synopsis "100% free redistribution of a cleaned Linux kernel")
-- 
2.20.1


--=-=-=
Content-Type: text/x-patch; charset=utf-8
Content-Disposition: inline; filename=0004-gnu-Add-input-wacom.patch
Content-Transfer-Encoding: quoted-printable

From 4cc4535566f0496e24fcf567c73494c18d4b8a08 Mon Sep 17 00:00:00 2001
From: Tim Gesthuizen <tim.gesthuizen@HIDDEN>
Date: Sat, 5 Jan 2019 00:32:16 +0100
Subject: [PATCH 4/7] gnu: Add input-wacom

* gnu/packages/firmware.scm (input-wacom): New variable
---
 gnu/packages/firmware.scm | 98 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 98 insertions(+)

diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index 0f2d32bbd..be2fc4de4 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -5,6 +5,7 @@
 ;;; Copyright =C2=A9 2017, 2018 Efraim Flashner <efraim@HIDDEN>
 ;;; Copyright =C2=A9 2018 Tobias Geerinckx-Rice <me@HIDDEN>
 ;;; Copyright =C2=A9 2018 Vagrant Cascadian <vagrant@HIDDEN>
+;;; Copyright =C2=A9 2019 Tim Gesthuizen <tim.gesthuizen@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -31,6 +32,7 @@
   #:use-module (gnu packages)
   #:use-module (gnu packages admin)
   #:use-module (gnu packages assembly)
+  #:use-module (gnu packages autotools)
   #:use-module (gnu packages bison)
   #:use-module (gnu packages cmake)
   #:use-module (gnu packages cross-base)
@@ -530,3 +532,99 @@ switching support).\n")
              #t)))))
     (native-inputs `(("cross-gcc" ,(cross-gcc "arm-none-eabi" #:xgcc gcc-7=
))
                      ("cross-binutils" ,(cross-binutils "arm-none-eabi")))=
)))
+
+(define-public input-wacom
+  (package
+    (name "input-wacom")
+    (version "0.42.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/linuxwacom/input-wacom.git")
+                    (commit (string-append name "-" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32 "04lnn7v0rm4ppbya140im5d4igcl6c1nrqpgbsr0i8wkral0nv=
7j"))))
+    (build-system gnu-build-system)
+    (native-inputs `(("autoconf" ,autoconf)
+                     ("automake" ,automake)
+                     ("gcc" ,@(assoc-ref (package-native-inputs linux-libr=
e)
+                                         "gcc"))))
+    (inputs `(("linux-source" ,linux-libre "source")))
+    (arguments `(#:configure-flags (list
+                                    (string-append "--with-kernel-dir=3D"
+                                                   (assoc-ref %build-inputs
+                                                              "linux-sourc=
e")
+                                                   ,(linux-libre-module-pa=
th
+                                                     (package-version linu=
x-libre)))
+                                    (string-append "--with-kernel-version=
=3D"
+                                                   ,(linux-libre-fill-vers=
ion
+                                                     (package-version linu=
x-libre))
+                                                   "-gnu"))
+                 #:modules ((ice-9 ftw)
+                            (ice-9 format)
+                            (ice-9 regex)
+                            (guix build utils)
+                            (guix build gnu-build-system))
+                 #:phases (modify-phases %standard-phases
+                            (replace 'bootstrap
+                              (lambda* (#:key inputs outputs #:allow-other=
-keys)
+                                (setenv "CC" (string-append (assoc-ref inp=
uts "gcc")
+                                                            "/bin/gcc"))
+                                (substitute* "configure.ac"
+                                  (("/lib/modules/.*/")
+                                   (string-append (assoc-ref inputs "linux=
-source")
+                                                  ,(linux-libre-module-path
+                                                    (package-version linux=
-libre))
+                                                  "/"))
+                                  (("`uname -r`")
+                                   (string-append ,(linux-libre-fill-versi=
on (package-version linux-libre))
+                                                  "-gnu")))
+                                (invoke (string-append (assoc-ref inputs "=
autoconf")
+                                                       "/bin/autoreconf")
+                                        "-v" "--install")
+                                (substitute* "configure"
+                                  (("/bin/sh")
+                                   (string-append (assoc-ref inputs "bash")
+                                                  "/bin/sh")))
+                                #t))
+                            ;; input-wacom tries to use the Makefile of the
+                            ;; kernels build tree to install its modules i=
nto
+                            ;; the OSs structure.  This does not work for =
us
+                            ;; as we cannot pass extra arguments to make w=
hich
+                            ;; results in an installation to /lib.  Becaus=
e of
+                            ;; this we just copy all modules that were bui=
ld
+                            ;; to the output.
+                            (replace 'install
+                              (lambda* (#:key outputs #:allow-other-keys)
+                                (let ((install-dir
+                                       (string-append
+                                        (assoc-ref outputs "out")
+                                        ,(linux-libre-module-path
+                                          (package-version linux-libre))
+                                        "/kernel/drivers/input/touchscreen=
/")))
+                                  (mkdir-p install-dir)
+                                  (file-system-fold
+                                   ;; Don't enter hidden directories
+                                   (lambda (path stat result)
+                                     (not (equal? #\. (string-ref (basenam=
e path) 0))))
+                                   (lambda (path stat result)
+                                     (when (string-match "^.*\\.ko$" path)
+                                       (format #t "Installing module ~a\n"
+                                               (basename path))
+                                       (copy-file path
+                                                  (string-append install-d=
ir
+                                                                 (basename=
 path)))))
+                                   (const #t)
+                                   (const #t)
+                                   (const #t)
+                                   (lambda _ (throw 'file-system-error))
+                                   #t
+                                   (getcwd))
+                                  #t))))))
+    (home-page "https://linuxwacom.github.io/")
+    (synopsis "Linux kernel driver for various wacom touchscreens")
+    (description "A set of kernel drivers that add support for various wac=
om
+touchscreens. In combination with xf86-input-wacom and libwacom it forms a=
 set
+of modules to support wacom touchscreens with the X server.")
+    (license license:gpl2)))
--=20
2.20.1


--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline; filename=0005-gnu-Add-inputattach.patch

From cb02272b9759426427ba1accc60915b455dfb357 Mon Sep 17 00:00:00 2001
From: Tim Gesthuizen <tim.gesthuizen@HIDDEN>
Date: Sat, 5 Jan 2019 20:55:14 +0100
Subject: [PATCH 5/7] gnu: Add inputattach

* gnu/packages/firmware.scm (inputattach): New variable
---
 gnu/packages/firmware.scm | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index be2fc4de4..cc2022a90 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -628,3 +628,31 @@ switching support).\n")
 touchscreens. In combination with xf86-input-wacom and libwacom it forms a set
 of modules to support wacom touchscreens with the X server.")
     (license license:gpl2)))
+
+(define-public inputattach
+  (package
+    (inherit input-wacom)
+    (name "inputattach")
+    (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"))))))))
+    (synopsis "Dispatch input peripherals events to a device file")))
-- 
2.20.1


--=-=-=
Content-Type: text/x-patch; charset=utf-8
Content-Disposition: inline; filename=0006-gnu-Add-inputattach-service.patch
Content-Transfer-Encoding: quoted-printable

From 8a1bb6706be11cd9c1e683e6d242accad0346d6b Mon Sep 17 00:00:00 2001
From: Tim Gesthuizen <tim.gesthuizen@HIDDEN>
Date: Sat, 5 Jan 2019 23:28:18 +0100
Subject: [PATCH 6/7] gnu: Add inputattach service

Add a service that runs inputattach as a daemon to translate events from
serial ports.

* gnu/local.mk: Add gnu/services/hardware.scm
* gnu/services/hardware.scm (<inputattach-configuration>): New record type
* gnu/services/hardware.scm (inputattach-service-type): New service type
* gnu/services/hardware.scm (inputattach-service): New function

squash
---
 gnu/local.mk              |  1 +
 gnu/services/hardware.scm | 71 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 72 insertions(+)
 create mode 100644 gnu/services/hardware.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index 7c319b727..d9e06bd17 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -486,6 +486,7 @@ GNU_SYSTEM_MODULES =3D				\
   %D%/services/docker.scm			\
   %D%/services/authentication.scm		\
   %D%/services/games.scm			\
+  %D%/services/hardware.scm                     \
   %D%/services/kerberos.scm			\
   %D%/services/lirc.scm				\
   %D%/services/virtualization.scm		\
diff --git a/gnu/services/hardware.scm b/gnu/services/hardware.scm
new file mode 100644
index 000000000..f924fb34d
--- /dev/null
+++ b/gnu/services/hardware.scm
@@ -0,0 +1,71 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright =C2=A9 2019 Tim Gesthuizen <tim.gesthuizen@HIDDEN>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu services hardware)
+  #:use-module (gnu services)
+  #:use-module (gnu services shepherd)
+  #:use-module (gnu packages admin)
+  #:use-module (gnu packages firmware)
+  #:use-module (guix records)
+  #:use-module (guix gexp)
+  #:use-module (ice-9 match)
+  #:export (inputattach-configuration
+            inputattach-configuration?
+            inputattach-service-type
+            inputattach-service))
+
+(define-record-type* <inputattach-configuration>
+  inputattach-configuration
+  make-inputattach-configuration
+  inputattach-configuration?
+  (devicetype 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))))
+
+(define* (inputattach-service #:key (type "wacom") (device "/dev/ttyS0") (=
log-file #f))
+  (service inputattach-service-type
+           (inputattach-configuration
+            (devicetype type)
+            (device device)
+            (log-file log-file))))
--=20
2.20.1


--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline;
 filename=0007-doc-Add-documentation-for-inputattach-service.patch

From a9cd86ad2244fff023f0c1bf4038748872aeab13 Mon Sep 17 00:00:00 2001
From: Tim Gesthuizen <tim.gesthuizen@HIDDEN>
Date: Sun, 6 Jan 2019 11:56:57 +0100
Subject: [PATCH 7/7] doc: Add documentation for inputattach-service

* doc/guix.texi (Miscellaneous Services): Add inputattach Service
  subsubheading
---
 doc/guix.texi | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/doc/guix.texi b/doc/guix.texi
index c0cc8d416..e0921d34d 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -22020,6 +22020,17 @@ 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
+
+The @code{(gnu services hardware)} module provides the following service.
+
+@deffn {Scheme Procedure} inputattach-service [#:type "wacom"] @
+       [#:device "/dev/ttyS0"] [#:log-file #f]
+Return a service that runs inputattach on @var{device} to decode events from
+@var{type}.
+@end deffn
+
 @subsubsection Dictionary Services
 @cindex dictionary
 The @code{(gnu services dict)} module provides the following service:
-- 
2.20.1


--=-=-=--




Acknowledgement sent to Tim Gesthuizen <tim.gesthuizen@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#34067; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 14 Jan 2019 12:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.