Subject: bug#26962: closed (Re: bug#26962: A shell: s)

From: [email-masked] (GNU bug Tracking System)
Date: Sun, 04 Jun 2017 14:48:02 +0000

Your bug report

#26962: A shell: s

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
26962: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=26962
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#26962: A shell: s
From: Kei Kebreau <[email-masked]>
To: [email-masked]
Cc: [email-masked]
Date: Sun, 04 Jun 2017 10:47:07 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

ng0 <[email-masked]> writes:

> Hi,
>
> Kei Kebreau transcribed 1.3K bytes:
>> ng0 <[email-masked]> writes:
>> 
>> > This adds the shell s(1) and the selfcontained linenoise,
>> > a readline replacement.
>> 
>> Linenoise looks like it's under a BSD 2-clause license. Also, "andglob"
>> in the description of s(1) can go in a @code tag (is that the correct term?).
>> 
>> If you're okay with these changes, I can commit this on your behalf.
>
> That would be alright, thanks! If there's a mistake I'm pretty
> sure rain1 will correct it eventually.

Linenoise pushed as 17cf788ffa875e5315a1420e63e91658dae1c23a and
s pushed as 0e4591bb696a36bc83f75869dd2711987b17b722 to master!

Thanks for the package submissions!

Subject: A shell: s
From: ng0 <[email-masked]>
To: [email-masked]
Date: Wed, 17 May 2017 13:42:41 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

This adds the shell s(1) and the selfcontained linenoise,
a readline replacement.

From 662892f68cfdce43629e304e8abdf46ae2f7557b Mon Sep 17 00:00:00 2001
From: ng0 <[email-masked]>
Date: Tue, 16 May 2017 22:28:57 +0000
Subject: [PATCH 1/2] gnu: Add linenoise.

* gnu/packages/shells.scm (linenoise): New variable.
---
 gnu/packages/shells.scm | 44 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/gnu/packages/shells.scm b/gnu/packages/shells.scm
index 4e684e8c8..714b8f291 100644
--- a/gnu/packages/shells.scm
+++ b/gnu/packages/shells.scm
@@ -457,3 +457,47 @@ components: a process notation for running programs and setting up pipelines
 and redirections, and a complete syscall library for low-level access to the
 operating system.")
       (license bsd-3))))
+
+(define-public linenoise
+  (package
+    (name "linenoise")
+    (version "1.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://github.com/antirez/linenoise/"
+                           "archive/" version ".tar.gz"))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32
+         "05006hd56xcvxjdpll4x720bpfan7vwqmxbw8a2kvm10w57ll1gm"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f ;No tests are included
+       #:make-flags (list "CC=gcc")
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure)
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             ;; At the moment there is no 'make install' in upstream.
+             (let* ((out (assoc-ref outputs "out")))
+               (install-file "linenoise.h"
+                             (string-append out "/include/linenoise"))
+               (install-file "linenoise.c"
+                             (string-append out "/include/linenoise"))
+               #t))))))
+    (home-page "https://github.com/antirez/linenoise")
+    (synopsis "Minimal zero-config readline replacement")
+    (description
+     "Linenoise is a minimal, zero-config, readline replacement.
+Its features include:
+
+@enumerate
+@item Single and multi line editing mode with the usual key bindings
+@item History handling
+@item Completion
+@item Hints (suggestions at the right of the prompt as you type)
+@item A subset of VT100 escapes, ANSI.SYS compatible
+@end enumerate\n")
+    (license bsd-4)))
-- 
2.13.0

From f36ada5fa95ca2d1d01a75b507295c97b7a2419b Mon Sep 17 00:00:00 2001
From: ng0 <[email-masked]>
Date: Tue, 16 May 2017 22:28:58 +0000
Subject: [PATCH 2/2] gnu: Add s.

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

diff --git a/gnu/packages/shells.scm b/gnu/packages/shells.scm
index 714b8f291..fbfc45626 100644
--- a/gnu/packages/shells.scm
+++ b/gnu/packages/shells.scm
@@ -501,3 +501,64 @@ Its features include:
 @item A subset of VT100 escapes, ANSI.SYS compatible
 @end enumerate\n")
     (license bsd-4)))
+
+(define-public s
+  (let ((commit "6604341edb3a775ff94415762af3ee9bd86bfb3c")
+        (revision "1"))
+    (package
+      (name "s")
+      (version (string-append "0.0.0-" revision "." (string-take commit 7)))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/rain-1/s")
+               (commit commit)))
+         (file-name (string-append name "-" version "-checkout"))
+         (sha256
+          (base32
+           "1075cml6dl15d770j3m12yz90cjacsdslbv3gank1nxd76vmpdcr"))))
+      (build-system gnu-build-system)
+      (inputs
+       `(("linenoise" ,linenoise)))
+      (arguments
+       `(#:tests? #f
+         #:make-flags (list "CC=gcc")
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'install-directory-fix
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let* ((out (assoc-ref outputs "out"))
+                      (bin (string-append out "/bin")))
+                 (substitute* "Makefile"
+                   (("out") bin))
+                 #t)))
+           (add-after 'install 'manpage
+             (lambda* (#:key outputs #:allow-other-keys)
+               (install-file "s.1" (string-append (assoc-ref outputs "out")
+                                                  "/share/man/man1"))))
+           (replace 'configure
+             (lambda* (#:key inputs outputs #:allow-other-keys)
+               ;; At this point linenoise is meant to be included,
+               ;; so we have to really copy it into the working directory
+               ;; of s.
+               (let* ((linenoise (assoc-ref inputs "linenoise"))
+                      (noisepath (string-append linenoise "/include/linenoise"))
+                      (out (assoc-ref outputs "out")))
+                 (copy-recursively noisepath "linenoise")
+                 (substitute* "s.c"
+                   (("/bin/s") (string-append out "/bin/s")))
+                 #t))))))
+      (home-page "https://github.com/rain-1/s")
+      (synopsis "Extremely minimal shell with the simplest syntax possible")
+      (description
+       "S is a new shell that aims to be extremely simple.
+S does not implemnt the POSIX shell standard.
+There are no globs or \"splatting\" where a variable $FOO turns into multiple
+command line arguments.  One token stays one token forever.
+This is a \"no surprises\" straightforward approach.
+
+There are no redirection operators > in the shell language,  they are
+added as extra programs.  > is just another unix command, < is essentially
+cat(1).   A  andglob program is also provided along with s.")
+      (license bsd-3))))
-- 
2.13.0