diff mbox

gnu: Add epic5.

Message ID 20161009184411.30748-2-ngillmann@runbox.com
State New
Headers show

Commit Message

ng0 Oct. 9, 2016, 6:44 p.m. UTC
From: ng0 <ng0@we.make.ritual.n0.is>

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

Comments

ng0 Oct. 9, 2016, 6:49 p.m. UTC | #1
ng0 <ngillmann@runbox.com> writes:

> From: ng0 <ng0@we.make.ritual.n0.is>
>
> * gnu/packages/irc.scm (epic5): New variable.
> ---
>  gnu/packages/irc.scm | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 83 insertions(+)
>
> diff --git a/gnu/packages/irc.scm b/gnu/packages/irc.scm
> index db398de..f61afb4 100644
> --- a/gnu/packages/irc.scm
> +++ b/gnu/packages/irc.scm
> @@ -32,9 +32,11 @@
>    #:use-module (gnu packages autogen)
>    #:use-module (gnu packages autotools)
>    #:use-module (gnu packages base)
> +  #:use-module (gnu packages backup)
>    #:use-module (gnu packages compression)
>    #:use-module (gnu packages curl)
>    #:use-module (gnu packages cyrus-sasl)
> +  #:use-module (gnu packages databases)
>    #:use-module (gnu packages file)
>    #:use-module (gnu packages gettext)
>    #:use-module (gnu packages glib)
> @@ -47,6 +49,7 @@
>    #:use-module (gnu packages perl)
>    #:use-module (gnu packages pkg-config)
>    #:use-module (gnu packages python)
> +  #:use-module (gnu packages ruby)
>    #:use-module (gnu packages qt)
>    #:use-module (gnu packages tcl)
>    #:use-module (gnu packages tls)
> @@ -329,3 +332,83 @@ and extensible with plugins and scripts.")
>  embedded web server, translations (fr, fi, it, hu, de), and many
>  other enhancements and bug fixes.")
>      (license license:bsd-3)))
> +
> +(define-public epic5
> +  (package
> +    (name "epic5")
> +    (version "2.0.1")
> +    (source (origin
> +              (method url-fetch)
> +              (uri (string-append "http://ftp.epicsol.org/pub/epic/EPIC5-PRODUCTION/"
> +                                  name "-" version ".tar.xz"))
> +              (sha256
> +               (base32
> +                "1ap73d5f4vccxjaaq249zh981z85106vvqmxfm4plvy76b40y9jm"))))
> +    (build-system gnu-build-system)
> +    (arguments
> +     `(#:test-target "test"
> +       #:phases
> +       (modify-phases %standard-phases
> +         (add-after 'unpack 'patch-perl
> +           (lambda _
> +             (substitute* "regress/crash-irc"
> +               (("perl5") (which "perl")))))
> +         (add-after 'unpack 'patch-bsdinstall
> +           ;; If we just remove /bin/ some part of the bsdinstall breaks.
> +           ;; Furthermore bsdinstalls has a reference to /etc/chmod here, which
                                       ^___ typo, please correct this to
                                       bsdinstall, without the "s" which
                                       was correct only when the leading
                                       "Furthermore" wasn't there.
> +           ;; means if we leave /etc/ in, install fails.
> +           (lambda _
> +             (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")
> +               (("/etc/") ""))))
> +         (replace 'configure
> +           (lambda* (#:key outputs #:allow-other-keys)
> +             ;; The tarball uses a very old version of autconf. It doesn't
> +             ;; understand extra flags like `--enable-fast-install', so
> +             ;; we need to invoke it with just what it understands.
> +             (let ((out (assoc-ref outputs "out")))
> +               ;; 'configure' doesn't understand '--host'.
> +               ,@(if (%current-target-system)
> +                     `((setenv "CHOST" ,(%current-target-system)))
> +                     '())
> +               (setenv "CONFIG_SHELL" (which "bash"))
> +               (setenv "SHELL" (which "bash"))
> +               (zero?
> +                (system* "./configure"
> +                         (string-append "--prefix=" out)
> +                         "--with-ipv6" "--with-libarchive"
> +                         "--with-ssl"
> +                         (string-append "--with-tcl="
> +                                        (assoc-ref %build-inputs "tcl")
> +                                        "/lib/tclConfig.sh")))))))))
> +    (inputs
> +     `(("openssl" ,openssl)
> +       ("ncurses" ,ncurses)
> +       ("libarchive" ,libarchive) ; CHANGELOG: "Support for loading zip files"
> +       ("perl" ,perl)
> +       ("tcl" ,tcl)
> +       ("ruby" ,ruby)
> +       ("gdbm" ,gdbm)))
> +    (native-inputs
> +     `(("pkg-config" ,pkg-config)))
> +    (home-page "http://epicsol.org")
> +    (synopsis "Epic5 IRC Client")
> +    (description
> +     "EPIC is a IRC client that has been under active development for 20+ years
> +in 5 generations.  It is stable and mature, and offers an excellent ircII
> +interface for those of us who are accustomed to the ircII way of doing things.")
> +    (license (list license:bsd-3
> +                   license:isc
> +                   license:bsd-4
> +                   ;; The epic license is equal to the standard three-clause
> +                   ;; BSD license except that you are not permitted to remove the
> +                   ;; "Redistribution is permitted" clause of the license if you
> +                   ;; distribute binaries.
> +                   license:non-copyleft "http://epicsol.org/copyright"))))
> -- 
> 2.10.1
>
>

--
Leo Famulari Oct. 9, 2016, 7:48 p.m. UTC | #2
On Sun, Oct 09, 2016 at 06:44:11PM +0000, ng0 wrote:
> From: ng0 <ng0@we.make.ritual.n0.is>
> 
> * gnu/packages/irc.scm (epic5): New variable.

Thanks for the updated patch.

Sorry I didn't notice this before...

> +    (inputs
> +     `(("openssl" ,openssl)
> +       ("ncurses" ,ncurses)
> +       ("libarchive" ,libarchive) ; CHANGELOG: "Support for loading zip files"
> +       ("perl" ,perl)
> +       ("tcl" ,tcl)
> +       ("ruby" ,ruby)
> +       ("gdbm" ,gdbm)))

Using `guix gc --references $(./pre-inst-env guix build epic5)`, I
noticed that there is no reference to gdbm.

So, if you install this epic5 package and then do `guix gc`, you will
lose gdbm and I assume that epic5 will stop working.

We need to figure out a way to make sure epic5 keeps that reference.
ng0 Oct. 9, 2016, 8:51 p.m. UTC | #3
Leo Famulari <leo@famulari.name> writes:

> On Sun, Oct 09, 2016 at 06:44:11PM +0000, ng0 wrote:
>> From: ng0 <ng0@we.make.ritual.n0.is>
>> 
>> * gnu/packages/irc.scm (epic5): New variable.
>
> Thanks for the updated patch.
>
> Sorry I didn't notice this before...
>
>> +    (inputs
>> +     `(("openssl" ,openssl)
>> +       ("ncurses" ,ncurses)
>> +       ("libarchive" ,libarchive) ; CHANGELOG: "Support for loading zip files"
>> +       ("perl" ,perl)
>> +       ("tcl" ,tcl)
>> +       ("ruby" ,ruby)
>> +       ("gdbm" ,gdbm)))
>
> Using `guix gc --references $(./pre-inst-env guix build epic5)`, I
> noticed that there is no reference to gdbm.
>
> So, if you install this epic5 package and then do `guix gc`, you will
> lose gdbm and I assume that epic5 will stop working.
>
> We need to figure out a way to make sure epic5 keeps that reference.


Hm. Maybe there's an config option I can pass, if you have time to look
at it go ahead, I'll be slow and update it some time this month.
I keep poking at system services and trying to finish those, easier said
than done in some cases it turns out.

--
non such Oct. 10, 2016, 10:03 p.m. UTC | #4
ng0 <ngillmann@runbox.com> writes:

> Leo Famulari <leo@famulari.name> writes:
>
>> On Sun, Oct 09, 2016 at 06:44:11PM +0000, ng0 wrote:
>>> From: ng0 <ng0@we.make.ritual.n0.is>
>>> 
>>> * gnu/packages/irc.scm (epic5): New variable.
>>
>> Thanks for the updated patch.
>>
>> Sorry I didn't notice this before...
>>
>>> +    (inputs
>>> +     `(("openssl" ,openssl)
>>> +       ("ncurses" ,ncurses)
>>> +       ("libarchive" ,libarchive) ; CHANGELOG: "Support for loading zip files"
>>> +       ("perl" ,perl)
>>> +       ("tcl" ,tcl)
>>> +       ("ruby" ,ruby)
>>> +       ("gdbm" ,gdbm)))
>>
>> Using `guix gc --references $(./pre-inst-env guix build epic5)`, I
>> noticed that there is no reference to gdbm.
>>
>> So, if you install this epic5 package and then do `guix gc`, you will
>> lose gdbm and I assume that epic5 will stop working.
>>
>> We need to figure out a way to make sure epic5 keeps that reference.
>
>
> Hm. Maybe there's an config option I can pass, if you have time to look
> at it go ahead, I'll be slow and update it some time this month.
> I keep poking at system services and trying to finish those, easier said
> than done in some cases it turns out.

This can not be related, but I will set the CFLAGS too with the next
version of the patch:

  o  You must not try to compile epic with "gcc -O2" because -O2 will
     generate bad code that leads to random crashes.  When you use -O2,
     gcc assumes the source is conformant to ISO C99's requirements about
     alias-safety, and EPIC, being a C90 program, does not conform, so the
     result is undefined behavior (which means it crashes randomly.)  This
     is not a bug in EPIC.  You must only compile epic with -O.



egrep -nr "gdbm":

*** News 10/30/2005 -- New function, $dbmctl() [hash table support]
        *** Notice *** This function uses a custom implementation of SDBM.
        The file format it generates should be compatable with $perl() but
        is not compatable with ndbm or gdbm.

        The $dbmctl() function is an interface to the unix DBM API:
            $dbmctl(OPEN type filename)
                Open a DBM file for read and write access.
            $dbmctl(OPEN_READ type filename)
                Open a DBM file for read-only access.
            $dbmctl(CLOSE refnum)
                Close a previously opened DBM file
            $dbmctl(ADD refnum "key" data)
                Insert a new key/data pair.  Fail if key already exists.
            $dbmctl(CHANGE refnum "key" data)
                If key already exists, change its data.  If it doesn't exist, 
                add it.
            $dbmctl(DELETE refnum "key")
                Remove a key/data pair
            $dbmctl(READ refnum "key")
                Return the data for a key.
            $dbmctl(NEXT_KEY refnum start-over)
                Return the next key in the database
            $dbmctl(ALL_KEYS refnum)
                Return all keys -- could be huge! could take a long time!
            $dbmctl(ERROR refnum)
                Return the errno for the last error.

        "Type" must always be "STD" for now.  Reserved for future expansion.
        "Filename" must be a filename that doesn't include the ".db" extension!
                This is a requirement of the DBM api, and not an epic thing.
        "Refnum" is the integer value returned by OPEN or OPEN_READ
        "Key" is a hash table key value
        "Data" is a hash table data value
        "Start-over" is 1 if you want to fetch the first key in the table, and
                is 0 if you want to fetch the next key.  You must call this
                with 1 before you call it with 0, according to the API.
        ALL_KEYS does a "start-over" and you need to do another "start-over"
                after using it.



while INSTALL says:


  o  On Linux, you _*-MUST-*_ install your system's "ncurses-devel" package
     or you won't be able to build epic.  You should install your system's
     "gdbm-devel" package or you won't have access to $dbmctl() (hash tables)


What are your thoughts? the egrep result is just this:

ng0@shadowwalker ~/re-src/epic5-2.0.1$ egrep -nr "gdbm"
UPDATES:2660:   is not compatable with ndbm or gdbm.
INSTALL:31:     "gdbm-devel" package or you won't have access to $dbmctl() (hash tables)


drop gdbm support? patch it in? make it propagated-input?
ng0 Dec. 6, 2016, 7:35 p.m. UTC | #5
Changes since the last patch (https://lists.gnu.org/archive/html/guix-devel/2016-10/msg00549.html):

* removed gdbm
* changed openssl to libressl (inline commented why)
* explicitly pointed the config to the tls implementation
* checked multiple networks for functionality, all work but...
... tls does not work when round robin of irc networks kick in.
It might be a bug with epic5 -> ircd being used. For me this is functional,
and I will get in contact with upstream developers (if they aren't using
something like github or gitlab these days) to investigate this problem.
epic5 is known to be difficult to configure, so I would not rule out an
error on my side (not the package) in my client config.

[PATCH] gnu: Add epic5.
diff mbox

Patch

diff --git a/gnu/packages/irc.scm b/gnu/packages/irc.scm
index db398de..f61afb4 100644
--- a/gnu/packages/irc.scm
+++ b/gnu/packages/irc.scm
@@ -32,9 +32,11 @@ 
   #:use-module (gnu packages autogen)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages base)
+  #:use-module (gnu packages backup)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages curl)
   #:use-module (gnu packages cyrus-sasl)
+  #:use-module (gnu packages databases)
   #:use-module (gnu packages file)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
@@ -47,6 +49,7 @@ 
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages ruby)
   #:use-module (gnu packages qt)
   #:use-module (gnu packages tcl)
   #:use-module (gnu packages tls)
@@ -329,3 +332,83 @@  and extensible with plugins and scripts.")
 embedded web server, translations (fr, fi, it, hu, de), and many
 other enhancements and bug fixes.")
     (license license:bsd-3)))
+
+(define-public epic5
+  (package
+    (name "epic5")
+    (version "2.0.1")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "http://ftp.epicsol.org/pub/epic/EPIC5-PRODUCTION/"
+                                  name "-" version ".tar.xz"))
+              (sha256
+               (base32
+                "1ap73d5f4vccxjaaq249zh981z85106vvqmxfm4plvy76b40y9jm"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:test-target "test"
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-perl
+           (lambda _
+             (substitute* "regress/crash-irc"
+               (("perl5") (which "perl")))))
+         (add-after 'unpack 'patch-bsdinstall
+           ;; If we just remove /bin/ some part of the bsdinstall breaks.
+           ;; Furthermore bsdinstalls has a reference to /etc/chmod here, which
+           ;; means if we leave /etc/ in, install fails.
+           (lambda _
+             (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")
+               (("/etc/") ""))))
+         (replace 'configure
+           (lambda* (#:key outputs #:allow-other-keys)
+             ;; The tarball uses a very old version of autconf. It doesn't
+             ;; understand extra flags like `--enable-fast-install', so
+             ;; we need to invoke it with just what it understands.
+             (let ((out (assoc-ref outputs "out")))
+               ;; 'configure' doesn't understand '--host'.
+               ,@(if (%current-target-system)
+                     `((setenv "CHOST" ,(%current-target-system)))
+                     '())
+               (setenv "CONFIG_SHELL" (which "bash"))
+               (setenv "SHELL" (which "bash"))
+               (zero?
+                (system* "./configure"
+                         (string-append "--prefix=" out)
+                         "--with-ipv6" "--with-libarchive"
+                         "--with-ssl"
+                         (string-append "--with-tcl="
+                                        (assoc-ref %build-inputs "tcl")
+                                        "/lib/tclConfig.sh")))))))))
+    (inputs
+     `(("openssl" ,openssl)
+       ("ncurses" ,ncurses)
+       ("libarchive" ,libarchive) ; CHANGELOG: "Support for loading zip files"
+       ("perl" ,perl)
+       ("tcl" ,tcl)
+       ("ruby" ,ruby)
+       ("gdbm" ,gdbm)))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)))
+    (home-page "http://epicsol.org")
+    (synopsis "Epic5 IRC Client")
+    (description
+     "EPIC is a IRC client that has been under active development for 20+ years
+in 5 generations.  It is stable and mature, and offers an excellent ircII
+interface for those of us who are accustomed to the ircII way of doing things.")
+    (license (list license:bsd-3
+                   license:isc
+                   license:bsd-4
+                   ;; The epic license is equal to the standard three-clause
+                   ;; BSD license except that you are not permitted to remove the
+                   ;; "Redistribution is permitted" clause of the license if you
+                   ;; distribute binaries.
+                   license:non-copyleft "http://epicsol.org/copyright"))))