diff mbox

gnu: Add ircii.

Message ID 87fuqoe10m.fsf@we.make.ritual.n0.is
State New
Headers show

Commit Message

non such Aug. 1, 2016, 7:34 p.m. UTC

Comments

Leo Famulari Aug. 2, 2016, 12:54 a.m. UTC | #1
On Mon, Aug 01, 2016 at 07:34:49PM +0000, ng0 wrote:
> * gnu/packages/irc.scm (ircii): New variable.

Cool!

> +             (snippet
> +              '(begin
> +                 (substitute* "bsdinstall"
> +                   (("/bin/strip") "strip")
> +                   (("/bin/cp") "cp")
> +                   (("/bin/chmod") "chmod")
> +                   (("/etc/chown") "chown")
> +                   (("/bin/chgrp") "chgrp")
> +                   (("/bin/mkdir") "mkdir")
> +                   (("/bin/rm") "rm")
> +                   (("/bin/mv") "mv"))))))

Does anyone else think we should put this origin snippet in a build phase
instead? Or, should we leave it in the origin, where it will be applied
to the source code provided by `guix build --source ircii`?

> +         (delete 'check))))

Using '#:tests? #f' is preferred instead of deleting the check phase.

> +    (inputs
> +     `(("libiconv" ,libiconv)
> +       ("ncurses" ,ncurses)
> +       ("openssl" ,openssl)))

I noticed that the built package does refer to libiconv:

---
$ guix gc --references $(./pre-inst-env guix build ircii)
/gnu/store/0kml8g9fix69v00afv59ngf4lgfr1565-openssl-1.0.2h
/gnu/store/9maps38bsia0wcxm82h0v0p2dxyn8j35-ircii-20151120
/gnu/store/9nifwk709wajpyfwa0jzaa3p6mf10vxs-gcc-4.9.3-lib
/gnu/store/m9vxvhdj691bq1f85lpflvnhcvrdilih-glibc-2.23
/gnu/store/xl19qrfzga52vrvp4ncccwjlnrjqwj95-ncurses-6.0
/gnu/store/ykzwykkvr2c80rw4l1qh3mvfdkl7jibi-bash-4.3.42
---

But, libiconv is used:

---
$ strings /gnu/store/9maps38bsia0wcxm82h0v0p2dxyn8j35-ircii-20151120/bin/irc | grep iconv
iconv_close
iconv
iconv_open
iconv_open@@GLIBC_2.2.5
iconv@@GLIBC_2.2.5
iconv_close@@GLIBC_2.2.5
---

Perhaps libiconv should be propagated?
Andreas Enge Aug. 2, 2016, 7:58 a.m. UTC | #2
On Mon, Aug 01, 2016 at 08:54:13PM -0400, Leo Famulari wrote:
> > +             (snippet
> > +              '(begin
> > +                 (substitute* "bsdinstall"
> > +                   (("/bin/strip") "strip")
> > +                   (("/bin/cp") "cp")
> > +                   (("/bin/chmod") "chmod")
> > +                   (("/etc/chown") "chown")
> > +                   (("/bin/chgrp") "chgrp")
> > +                   (("/bin/mkdir") "mkdir")
> > +                   (("/bin/rm") "rm")
> > +                   (("/bin/mv") "mv"))))))
> Does anyone else think we should put this origin snippet in a build phase
> instead? Or, should we leave it in the origin, where it will be applied
> to the source code provided by `guix build --source ircii`?

I think it would be more in line with our usual practices to have it in
a build phase, indeed. Snippets are rather used to remove non-free code
or bundled software.

Andreas
=?utf-8?B?5a6L5paH5q2m?= Aug. 2, 2016, 12:42 p.m. UTC | #3
Leo Famulari <leo@famulari.name> writes:

> On Mon, Aug 01, 2016 at 07:34:49PM +0000, ng0 wrote:
>> * gnu/packages/irc.scm (ircii): New variable.
>
> Cool!
>
>> +             (snippet
>> +              '(begin
>> +                 (substitute* "bsdinstall"
>> +                   (("/bin/strip") "strip")
>> +                   (("/bin/cp") "cp")
>> +                   (("/bin/chmod") "chmod")
>> +                   (("/etc/chown") "chown")
>> +                   (("/bin/chgrp") "chgrp")
>> +                   (("/bin/mkdir") "mkdir")
>> +                   (("/bin/rm") "rm")
>> +                   (("/bin/mv") "mv"))))))
>
> Does anyone else think we should put this origin snippet in a build phase
> instead? Or, should we leave it in the origin, where it will be applied
> to the source code provided by `guix build --source ircii`?
I think it should be in snippet.  The 'substitute*' doesn't introduce
any guix specified modifitions, it removes the hardcoded paths.

>
>> +         (delete 'check))))
>
> Using '#:tests? #f' is preferred instead of deleting the check phase.
>
>> +    (inputs
>> +     `(("libiconv" ,libiconv)
>> +       ("ncurses" ,ncurses)
>> +       ("openssl" ,openssl)))
>
> I noticed that the built package does refer to libiconv:
>
> ---
> $ guix gc --references $(./pre-inst-env guix build ircii)
> /gnu/store/0kml8g9fix69v00afv59ngf4lgfr1565-openssl-1.0.2h
> /gnu/store/9maps38bsia0wcxm82h0v0p2dxyn8j35-ircii-20151120
> /gnu/store/9nifwk709wajpyfwa0jzaa3p6mf10vxs-gcc-4.9.3-lib
> /gnu/store/m9vxvhdj691bq1f85lpflvnhcvrdilih-glibc-2.23
> /gnu/store/xl19qrfzga52vrvp4ncccwjlnrjqwj95-ncurses-6.0
> /gnu/store/ykzwykkvr2c80rw4l1qh3mvfdkl7jibi-bash-4.3.42
> ---
>
> But, libiconv is used:
>
> ---
> $ strings /gnu/store/9maps38bsia0wcxm82h0v0p2dxyn8j35-ircii-20151120/bin/irc | grep iconv
> iconv_close
> iconv
> iconv_open
> iconv_open@@GLIBC_2.2.5
> iconv@@GLIBC_2.2.5
> iconv_close@@GLIBC_2.2.5
> ---
>
> Perhaps libiconv should be propagated?
The iconv functions are provided by glibc, libiconv is for systems that
do not use glibc.  libiconv should be removed from inputs.
diff mbox

Patch

From fed474bfe97d68f9311213a6b05641bea5d5c858 Mon Sep 17 00:00:00 2001
From: ng0 <ng0@we.make.ritual.n0.is>
Date: Mon, 1 Aug 2016 19:31:23 +0000
Subject: [PATCH] gnu: Add ircii.

* gnu/packages/irc.scm (ircii): New variable.
---
 gnu/packages/irc.scm | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/gnu/packages/irc.scm b/gnu/packages/irc.scm
index 03f014a..c4ed9ed 100644
--- a/gnu/packages/irc.scm
+++ b/gnu/packages/irc.scm
@@ -194,3 +194,58 @@  with a keyboard, though it also supports mouse.  It is customizable
 and extensible with plugins and scripts.")
     (home-page "http://www.weechat.org/")
     (license license:gpl3)))
