unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* w3m: 'license'; error: redefinition of 'struct file_handle'
@ 2013-02-13  5:26 Nikita Karetnikov
  2013-02-13  5:50 ` Mark H Weaver
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Nikita Karetnikov @ 2013-02-13  5:26 UTC (permalink / raw)
  To: bug-guix


[-- Attachment #1.1: Type: text/plain, Size: 667 bytes --]

w3m raises the following error:

istream.h:23:8: error: redefinition of 'struct file_handle'

I found the needed patch [1].  But I don't want to apply it because it
requires a knowledge of C.  Could anyone help me to finalize the recipe?

Also, I'm not sure what license should be used.  Should we create a new
one?

This page [2] states that w3m is under MIT, which is an ambiguous name
of the Expat License [3].  However, the License paragraph in
'doc/README' doesn't look like Expat.

[1] https://bazaar.launchpad.net/~ubuntu-branches/ubuntu/precise/w3m/precise/revision/27
[2] http://sourceforge.net/projects/w3m/
[3] http://directory.fsf.org/wiki/License:Expat


[-- Attachment #1.2: w3m.scm --]
[-- Type: text/plain, Size: 2796 bytes --]

;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
;;;
;;; 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 w3m)
  ;; #:use-module ((guix licenses) #:select ())
  #:use-module ((gnu packages gettext)
                #:renamer (symbol-prefix-proc 'guix:))
  #:use-module (gnu packages bdw-gc)
  #:use-module (gnu packages compression)
  #:use-module (gnu packages ncurses)
  #:use-module (gnu packages openssl)
  #:use-module (gnu packages perl)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix build-system gnu))

(define-public w3m
  (package
    (name "w3m")
    (version "0.5.3")
    (source
     (origin
      (method url-fetch)
      (uri (string-append "mirror://sourceforge/w3m/w3m-"
                          version ".tar.gz"))
      (sha256
       (base32
        "1qx9f0kprf92r1wxl3sacykla0g04qsi0idypzz24b7xy9ix5579"))))
    (build-system gnu-build-system)
    (arguments `(#:tests? #f  ; no check target
                 #:phases (alist-cons-before
                           'configure 'fix-perl
                           (lambda _
                             (substitute* '("scripts/w3mmail.cgi.in"
                                            "scripts/dirlist.cgi.in")
                               (("@PERL@") (which "perl"))))
                           %standard-phases)))
    (inputs
     `(("gettext" ,guix:gettext)
       ("libgc" ,libgc)
       ("ncurses" ,ncurses)
       ("openssl" ,openssl)
       ("perl" ,perl)
       ("pkg-config" ,pkg-config)
       ("zlib" ,zlib)))
    (home-page "http://w3m.sourceforge.net/")
    (synopsis "w3m, a text-mode web browser")
    (description
     "w3m is a text-based web browser as well as a pager like 'more' or
'less'.  With w3m you can browse web pages through a terminal emulator
window.  Moreover, w3m can be used as a text formatting tool which
typesets HTML into plain text.")
    (license #f))) ; XXX: add 'license'

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: w3m: 'license'; error: redefinition of 'struct file_handle'
  2013-02-13  5:26 w3m: 'license'; error: redefinition of 'struct file_handle' Nikita Karetnikov
@ 2013-02-13  5:50 ` Mark H Weaver
  2013-02-13  6:57   ` Nikita Karetnikov
  2013-02-13  6:28 ` w3m: 'license'; error: redefinition of 'struct file_handle' Mark H Weaver
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 15+ messages in thread
From: Mark H Weaver @ 2013-02-13  5:50 UTC (permalink / raw)
  To: Nikita Karetnikov; +Cc: bug-guix

Nikita Karetnikov <nikita@karetnikov.org> writes:
> w3m raises the following error:
>
> istream.h:23:8: error: redefinition of 'struct file_handle'

The issue here is that glibc started using "struct file_handle", which
conflicts with w3m's prior use of the same name.  You shouldn't need a
patch for this.  Just replace "struct file_handle" with "struct
io_file_handle" everywhere in the w3m source code.  That will have no
effect on the operation of the program whatsoever.

     Mark

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: w3m: 'license'; error: redefinition of 'struct file_handle'
  2013-02-13  5:26 w3m: 'license'; error: redefinition of 'struct file_handle' Nikita Karetnikov
  2013-02-13  5:50 ` Mark H Weaver
@ 2013-02-13  6:28 ` Mark H Weaver
  2013-02-13 10:43   ` Andreas Enge
  2013-02-13 21:53 ` Ludovic Courtès
  2013-03-02 15:12 ` Ludovic Courtès
  3 siblings, 1 reply; 15+ messages in thread
From: Mark H Weaver @ 2013-02-13  6:28 UTC (permalink / raw)
  To: Nikita Karetnikov; +Cc: bug-guix

Nikita Karetnikov <nikita@karetnikov.org> writes:

> Also, I'm not sure what license should be used.  Should we create a new
> one?
>
> This page [2] states that w3m is under MIT, which is an ambiguous name
> of the Expat License [3].

That's incorrect.  While it is true that the Expat license is sometimes
ambiguously referred to as the MIT license, it does not follow that
everything called the MIT license is actually the Expat license.  Many
different licenses are ambiguously referred to as the MIT license.

In general, you cannot trust a project's web page or any README in a
source distribution.  The only truly reliable method is to look at the
copyright notices in every source file, but that's far too much work;
we'd never get anywhere if we did that.

The best practical resource I know of for this job are the Debian
copyright files, which are in /usr/share/doc/<PACKAGE_NAME>/copyright on
a Debian system.  They are also available by going to their web site:

  http://packages.debian.org/sid/<PACKAGE_NAME>

and then clicking on the "Copyright File" link in the right column.
Debian is more consistently thorough in their research on copyright
notices than anyone else I know of.  The main caveat is that these files
describe Debian's modified versions of the package, not upstream.  Most
notably, Debian may have removed code with objectionable licenses, and
thus those objectionable licenses may not appear in their copyright
files.  A useful marker for this case is when you see "dfsg" in the
binary package name (which most often means that GFDL-covered
documentation was removed).

Anyway, in the case of w3m, there are quite a variety of licenses used:

  http://packages.debian.org/changelogs/pool/main/w/w3m/w3m_0.5.3-8/w3m.copyright

I don't know how Ludovic wants to handle complex cases like this, so
I'll let him chime in here.

Thanks for your tireless efforts, Nikita!

     Mark

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: w3m: 'license'; error: redefinition of 'struct file_handle'
  2013-02-13  5:50 ` Mark H Weaver
@ 2013-02-13  6:57   ` Nikita Karetnikov
  2013-03-03 22:56     ` Cyril Roelandt
  0 siblings, 1 reply; 15+ messages in thread
From: Nikita Karetnikov @ 2013-02-13  6:57 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: bug-guix

[-- Attachment #1: Type: text/plain, Size: 1531 bytes --]

> Just replace "struct file_handle" with "struct io_file_handle"
> everywhere in the w3m source code.  That will have no effect on the
> operation of the program whatsoever.

I used the following:

    (arguments `(#:tests? #f ; no 'check' target
                 #:phases (alist-cons-before
                           'configure 'fix-perl-and-rename-file_handle
                           (lambda _
                             (substitute* '("scripts/w3mmail.cgi.in"
                                            "scripts/dirlist.cgi.in")
                               (("@PERL@") (which "perl")))
                             ;; https://launchpad.net/bugs/935540
                             ;; 'struct file_handle' is used by 'glibc'
                             (substitute* '("istream.c"
                                            "istream.h")
                               (("struct file_handle")
                                "struct io_file_handle")))
                           %standard-phases)))

But I guess that it's not enough because the 'build' phase failed:

main.c: In function 'main':
main.c:836:23: error: void value not ignored as it ought to be
main.c: In function 'getChar':
main.c:2264:5: warning: passing argument 1 of 'wtf_parse1' from incompatible pointer type [enabled by default]
In file included from fm.h:44:0,
                 from main.c:3:
./libwc/wtf.h:71:19: note: expected 'wc_uchar **' but argument is of type 'char **'
make: *** [main.o] Error 1
make: *** Waiting for unfinished jobs....

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: w3m: 'license'; error: redefinition of 'struct file_handle'
  2013-02-13  6:28 ` w3m: 'license'; error: redefinition of 'struct file_handle' Mark H Weaver
@ 2013-02-13 10:43   ` Andreas Enge
  2013-02-13 21:56     ` Ludovic Courtès
  0 siblings, 1 reply; 15+ messages in thread
From: Andreas Enge @ 2013-02-13 10:43 UTC (permalink / raw)
  To: bug-guix

[-- Attachment #1: Type: text/plain, Size: 1005 bytes --]

Am Mittwoch, 13. Februar 2013 schrieb Mark H Weaver:
> Anyway, in the case of w3m, there are quite a variety of licenses used:
> http://packages.debian.org/changelogs/pool/main/w/w3m/w3m_0.5.3-8/w3m.c
> opyright

It looks like essentially, a w3m license is used, with a little bit of X11 
interspersed for minor files. In this case, we usually put the main license 
into the corresponding package field with a guile comment concerning the 
other files.

Even more so, the content (if not the wording) of this w3m license is 
essentially X11. So maybe we need a license x11-style, modelled on bsd-
style?

Additionally, the file matrix.c looks non-free to me:
"3.  No charge is made for this software or works derived from it.  
      This clause shall not be construed as constraining other software
      distributed on the same medium as this software, nor is a
      distribution fee considered a charge."

So maybe it needs to be patched out, if possible? How come debian contains 
the file?

Andreas

[-- Attachment #2: Type: text/html, Size: 3954 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: w3m: 'license'; error: redefinition of 'struct file_handle'
  2013-02-13  5:26 w3m: 'license'; error: redefinition of 'struct file_handle' Nikita Karetnikov
  2013-02-13  5:50 ` Mark H Weaver
  2013-02-13  6:28 ` w3m: 'license'; error: redefinition of 'struct file_handle' Mark H Weaver
@ 2013-02-13 21:53 ` Ludovic Courtès
  2013-03-02 15:12 ` Ludovic Courtès
  3 siblings, 0 replies; 15+ messages in thread
From: Ludovic Courtès @ 2013-02-13 21:53 UTC (permalink / raw)
  To: Nikita Karetnikov; +Cc: bug-guix

Nikita Karetnikov <nikita@karetnikov.org> skribis:

> w3m raises the following error:
>
> istream.h:23:8: error: redefinition of 'struct file_handle'
>
> I found the needed patch [1].  But I don't want to apply it because it
> requires a knowledge of C.  Could anyone help me to finalize the recipe?

The patch is just a matter of renaming ‘file_handle’ to something else:

  http://patch-tracker.debian.org/patch/series/view/w3m/0.5.3-8/070_glibc2.14.patch

So I think this should work:

  (substitute* '("istream.c" "istream.h")
    (("struct[[:blank:]]+file_handle")
     "struct w3m_file_handle"))

> Also, I'm not sure what license should be used.  Should we create a new
> one?
>
> This page [2] states that w3m is under MIT, which is an ambiguous name
> of the Expat License [3].  However, the License paragraph in
> 'doc/README' doesn't look like Expat.

Yeah, it’s not exactly X11 either.

Hmm, dunno, maybe make it x11 or expat with a comment pointing to
doc/README?

Ludo’.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: w3m: 'license'; error: redefinition of 'struct file_handle'
  2013-02-13 10:43   ` Andreas Enge
@ 2013-02-13 21:56     ` Ludovic Courtès
  2013-02-14  3:20       ` Mark H Weaver
  2013-02-15  6:43       ` Mark H Weaver
  0 siblings, 2 replies; 15+ messages in thread
From: Ludovic Courtès @ 2013-02-13 21:56 UTC (permalink / raw)
  To: Andreas Enge; +Cc: bug-guix

Andreas Enge <andreas@enge.fr> skribis:

> Am Mittwoch, 13. Februar 2013 schrieb Mark H Weaver:
>> Anyway, in the case of w3m, there are quite a variety of licenses used:
>> http://packages.debian.org/changelogs/pool/main/w/w3m/w3m_0.5.3-8/w3m.c
>> opyright
>
> It looks like essentially, a w3m license is used, with a little bit of X11 
> interspersed for minor files. In this case, we usually put the main license 
> into the corresponding package field with a guile comment concerning the 
> other files.

Yes, agreed.

It’s true that we don’t keep a detailed list of files and associated
copyright like Debian does.

> Even more so, the content (if not the wording) of this w3m license is 
> essentially X11. So maybe we need a license x11-style, modelled on bsd-
> style?

I think so.

> Additionally, the file matrix.c looks non-free to me:
> "3.  No charge is made for this software or works derived from it.  
>       This clause shall not be construed as constraining other software
>       distributed on the same medium as this software, nor is a
>       distribution fee considered a charge."
>
> So maybe it needs to be patched out, if possible? How come debian contains 
> the file?

It’s not in http://libreplanet.org/wiki/Software_blacklist so I guess
it’s a question for the gnu-linux-libre mailing list.  Any volunteer?
:-)

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: w3m: 'license'; error: redefinition of 'struct file_handle'
  2013-02-13 21:56     ` Ludovic Courtès
@ 2013-02-14  3:20       ` Mark H Weaver
  2013-02-15  6:43       ` Mark H Weaver
  1 sibling, 0 replies; 15+ messages in thread
From: Mark H Weaver @ 2013-02-14  3:20 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: bug-guix

ludo@gnu.org (Ludovic Courtès) writes:

> Andreas Enge <andreas@enge.fr> skribis:
>
>> Additionally, the file matrix.c looks non-free to me:
>> "3.  No charge is made for this software or works derived from it.  
>>       This clause shall not be construed as constraining other software
>>       distributed on the same medium as this software, nor is a
>>       distribution fee considered a charge."
>>
>> So maybe it needs to be patched out, if possible? How come debian contains 
>> the file?
>
> It’s not in http://libreplanet.org/wiki/Software_blacklist so I guess
> it’s a question for the gnu-linux-libre mailing list.  Any volunteer?

I'll ask RMS and report back.  The only reason I'm not certain it's
non-free is because of the words "nor is a distribution fee considered a
charge."

   Thanks,
     Mark

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: w3m: 'license'; error: redefinition of 'struct file_handle'
  2013-02-13 21:56     ` Ludovic Courtès
  2013-02-14  3:20       ` Mark H Weaver
@ 2013-02-15  6:43       ` Mark H Weaver
  2013-02-15 14:38         ` Ludovic Courtès
  1 sibling, 1 reply; 15+ messages in thread
From: Mark H Weaver @ 2013-02-15  6:43 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: bug-guix

ludo@gnu.org (Ludovic Courtès) writes:

> Andreas Enge <andreas@enge.fr> skribis:
>
>> Additionally, the file matrix.c looks non-free to me:
>> "3.  No charge is made for this software or works derived from it.  
>>       This clause shall not be construed as constraining other software
>>       distributed on the same medium as this software, nor is a
>>       distribution fee considered a charge."
>>
>> So maybe it needs to be patched out, if possible? How come debian contains 
>> the file?
>
> It’s not in http://libreplanet.org/wiki/Software_blacklist so I guess
> it’s a question for the gnu-linux-libre mailing list.  Any volunteer?

I asked RMS, and he thinks that this clause is okay because it says a
"distribution fee" is okay and does not limit the amount.  Thus, what it
prohibits is a fee for the right to use the program, which is okay.

He was actually slightly more concerned about whether it allowed
distribution of modified versions:

  Everyone is granted permission to copy, modify and redistribute

Overall, he said that with its most natural intepretation, it is a free
software license, but that it is not clear.  He asked me to attempt to
contact the library authors for clarification, but in the meantime I
think we can consider this license acceptable.

Apologies for paraphrasing RMS rather than quoting him directly, but I
forgot to ask whether it was okay to publish what he wrote in private
email.

     Mark

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: w3m: 'license'; error: redefinition of 'struct file_handle'
  2013-02-15  6:43       ` Mark H Weaver
@ 2013-02-15 14:38         ` Ludovic Courtès
  2013-02-15 19:59           ` Mark H Weaver
  0 siblings, 1 reply; 15+ messages in thread
From: Ludovic Courtès @ 2013-02-15 14:38 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: bug-guix

Mark H Weaver <mhw@netris.org> skribis:

> ludo@gnu.org (Ludovic Courtès) writes:
>
>> Andreas Enge <andreas@enge.fr> skribis:
>>
>>> Additionally, the file matrix.c looks non-free to me:
>>> "3.  No charge is made for this software or works derived from it.  
>>>       This clause shall not be construed as constraining other software
>>>       distributed on the same medium as this software, nor is a
>>>       distribution fee considered a charge."
>>>
>>> So maybe it needs to be patched out, if possible? How come debian contains 
>>> the file?
>>
>> It’s not in http://libreplanet.org/wiki/Software_blacklist so I guess
>> it’s a question for the gnu-linux-libre mailing list.  Any volunteer?
>
> I asked RMS, and he thinks that this clause is okay because it says a
> "distribution fee" is okay and does not limit the amount.  Thus, what it
> prohibits is a fee for the right to use the program, which is okay.

Great, thanks for investigating.

> Apologies for paraphrasing RMS rather than quoting him directly, but I
> forgot to ask whether it was okay to publish what he wrote in private
> email.

In the future I think it’s better if we work with the gnu-linux-libre
list, where there are knowledgeable people lurking (from gNewSense,
Trisquel, etc.), as it would allow us to share efforts with them (and
vice versa ;-)).

Thanks!

Ludo’.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: w3m: 'license'; error: redefinition of 'struct file_handle'
  2013-02-15 14:38         ` Ludovic Courtès
@ 2013-02-15 19:59           ` Mark H Weaver
  0 siblings, 0 replies; 15+ messages in thread
From: Mark H Weaver @ 2013-02-15 19:59 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: bug-guix

ludo@gnu.org (Ludovic Courtès) writes:

> Mark H Weaver <mhw@netris.org> skribis:
>
>> I asked RMS, and he thinks that this clause is okay because it says a
>> "distribution fee" is okay and does not limit the amount.  Thus, what it
>> prohibits is a fee for the right to use the program, which is okay.
>
> Great, thanks for investigating.
>
>> Apologies for paraphrasing RMS rather than quoting him directly, but I
>> forgot to ask whether it was okay to publish what he wrote in private
>> email.
>
> In the future I think it’s better if we work with the gnu-linux-libre
> list, where there are knowledgeable people lurking (from gNewSense,
> Trisquel, etc.), as it would allow us to share efforts with them (and
> vice versa ;-)).

I did not intend to preempt that suggestion, but rather to augment it.
I wanted to know RMS's opinion, but I want to hear the opinions of other
knowledgeable people as well.  Any volunteers to raise this question on
the gnu-linux-libre list?

Still, until we hear otherwise, I think we can tentatively assume that
the license is okay, and proceed with the w3m packaging.

      Mark

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: w3m: 'license'; error: redefinition of 'struct file_handle'
  2013-02-13  5:26 w3m: 'license'; error: redefinition of 'struct file_handle' Nikita Karetnikov
                   ` (2 preceding siblings ...)
  2013-02-13 21:53 ` Ludovic Courtès
@ 2013-03-02 15:12 ` Ludovic Courtès
  3 siblings, 0 replies; 15+ messages in thread
From: Ludovic Courtès @ 2013-03-02 15:12 UTC (permalink / raw)
  To: Nikita Karetnikov; +Cc: bug-guix

Hello!

I think the w3m package was almost ready.  Is there anything blocking left?
Otherwise, feel free to push.  :-)

Ludo’.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: w3m: 'license'; error: redefinition of 'struct file_handle'
  2013-02-13  6:57   ` Nikita Karetnikov
@ 2013-03-03 22:56     ` Cyril Roelandt
  2013-03-04  5:34       ` [PATCH] gnu: Add w3m. (was: w3m: 'license'; error: redefinition of 'struct file_handle') Nikita Karetnikov
  0 siblings, 1 reply; 15+ messages in thread
From: Cyril Roelandt @ 2013-03-03 22:56 UTC (permalink / raw)
  To: Nikita Karetnikov; +Cc: bug-guix

[-- Attachment #1: Type: text/plain, Size: 1769 bytes --]

On 02/13/2013 07:57 AM, Nikita Karetnikov wrote:
>> Just replace "struct file_handle" with "struct io_file_handle"
>> everywhere in the w3m source code.  That will have no effect on the
>> operation of the program whatsoever.
>
> I used the following:
>
>      (arguments `(#:tests? #f ; no 'check' target
>                   #:phases (alist-cons-before
>                             'configure 'fix-perl-and-rename-file_handle
>                             (lambda _
>                               (substitute* '("scripts/w3mmail.cgi.in"
>                                              "scripts/dirlist.cgi.in")
>                                 (("@PERL@") (which "perl")))
>                               ;; https://launchpad.net/bugs/935540
>                               ;; 'struct file_handle' is used by 'glibc'
>                               (substitute* '("istream.c"
>                                              "istream.h")
>                                 (("struct file_handle")
>                                  "struct io_file_handle")))
>                             %standard-phases)))
>
> But I guess that it's not enough because the 'build' phase failed:
>
> main.c: In function 'main':
> main.c:836:23: error: void value not ignored as it ought to be
> main.c: In function 'getChar':
> main.c:2264:5: warning: passing argument 1 of 'wtf_parse1' from incompatible pointer type [enabled by default]
> In file included from fm.h:44:0,
>                   from main.c:3:
> ./libwc/wtf.h:71:19: note: expected 'wc_uchar **' but argument is of type 'char **'
> make: *** [main.o] Error 1
> make: *** Waiting for unfinished jobs....

This is a known issue: https://bugs.archlinux.org/task/33397 . The 
attached files make w3m buildable.

WBR,
Cyril.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: w3m.scm --]
[-- Type: text/x-scheme; name="w3m.scm", Size: 3342 bytes --]

;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
;;;
;;; 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 w3m)
  ;; #:use-module ((guix licenses) #:select ())
  #:use-module ((gnu packages gettext)
                #:renamer (symbol-prefix-proc 'guix:))
  #:use-module (gnu packages bdw-gc)
  #:use-module (gnu packages compression)
  #:use-module (gnu packages ncurses)
  #:use-module (gnu packages openssl)
  #:use-module (gnu packages perl)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix build-system gnu))

(define-public w3m
  (package
    (name "w3m")
    (version "0.5.3")
    (source
     (origin
      (method url-fetch)
      (uri (string-append "mirror://sourceforge/w3m/w3m-"
                          version ".tar.gz"))
      (sha256
       (base32
        "1qx9f0kprf92r1wxl3sacykla0g04qsi0idypzz24b7xy9ix5579"))))
    (build-system gnu-build-system)
    (arguments `(#:tests? #f  ; no check target
                 #:phases (alist-cons-before
                           'configure 'fix-perl
                           (lambda _
                             ;; https://launchpad.net/bugs/935540
                             ;; 'struct file_handle' is used by 'glibc'
                             (substitute* '("istream.c" "istream.h")
                              (("struct[[:blank:]]+file_handle")
                               "struct w3m_file_handle"))
                             (substitute* '("scripts/w3mmail.cgi.in"
                                            "scripts/dirlist.cgi.in")
                               (("@PERL@") (which "perl"))))
                           %standard-phases)
                 ;; cf. https://bugs.archlinux.org/task/33397
                 #:patches (list (assoc-ref %build-inputs
                                   "patch/fix-compile"))
                 #:patch-flags '("-p0")))
    (inputs
     `(("gettext" ,guix:gettext)
       ("libgc" ,libgc)
       ("ncurses" ,ncurses)
       ("openssl" ,openssl)
       ("perl" ,perl)
       ("pkg-config" ,pkg-config)
       ("zlib" ,zlib)
       ("patch/fix-compile" ,(search-patch "w3m-fix-compile.patch"))))
    (home-page "http://w3m.sourceforge.net/")
    (synopsis "w3m, a text-mode web browser")
    (description
     "w3m is a text-based web browser as well as a pager like 'more' or
'less'.  With w3m you can browse web pages through a terminal emulator
window.  Moreover, w3m can be used as a text formatting tool which
typesets HTML into plain text.")
    (license #f))) ; XXX: add 'license'

[-- Attachment #3: w3m-fix-compile.patch --]
[-- Type: text/x-diff, Size: 415 bytes --]

diff -aur old/main.c new/main.c
--- main.c	2013-01-14 18:16:14.216210053 -0600
+++ main.c	2013-01-14 18:17:28.816220559 -0600
@@ -833,7 +833,8 @@
     mySignal(SIGPIPE, SigPipe);
 #endif
 
-    orig_GC_warn_proc = GC_set_warn_proc(wrap_GC_warn_proc);
+    orig_GC_warn_proc = GC_get_warn_proc();
+    GC_set_warn_proc(wrap_GC_warn_proc);
     err_msg = Strnew();
     if (load_argc == 0) {
 	/* no URL specified */

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH] gnu: Add w3m. (was: w3m: 'license'; error: redefinition of 'struct file_handle')
  2013-03-03 22:56     ` Cyril Roelandt
@ 2013-03-04  5:34       ` Nikita Karetnikov
  2013-03-04 10:09         ` [PATCH] gnu: Add w3m Ludovic Courtès
  0 siblings, 1 reply; 15+ messages in thread
From: Nikita Karetnikov @ 2013-03-04  5:34 UTC (permalink / raw)
  To: Cyril Roelandt; +Cc: bug-guix


[-- Attachment #1.1: Type: text/plain, Size: 150 bytes --]

> This is a known issue: https://bugs.archlinux.org/task/33397 . The
> attached files make w3m buildable.

Thanks.

Can I push the attached patches?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-licenses-Add-x11-style.patch --]
[-- Type: text/x-diff, Size: 1385 bytes --]

From a64f68c566760503ad46660e9a5e3de7b3a61c7a Mon Sep 17 00:00:00 2001
From: Nikita Karetnikov <nikita@karetnikov.org>
Date: Mon, 4 Mar 2013 01:08:24 +0000
Subject: [PATCH] licenses: Add 'x11-style'.

* guix/licenses.scm (x11-style): New variable.
---
 guix/licenses.scm |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/guix/licenses.scm b/guix/licenses.scm
index 4e4aee2..9c4e177 100644
--- a/guix/licenses.scm
+++ b/guix/licenses.scm
@@ -39,7 +39,7 @@
             psfl public-domain
             qpl
             vim
-            x11
+            x11 x11-style
             zlib
             fsf-free))
 
