[PATCH] gnu: Add remserial

OpenSubmitted by Artyom V. Poptsov.
Details
One participant
  • Artyom V. Poptsov
Owner
unassigned
Severity
normal
A
A
Artyom V. Poptsov wrote on 9 Jun 20:53 +0200
(address . guix-patches@gnu.org)
87y1y5y8gl.fsf@gmail.com
Hello,

this patch adds 'remserial'. [1]

- Artyom

References:
1. "Communications bridge between TCP/IP and a serial port"
From 0f1b94b57eda653176429b183f3f30de9c0d38d3 Mon Sep 17 00:00:00 2001
From: "Artyom V. Poptsov" <poptsov.artyom@gmail.com>
Date: Thu, 9 Jun 2022 21:50:25 +0300
Subject: [PATCH] gnu: Add remserial

* gnu/packages/linux.scm (remserial): New variable.
---
gnu/packages/linux.scm | 61 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 61 insertions(+)

Toggle diff (71 lines)
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index dacb29a6ac..006848aabd 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -9263,3 +9263,64 @@ libraries are found or why they cannot be located.")
 gestures you make on your touchpad or touchscreen into visible actions in your
 desktop.")
     (license license:gpl3+)))
+
+(define-public remserial
+  (package
+    (name "remserial")
+    (version "1.4")
+    (source (origin
+              (method url-fetch)
+              (uri (list (string-append
+                          "http://lpccomp.bc.ca/remserial/remserial-" version
+                          ".tar.gz")
+                         ;; XXX: 'guix build' returns 405 "Method Not Allowed"
+                         ;; for the official URL although 'guix download'
+                         ;; fetches the file without any problems.  Let's use
+                         ;; the version from the Internet Archive for now.
+                         (string-append
+                          "https://web.archive.org/web/20220406152331/"
+                          "http://lpccomp.bc.ca/remserial/remserial-" version
+                          ".tar.gz")))
+              (sha256
+               (base32
+                "0jhi73pcnmvrg5zvhwc60gynp0c3r5z3fvi50vpv37smyibn55fn"))))
+    (build-system gnu-build-system)
+    (native-inputs (list linux-libre-headers))
+    (arguments
+     (list #:make-flags
+           #~(list (string-append "CC=" #$(cc-for-target))
+                   "CFLAGS=-D_XOPEN_SOURCE=500")
+           #:tests?
+           #f ;no tests.
+           #:phases
+           #~(modify-phases %standard-phases
+               (delete 'configure)
+               (replace 'install
+                 (lambda* (#:key outputs #:allow-other-keys)
+                   (let* ((out     (assoc-ref outputs "out"))
+                          (bin-dir (string-append out "/bin")))
+                     (install-file "remserial" bin-dir)) #t)))))
+    (home-page "http://lpccomp.bc.ca/remserial/")
+    (synopsis "Communications bridge between TCP/IP and a serial port")
+    (description
+     "The remserial program acts as a communications bridge
+between a TCP/IP network port and a Linux device such as a serial port.  Any
+character-oriented Linux @file{/dev} device will work.
+
+The program can also use pseudo-ttys as the device.  A pseudo-tty is like a
+serial port in that it has a @file{/dev} entry that can be opened by a program
+that expects a serial port device, except that instead of belonging to a
+physical serial device, the data can be intercepted by another program.  The
+remserial program uses this to connect a network port to the
+\"master\" (programming) side of the pseudo-tty allowing the device
+driver (slave) side to be used by some program expecting a serial port.
+
+The program can operate as a server accepting network connections from other
+machines, or as a client, connecting to remote machine that is running the
+remserial program or some other program that accepts a raw network connection.
+The network connection passes data as-is, there is no control protocol over
+the network socket.
+
+Multiple copies of the program can run on the same computer at the same time
+assuming each is using a different network port and device.")
+    (license license:gpl2+)))
-- 
2.25.1
--
Artyom "avp" Poptsov <poptsov.artyom@gmail.com>
CADR Hackerspace co-founder: https://cadrspace.ru/
GPG: D0C2 EAC1 3310 822D 98DE B57C E9C5 A2D9 0898 A02F
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEE0MLqwTMQgi2Y3rV86cWi2QiYoC8FAmKiQasACgkQ6cWi2QiY
oC/djwf/XkndqnAL3fXoxu97mF3/WyqG045Ou1ccSGk59Z4AUcxhCINQau08SZdw
7qo0atxOzxZ7e3RuiYUv0txbEYzPbE9m0QMkarHhv6QnaoekJLHnTMVDIPmqj/tV
HQt12MPMhDmKh3MbFJSshjjwqQ6J3U/vz9lr5IJcHe7eGPt3M4L9K4CPMEBqjm9H
O1bVyIh29jz3vWoNRMTRFsQodPk68tLGcvphA5A+W91Z8QX7BTYPORhUFxWLiEXP
FIe+870UWRENuOhFCja1+LP6IRzAR/pRsSMA9MZ5Dhuxl1/qgs5FV2AzMBdDoIji
kG5uXeFmBwMIub8ePsUXzvlFLX45AA==
=1IZc
-----END PGP SIGNATURE-----

?