+
+(define-public ircii
+  (package
+    (name "ircii")
+    (version "20151120")
+    (source (origin
+             (method url-fetch)
+             (uri (string-append "https://ircii.warped.com/"
+                                 name "-" version ".tar.gz"))
+             (sha256
+              (base32
+               "178dc279f5j894qvp96dzz7c0jpryqlcqw5g0dc9yaxg9kgw1lqm"))
+             (modules '((guix build utils)))
+             (snippet
+              '(begin
+                 (substitute* "bsdinstall"
+                   (("/bin/strip") "strip")
+                   (("/bin/cp") "cp")
+                   (("/bin/chmod") "chmod")
+                   (("/etc/chown") "chown")
+                   (("/bin/chgrp") "chgrp")
+                   (("/bin/mkdir") "mkdir")
+                   (("/bin/rm") "rm")
+                   (("/bin/mv") "mv"))))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'configure
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out"))
+                   (ncurses (assoc-ref inputs "ncurses"))
+                   (openssl (assoc-ref inputs "openssl")))
+               (setenv "CONFIG_SHELL" (which "bash"))
+               (zero?
+                (system* "./configure"
+                         ;; TODO: find a socks4+5 lib with small size
+                         ;; (string-append "--with-socks5=" ghc-socks)
+                         (string-append "--prefix=" out)
+                         (string-append "--enable-ipv6")
+                         (string-append "--with-openssl=" openssl)
+                         (string-append "--with-emacs-meta-keys"))))))
+         (delete 'check))))
+    (inputs
+     `(("libiconv" ,libiconv)
+       ("ncurses" ,ncurses)
+       ("openssl" ,openssl)))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("perl" ,perl)))
+    (home-page "http://www.eterna.com.au/ircii/")
+    (synopsis "Terminal-based IRC and ICB client")
+    (description
+     "ircII is a terminal based IRC and ICB client for UNIX systems.")
+    (license license:bsd-3)))
-- 
2.9.2