diff mbox

[?] gnu: Add dash.

Message ID 20160728020337.29026-1-me@tobias.gr
State New
Headers show

Commit Message

Tobias Geerinckx-Rice July 28, 2016, 2:03 a.m. UTC
* gnu/packages/dash.shm: New file.
---

Guix!

IMO this belongs in a (new) shell.scm with fish, tcsh and zsh.
Maybe bash, too. On the other hand:

Certain shells might have an 'ecosystem' of 'packages', such as
bash-completion in bash.scm, that might justify leaving them in
their own file. I'm thinking specifically of zsh here.

I'd suggest merging them all and splitting out if and when needed,
but prefer to ask the wisdom of the list before doing that tedious
deed.

Kind regards,

T G-R

 gnu/packages/dash.scm | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 60 insertions(+)
 create mode 100644 gnu/packages/dash.scm

Comments

Ludovic Courtès July 28, 2016, 12:44 p.m. UTC | #1
Hi!

Tobias Geerinckx-Rice <me@tobias.gr> skribis:

> * gnu/packages/dash.shm: New file.
> ---
>
> Guix!
>
> IMO this belongs in a (new) shell.scm with fish, tcsh and zsh.
> Maybe bash, too. On the other hand:
>
> Certain shells might have an 'ecosystem' of 'packages', such as
> bash-completion in bash.scm, that might justify leaving them in
> their own file. I'm thinking specifically of zsh here.
>
> I'd suggest merging them all and splitting out if and when needed,
> but prefer to ask the wisdom of the list before doing that tedious
> deed.

I would keep Bash separate, but I agree it’s a good idea to merge the
other ones in one module.

If you want, you could do that and then add Dash to that file?

[...]

> +    (home-page "http://gondor.apana.org.au/~herbert/dash")
> +    (synopsis "POSIX-compliant shell optimised for size")
> +    (description
> +     "dash is a POSIX-compliant @command{/bin/sh} implementation that aims to be
> +as small as possible, often without sacrificing speed.  It is significantly
> +faster than the GNU Bourne-Again Shell (@command{bash}) at most tasks.  dash is
> +a direct descendant of NetBSD's Almquist Shell (@command{ash}).")
> +    (license (list bsd-3
> +                   gpl2+))))    ; mksignames.c

I’d tend to remove “significantly” :-), but otherwise LGTM, thanks!

Ludo’.
non such July 29, 2016, 2:44 p.m. UTC | #2
Ludovic Courtès <ludo@gnu.org> writes:

> Hi!
>
> Tobias Geerinckx-Rice <me@tobias.gr> skribis:
>
>> * gnu/packages/dash.shm: New file.
>> ---
>>
>> Guix!
>>
>> IMO this belongs in a (new) shell.scm with fish, tcsh and zsh.
>> Maybe bash, too. On the other hand:
>>
>> Certain shells might have an 'ecosystem' of 'packages', such as
>> bash-completion in bash.scm, that might justify leaving them in
>> their own file. I'm thinking specifically of zsh here.
>>
>> I'd suggest merging them all and splitting out if and when needed,
>> but prefer to ask the wisdom of the list before doing that tedious
>> deed.
>
> I would keep Bash separate, but I agree it’s a good idea to merge the
> other ones in one module.
>
> If you want, you could do that and then add Dash to that file?
>
> [...]
>
>> +    (home-page "http://gondor.apana.org.au/~herbert/dash")
>> +    (synopsis "POSIX-compliant shell optimised for size")
>> +    (description
>> +     "dash is a POSIX-compliant @command{/bin/sh} implementation that aims to be
>> +as small as possible, often without sacrificing speed.  It is significantly
>> +faster than the GNU Bourne-Again Shell (@command{bash}) at most tasks.  dash is
>> +a direct descendant of NetBSD's Almquist Shell (@command{ash}).")
>> +    (license (list bsd-3
>> +                   gpl2+))))    ; mksignames.c
>
> I’d tend to remove “significantly” :-), but otherwise LGTM, thanks!

I second this. Significantly faster is subjectiv as long as we do not
provide some side by side benchmark results etc.

> Ludo’.
>
Leo Famulari July 29, 2016, 3:51 p.m. UTC | #3
On Fri, Jul 29, 2016 at 02:44:27PM +0000, ng0 wrote:
> I second this. Significantly faster is subjectiv as long as we do not
> provide some side by side benchmark results etc.

I'm not suggesting that we run the benchmarks or put 'significantly'
back in the description, but I would like to include some context.

This is the shell that Debian uses as the default non-interactive
"system" shell. They replaced Bash with dash in that context in order to
reduce the time spent on shell initialization for things like the boot
sequence.

