* New package: ifstatus
@ 2015-09-14 16:35 Stefan Reichör
2015-09-14 19:25 ` Ricardo Wurmus
2015-09-16 20:06 ` Andreas Enge
0 siblings, 2 replies; 3+ messages in thread
From: Stefan Reichör @ 2015-09-14 16:35 UTC (permalink / raw)
To: guix-devel
[-- Attachment #1: Type: text/plain, Size: 526 bytes --]
Hi there,
I am new to this list. I am already monitoring the progress of guix for
some months. I really like the idea behind it (I am a longterm emacs user).
At the moment I have installed guix on one of my Ubuntu machines.
I jump in with the description of the tool ifstatus.
I am not sure where to put it in the package tree. So I started with a
single file.
The package needs a simple patch (add #include <stdlib.h>). I decided to
do it using substitute*...
I hope ifstatus will be integrated as guix package.
Stefan.
[-- Attachment #2: ifstatus.scm --]
[-- Type: application/octet-stream, Size: 2824 bytes --]
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2014 Stefan Reichoer <stefan@xsteve.at>
;;;
;;; 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 (ifstatus)
#:use-module (guix licenses)
#:use-module (guix download)
#:use-module (guix packages)
#:use-module (guix build-system gnu)
#:use-module (gnu packages)
#:use-module (gnu packages ncurses))
(define-public ifstatus
(package
(name "ifstatus")
(version "1.1.0")
(source
(origin
(method url-fetch)
(uri (string-append "http://ifstatus.sourceforge.net/download/ifstatus-v"
version ".tar.gz"))
(sha256
(base32
"045cbsq9ps32j24v8y5hpyqxnqn9mpaf3mgvirlhgpqyb9jsia0c"))
(modules '((guix build utils)))
(snippet
'(begin
(substitute* "Main.h"
(("#include <stdio.h>") "#include <stdio.h>\n#include <stdlib.h>"))))
))
(build-system gnu-build-system)
(arguments
'(#:tests? #f ;no "check" target
#:phases
(modify-phases %standard-phases
(delete 'configure) ;; no configure script
(replace 'install
(lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(bin (string-append out "/bin")))
(mkdir-p bin)
(copy-file "ifstatus"
(string-append bin "/ifstatus"))))))))
(inputs `(("ncurses" ,ncurses)))
(home-page "http://ifstatus.sourceforge.net/graphic/index.html")
(synopsis "Text-based network interface status monitor")
(description
"IFStatus was developed for Linux users that are usually in console mode.
It is a simple, easy to use program for displaying commonly needed / wanted statistics
in real time about ingoing and outgoing traffic of multiple network interfaces that is
usually hard to find, with a simple and effecient view. It is the substitute for
PPPStatus and EthStatus projects.")
(license bsd-2)))
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: New package: ifstatus
2015-09-14 16:35 New package: ifstatus Stefan Reichör
@ 2015-09-14 19:25 ` Ricardo Wurmus
2015-09-16 20:06 ` Andreas Enge
1 sibling, 0 replies; 3+ messages in thread
From: Ricardo Wurmus @ 2015-09-14 19:25 UTC (permalink / raw)
To: Stefan Reichör; +Cc: guix-devel
Hello Stefan,
thank you for the contribution!
I think this would best fit to the module in ‘networking.scm’. Usually,
we use git to track changes and create patches from committed changes.
You could add your package recipe to ‘networking.scm’ and create a
commit with the message:
gnu: Add ifstatus.
* gnu/packages/networking.scm (ifstatus): New variable.
Then you can create a patch from your last commit by running
git format-patch -1
and just send it to the mailing list.
Now some comments about the package.
> ;;; Copyright © 2014 Stefan Reichoer <stefan@xsteve.at>
It’s 2015 here ;)
> (source
> (origin
> (method url-fetch)
> (uri (string-append "http://ifstatus.sourceforge.net/download/ifstatus-v"
> version ".tar.gz"))
This line is a little too long. Also, you might be able to use
“mirror://sourceforge/” instead of this direct download URL.
> (sha256
> (base32
> "045cbsq9ps32j24v8y5hpyqxnqn9mpaf3mgvirlhgpqyb9jsia0c"))
> (modules '((guix build utils)))
> (snippet
> '(begin
> (substitute* "Main.h"
> (("#include <stdio.h>") "#include <stdio.h>\n#include <stdlib.h>"))))
> ))
This is not indented as it should be. How about this instead:
(snippet
'(substitute* "Main.h"
(("#include <stdio.h>")
"#include <stdio.h>\n#include <stdlib.h>")))
> (arguments
> '(#:tests? #f ;no "check" target
> #:phases
> (modify-phases %standard-phases
> (delete 'configure) ;; no configure script
> (replace 'install
> (lambda* (#:key outputs #:allow-other-keys)
> (let* ((out (assoc-ref outputs "out"))
> (bin (string-append out "/bin")))
> (mkdir-p bin)
> (copy-file "ifstatus"
> (string-append bin "/ifstatus"))))))))
Also here the indentation is off. Please align the opening parentheses
of the ‘(delete ...)’ and ‘(replace ...)’ under the ‘o’ of
‘(modify-phases ...)’. Furthermore, please only use one semicolon for
margin comments like “; no configure script”. Two semicolons are used
only for full line comments.
> (description
> "IFStatus was developed for Linux users that are usually in console mode.
> It is a simple, easy to use program for displaying commonly needed / wanted statistics
> in real time about ingoing and outgoing traffic of multiple network interfaces that is
> usually hard to find, with a simple and effecient view. It is the substitute for
> PPPStatus and EthStatus projects.")
“Linux” users? ;)
s/effecient/efficient/
Please use double-spacing between sentences.
How about something like this instead:
“IFStatus is a simple, easy-to-use program for displaying commonly
needed / wanted real-time traffic statistics of multiple network
interfaces, with a simple and efficient view on the command line. It is
intended as a substitute for the PPPStatus and EthStatus projects.”
~~ Ricardo
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: New package: ifstatus
2015-09-14 16:35 New package: ifstatus Stefan Reichör
2015-09-14 19:25 ` Ricardo Wurmus
@ 2015-09-16 20:06 ` Andreas Enge
1 sibling, 0 replies; 3+ messages in thread
From: Andreas Enge @ 2015-09-16 20:06 UTC (permalink / raw)
To: Stefan Reichör; +Cc: guix-devel
Hello,
thanks for submitting your first package!
On Mon, Sep 14, 2015 at 06:35:34PM +0200, Stefan Reichör wrote:
> The package needs a simple patch (add #include <stdlib.h>). I decided to
> do it using substitute*...
What is the status of the patch? Does it come from upstream, or did you
submit a bug report? If yes, it would be good to add a comment. If not,
it would be good to submit it :-)
Personally, for such modifications that are not specific to Guix, but
rather bug fixes to the source code, which are supposed to disappear
in the next release, I would prefer a patch. But this is minor, even
more so since only a single line is concerned.
Andreas
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-09-16 20:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-14 16:35 New package: ifstatus Stefan Reichör
2015-09-14 19:25 ` Ricardo Wurmus
2015-09-16 20:06 ` Andreas Enge
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.