Subject: Re: [bug#27468] [PATCH] gnu: Add linkchecker.

From: Arun Isaac <[email-masked]>
Date: Wed, 23 Aug 2017 12:56:14 +0530

Marius Bakke writes:

>> +       (modify-phases %standard-phases
>> +         ;; Remove faulty python-requests version check. This has been fixed
>> +         ;; upstream, and can be removed in version 9.4.
>> +         (add-after 'unpack 'remove-python-requests-version
>> +           (lambda _
>> +             (substitute* "linkcheck/__init__.py"
>> +               (("requests.__version__ <= '2.2.0'") "False")))))))
>
> Please end this phase on a #t since (substitute* ...) has an unspecified
> return value.

Done.

>> +    (license (list l:gpl2+
>> +                   l:bsd-2 ; linkcheck/better_exchook2.py
>> +                   l:bsd-3 ; linkcheck/colorama.py
>> +                   l:psfl  ; linkcheck/gzip2.py
>> +                   l:expat ; linkcheck/mem.py
>> +                   l:isc   ; third_party/dnspython
>> +                   l:asl2.0)))) ; third_party/miniboa
>
> Is it possible to remove these third party libraries and use packaged
> copies instead?  At least 'dnspython' is already in Guix.

linkchecker is using a modified version of dnspython and miniboa. So, I
don't think it will be easy. For a list of modifications, look at
https://github.com/wummel/linkchecker/blob/master/third_party/dnspython/changelog.txt
and https://github.com/wummel/linkchecker/blob/master/third_party/miniboa-r42/CHANGES.txt

> Also, since GPL2+ is stricter than the other licenses, the program as a
> whole is effectively GPL2+, so we don't really need to mention those
> one-off source files in the license field (but comments are great).

But, we generally don't hide this information from the user, right? Many
Guix packages have licenses of even single files mentioned in the
`license' field. Do you still think I should remove them?

> Not sure about the 3rd party bundles though, since they probably don't
> depend on anything from the GPL2+ distribution.  If they are installed,
> I guess we should mention them with a FIXME.

I've added a FIXME.

I'm attaching a new patch with the discussed changes. Do let me know if
everything looks good.

>From 63f4192ff8ed7341767797f4ca67ab87773e2338 Mon Sep 17 00:00:00 2001
From: Arun Isaac <[email-masked]>
Date: Sat, 24 Jun 2017 05:37:45 +0530
Subject: [PATCH] gnu: Add linkchecker.

* gnu/packages/web.scm (linkchecker): New variable.
---
 gnu/packages/web.scm | 44 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index 652eb6792..68a9c2302 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -4979,3 +4979,47 @@ websites lacking feeds.  Supported websites include Facebook, Twitter,
 Instagram and YouTube.")
     (license (list l:public-domain
                    l:expat)))) ;; vendor/simplehtmldom/simple_html_dom.php
+
+(define-public linkchecker
+  (package
+    (name "linkchecker")
+    (version "9.3")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "LinkChecker" version))
+       (sha256
+        (base32
+         "0v8pavf0bx33xnz1kwflv0r7lxxwj7vg3syxhy2wzza0wh6sc2pf"))))
+    (build-system python-build-system)
+    (inputs
+     `(("python2-dnspython" ,python2-dnspython)
+       ("python2-requests" ,python2-requests)))
+    (arguments
+     `(#:python ,python-2
+       #:phases
+       (modify-phases %standard-phases
+         ;; Remove faulty python-requests version check. This has been fixed
+         ;; upstream, and can be removed in version 9.4.
+         (add-after 'unpack 'remove-python-requests-version
+           (lambda _
+             (substitute* "linkcheck/__init__.py"
+               (("requests.__version__ <= '2.2.0'") "False"))
+             #t)))))
+    (home-page "https://linkcheck.github.io/linkchecker")
+    (synopsis "Check websites for broken links")
+    (description "LinkChecker is a website validator.  It checks for broken
+links in websites.  It is recursive and multithreaded providing output in
+colored or normal text, HTML, SQL, CSV, XML or as a sitemap graph.  It
+supports checking HTTP/1.1, HTTPS, FTP, mailto, news, nntp, telnet and local
+file links.")
+    (license (list l:gpl2+
+                   l:bsd-2 ; linkcheck/better_exchook2.py
+                   l:bsd-3 ; linkcheck/colorama.py
+                   l:psfl  ; linkcheck/gzip2.py
+                   l:expat ; linkcheck/mem.py
+                   ;; FIXME: Unbundle dnspython and miniboa
+                   ;; This issue has been raised upstream
+                   ;; https://github.com/wummel/linkchecker/issues/729
+                   l:isc   ; third_party/dnspython
+                   l:asl2.0)))) ; third_party/miniboa
-- 
2.13.4