Just an FYI.
Tobias Geerinckx-Rice July 31, 2016, 9:18 p.m. UTC | #4
Hullo all,

On Fri, Jul 29, 2016 at 02:44:27PM +0000, ng0 wrote:
> Ludovic Courtès <ludo@gnu.org> writes:
>> I’d tend to remove “significantly” , but otherwise LGTM, thanks!
> I second this. Significantly faster is subjectiv as long as we do not
> provide some side by side benchmark results etc.

Let's not give Phoronix any ideas.

While I am convinced that ‘significantly faster’ is an objective fact, I
agree that such claims smell so subjective that they don't belong in
Guix. I just copied that bit from upstream, to be honest. Dropped.

On 29/07/2016 17:51, Leo Famulari wrote:
> I'm not suggesting that we run the benchmarks or put 'significantly'
> back in the description, but I would like to include some context.
> 
> This is the shell that Debian uses as the default non-interactive
> "system" shell. They replaced Bash with dash in that context in order to
> reduce the time spent on shell initialization for things like the boot
> sequence.

Indeed; thanks for adding that. dash is horrible for interactive use,
but fast at running shell[1] scripts. If anyone thinks that might be
relevant in the description, let me know.

Otherwise, I'll push it soon with the suggested changes.

Kind regards,

T G-R

[1]:  It's also a trivial way to catch 98% of bash-specific code.
Leo Famulari July 31, 2016, 9:58 p.m. UTC | #5
On Sun, Jul 31, 2016 at 11:18:14PM +0200, Tobias Geerinckx-Rice wrote:
> Indeed; thanks for adding that. dash is horrible for interactive use,
> but fast at running shell[1] scripts. If anyone thinks that might be
> relevant in the description, let me know.

Nope, no suggestion from me :) I just wanted to provide some context.

> [1]:  It's also a trivial way to catch 98% of bash-specific code.

Yup, it's how I like to test /bin/sh scripts.
Ludovic Courtès Aug. 1, 2016, 12:02 p.m. UTC | #6
Tobias Geerinckx-Rice <me@tobias.gr> skribis:

> Otherwise, I'll push it soon with the suggested changes.

Fine with me!

Thanks,
Ludo’.
Tobias Geerinckx-Rice Aug. 3, 2016, 3:04 a.m. UTC | #7
On 31/07/16 23:18, Tobias Geerinckx-Rice wrote:
> I'll push it soon with the suggested changes.

Done — a bit more verbosely than intended because typing ‘origin’
instead of ‘upstream’ is apparently the hardest thing ever — in c356339
et al.

Kind regards,

T G-R
diff mbox

Patch

diff --git a/gnu/packages/dash.scm b/gnu/packages/dash.scm
new file mode 100644
index 0000000..017e81c
--- /dev/null
+++ b/gnu/packages/dash.scm
@@ -0,0 +1,60 @@ 
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2016 Tobias Geerinckx-Rice <me@tobias.gr>
+;;;
+;;; 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 packages dash)
+  #:use-module (guix licenses)
+  #:use-module (guix packages)
+  #:use-module (guix download)
+  #:use-module (guix build-system gnu)
+  #:use-module (gnu packages libedit))
+
+(define-public dash
+  (package
+    (name "dash")
+    (version "0.5.9")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "http://gondor.apana.org.au/~herbert/dash/files/"
+                           name "-" version ".tar.gz"))
+       (sha256
+        (base32
+         "17328wd9n5krr5wd37smrk0y7fdf8aa3hmhm02br5mqpq0a3nycj"))
+       (modules '((guix build utils)))
+       (snippet
+        '(begin
+           ;; The man page hails from BSD, where (d)ash is the default shell.
+           ;; This isn't the case on Guix or indeed most other GNU systems.
+           (substitute* "src/dash.1"
+             (("the standard command interpreter for the system")
+              "a command interpreter based on the original Bourne shell"))
+           #t))))
+    (build-system gnu-build-system)
+    (inputs
+     `(("libedit" ,libedit)))
+    (arguments
+     `(#:configure-flags '("--with-libedit")))
+    (home-page "http://gondor.apana.org.au/~herbert/dash")
+    (synopsis "POSIX-compliant shell optimised for size")
+    (description
+     "dash is a POSIX-compliant @command{/bin/sh} implementation that aims to be
+as small as possible, often without sacrificing speed.  It is significantly
+faster than the GNU Bourne-Again Shell (@command{bash}) at most tasks.  dash is
+a direct descendant of NetBSD's Almquist Shell (@command{ash}).")
+    (license (list bsd-3
+                   gpl2+))))    ; mksignames.c