Subject: bug#25732: [PATCH 2/2] gnu: Add scsh.

From: [email-masked]
Date: Tue, 14 Feb 2017 19:32:59 +0000

From: ng0 <[email-masked]>

* gnu/packages/shells.scm (scsh): 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 a7a7fbce5..7fe1de13e 100644
--- a/gnu/packages/shells.scm
+++ b/gnu/packages/shells.scm
@@ -37,6 +37,7 @@
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
   #:use-module (gnu packages readline)
+  #:use-module (gnu packages scheme)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system python)
   #:use-module (guix download)
@@ -382,3 +383,63 @@ primitives that you are used to from Bash and IPython.  It works on all major
 systems including Linux, Mac OSX, and Windows.  Xonsh is meant for the daily
 use of experts and novices alike.")
     (license bsd-2)))
+
+(define-public scsh
+  (let ((commit "114432435e4eadd54334df6b37fcae505079b49f")
+        (revision "1"))
+    (package
+      (name "scsh")
+      (version (string-append "0.0.0-" revision "." (string-take commit 7)))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/scheme/scsh")
+               (commit commit)))
+         (file-name (string-append name "-" version "-checkout"))
+         (sha256
+          (base32
+           "1ghk08akiz7hff1pndi8rmgamgcrn2mv9asbss9l79d3c2iaav3q"))))
+      (build-system gnu-build-system)
+      (arguments
+       `(#:test-target "test"
+         #:phases
+         (modify-phases %standard-phases
+           (add-before 'configure 'replace-rx
+             (lambda* (#:key inputs #:allow-other-keys)
+               (let* ((rx (assoc-ref inputs "rx"))
+                      (rxpath (string-append rx "/share/scheme48-"
+                                             ,(package-version scheme48)
+                                             "/rx")))
+                 (delete-file-recursively "rx")
+                 (copy-recursively rxpath "rx"))
+               #t))
+           (add-before 'configure 'autoreconf
+             (lambda _
+               (zero? (system* "autoreconf")))))))
+      (inputs
+       `(("scheme48" ,scheme48)
+         ("rx" ,rx)))
+      (native-inputs
+       `(("autoconf" ,autoconf)
+         ("automake" ,automake)))
+      (home-page "https://github.com/scheme/scsh")
+      (synopsis "Unix shell embedded in Scheme")
+      (description
+       "Scsh is a unix shell embedded in Scheme.  What does that mean?
+Well, unix shells are powerful tools.  They allow a user to concisely specify
+her commands and the communications between them (piping, redirecting, &c.).
+When she needs to do something more complex than running a set of commands
+with known inputs, however, things become complicated.  General programming
+with sh can be unpleasant and error prone, to say the least.
+
+Scheme is a simple, expressive general programming language.  A user with some
+taste may want to use it to wield her computing machine.  For simple commands,
+however, it is not the most concise.  At the scale of the command line, even the
+overhead of parentheses matters.  It would be nice to use each of these languages
+where their strengths lie.
+
+Scsh is the solution.  It allows the user to write commands in a language within
+Scheme that follows the unix way, but also allows her to specify more complex
+commands with the elegance of Scheme.")
+      (license bsd-3))))
-- 
2.11.1