@@ -236,6 +236,16 @@ which may be a file:// URI pointing the package's tree."
            "http://directory.fsf.org/wiki/License:X11"
            "https://www.gnu.org/licenses/license-list#X11License"))
 
+(define* (x11-style uri #:optional (comment ""))
+  "Return an X11-style license, whose full text can be found at URI,
+which may be a file:// URI pointing the package's tree."
+  (license "X11-style"
+           uri
+           (string-append
+            "This is an X11-style, non-copyleft free software license.  "
+            "Check the URI for details.  "
+            comment)))
+
 (define zlib
   (license "Zlib"
            "http://www.gzip.org/zlib/zlib_license.html"
-- 
1.7.5.4


[-- Attachment #1.3: 0001-gnu-Add-w3m.patch --]
[-- Type: text/x-diff, Size: 6034 bytes --]

From 35a43e4b84487ec574c111254f8b0dfe61014f32 Mon Sep 17 00:00:00 2001
From: Nikita Karetnikov <nikita@karetnikov.org>
Date: Mon, 4 Mar 2013 01:34:13 +0000
Subject: [PATCH] gnu: Add w3m.

* gnu/packages/w3m.scm,
  gnu/packages/patches/w3m-fix-compile.patch: New files.
* Makefile.am (MODULES): Add 'w3m.scm'.
  (dist_patch_DATA): Add 'w3m-fix-compile.patch'.
---
 Makefile.am                                |    4 +-
 gnu/packages/patches/w3m-fix-compile.patch |   15 +++++
 gnu/packages/w3m.scm                       |   81 ++++++++++++++++++++++++++++
 3 files changed, 99 insertions(+), 1 deletions(-)
 create mode 100644 gnu/packages/patches/w3m-fix-compile.patch
 create mode 100644 gnu/packages/w3m.scm

diff --git a/Makefile.am b/Makefile.am
index b70349a..6b111d2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -159,6 +159,7 @@ MODULES =					\
   gnu/packages/tor.scm				\
   gnu/packages/vim.scm 				\
   gnu/packages/vpn.scm				\
+  gnu/packages/w3m.scm				\
   gnu/packages/wdiff.scm			\
   gnu/packages/wget.scm				\
   gnu/packages/which.scm			\
@@ -217,7 +218,8 @@ dist_patch_DATA =						\
   gnu/packages/patches/tar-gets-undeclared.patch		\
   gnu/packages/patches/tcsh-fix-autotest.patch 			\
   gnu/packages/patches/teckit-cstdio.patch			\
-  gnu/packages/patches/vpnc-script.patch
+  gnu/packages/patches/vpnc-script.patch			\
+  gnu/packages/patches/w3m-fix-compile.patch
 
 bootstrapdir = $(guilemoduledir)/gnu/packages/bootstrap
 bootstrap_x86_64_linuxdir = $(bootstrapdir)/x86_64-linux
diff --git a/gnu/packages/patches/w3m-fix-compile.patch b/gnu/packages/patches/w3m-fix-compile.patch
new file mode 100644
index 0000000..650a32b
--- /dev/null
+++ b/gnu/packages/patches/w3m-fix-compile.patch
@@ -0,0 +1,15 @@
+https://bugs.archlinux.org/task/33397
+
+diff -aur old/main.c new/main.c
+--- main.c	2013-01-14 18:16:14.216210053 -0600
++++ main.c	2013-01-14 18:17:28.816220559 -0600
+@@ -833,7 +833,8 @@
+     mySignal(SIGPIPE, SigPipe);
+ #endif
+ 
+-    orig_GC_warn_proc = GC_set_warn_proc(wrap_GC_warn_proc);
++    orig_GC_warn_proc = GC_get_warn_proc();
++    GC_set_warn_proc(wrap_GC_warn_proc);
+     err_msg = Strnew();
+     if (load_argc == 0) {
+ 	/* no URL specified */
diff --git a/gnu/packages/w3m.scm b/gnu/packages/w3m.scm
new file mode 100644
index 0000000..9199cbd
--- /dev/null
+++ b/gnu/packages/w3m.scm
@@ -0,0 +1,81 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
+;;;
+;;; 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 w3m)
+  #:use-module ((guix licenses) #:select (x11-style))
+  #:use-module ((gnu packages gettext)
+                #:renamer (symbol-prefix-proc 'guix:))
+  #:use-module (gnu packages bdw-gc)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages ncurses)
+  #:use-module (gnu packages openssl)
+  #:use-module (gnu packages perl)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages)
+  #:use-module (guix packages)
+  #:use-module (guix download)
+  #:use-module (guix build-system gnu))
+
+(define-public w3m
+  (package
+    (name "w3m")
+    (version "0.5.3")
+    (source
+     (origin
+      (method url-fetch)
+      (uri (string-append "mirror://sourceforge/w3m/w3m-"
+                          version ".tar.gz"))
+      (sha256
+       (base32
+        "1qx9f0kprf92r1wxl3sacykla0g04qsi0idypzz24b7xy9ix5579"))))
+    (build-system gnu-build-system)
+    (arguments `(#:tests? #f  ; no check target
+                 #:phases (alist-cons-before
+                           'configure 'fix-perl
+                           (lambda _
+                             ;; https://launchpad.net/bugs/935540
+                             ;; 'struct file_handle' is used by 'glibc'
+                             (substitute* '("istream.c" "istream.h")
+                              (("struct[[:blank:]]+file_handle")
+                               "struct w3m_file_handle"))
+                             (substitute* '("scripts/w3mmail.cgi.in"
+                                            "scripts/dirlist.cgi.in")
+                               (("@PERL@") (which "perl"))))
+                           %standard-phases)
+                 ;; cf. https://bugs.archlinux.org/task/33397
+                 #:patches (list (assoc-ref %build-inputs
+                                            "patch/fix-compile"))
+                 #:patch-flags '("-p0")))
+    (inputs
+     `(("gettext" ,guix:gettext)
+       ("libgc" ,libgc)
+       ("ncurses" ,ncurses)
+       ("openssl" ,openssl)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("zlib" ,zlib)
+       ("patch/fix-compile" ,(search-patch "w3m-fix-compile.patch"))))
+    (home-page "http://w3m.sourceforge.net/")
+    (synopsis "w3m, a text-mode web browser")
+    (description
+     "w3m is a text-based web browser as well as a pager like 'more' or
+'less'.  With w3m you can browse web pages through a terminal emulator
+window.  Moreover, w3m can be used as a text formatting tool which
+typesets HTML into plain text.")
+    (license (x11-style "file://doc/README"
+                        "See 'doc/README' in the distribution."))))
-- 
1.7.5.4


[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH] gnu: Add w3m.
  2013-03-04  5:34       ` [PATCH] gnu: Add w3m. (was: w3m: 'license'; error: redefinition of 'struct file_handle') Nikita Karetnikov
@ 2013-03-04 10:09         ` Ludovic Courtès
  0 siblings, 0 replies; 15+ messages in thread
From: Ludovic Courtès @ 2013-03-04 10:09 UTC (permalink / raw)
  To: Nikita Karetnikov; +Cc: bug-guix

Nikita Karetnikov <nikita@karetnikov.org> skribis:

>> This is a known issue: https://bugs.archlinux.org/task/33397 . The
>> attached files make w3m buildable.
>
> Thanks.
>
> Can I push the attached patches?

Yes please.  Thanks to both of you!

Ludo’.

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2013-03-04 10:09 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-13  5:26 w3m: 'license'; error: redefinition of 'struct file_handle' Nikita Karetnikov
2013-02-13  5:50 ` Mark H Weaver
2013-02-13  6:57   ` Nikita Karetnikov
2013-03-03 22:56     ` Cyril Roelandt
2013-03-04  5:34       ` [PATCH] gnu: Add w3m. (was: w3m: 'license'; error: redefinition of 'struct file_handle') Nikita Karetnikov
2013-03-04 10:09         ` [PATCH] gnu: Add w3m Ludovic Courtès
2013-02-13  6:28 ` w3m: 'license'; error: redefinition of 'struct file_handle' Mark H Weaver
2013-02-13 10:43   ` Andreas Enge
2013-02-13 21:56     ` Ludovic Courtès
2013-02-14  3:20       ` Mark H Weaver
2013-02-15  6:43       ` Mark H Weaver
2013-02-15 14:38         ` Ludovic Courtès
2013-02-15 19:59           ` Mark H Weaver
2013-02-13 21:53 ` Ludovic Courtès
2013-03-02 15:12 ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).