diff mbox series

[bug#55876] gnu: Add remserial

Message ID 87y1y5y8gl.fsf@gmail.com
State New
Headers show
Series [bug#55876] gnu: Add remserial | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

Artyom V. Poptsov June 9, 2022, 6:53 p.m. UTC
Hello,

this patch adds 'remserial'. [1]

- Artyom

References:
1. "Communications bridge between TCP/IP and a serial port"
   http://lpccomp.bc.ca/remserial/
diff mbox series

Patch

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(+)

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