Merge branch 'master' into staging
[jackhill/guix/guix.git] / gnu / packages / wget.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
3 ;;; Copyright © 2014, 2015, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
4 ;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
5 ;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
6 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
7 ;;;
8 ;;; This file is part of GNU Guix.
9 ;;;
10 ;;; GNU Guix is free software; you can redistribute it and/or modify it
11 ;;; under the terms of the GNU General Public License as published by
12 ;;; the Free Software Foundation; either version 3 of the License, or (at
13 ;;; your option) any later version.
14 ;;;
15 ;;; GNU Guix is distributed in the hope that it will be useful, but
16 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;;; GNU General Public License for more details.
19 ;;;
20 ;;; You should have received a copy of the GNU General Public License
21 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22
23 (define-module (gnu packages wget)
24 #:use-module (guix licenses)
25 #:use-module (gnu packages)
26 #:use-module (gnu packages autotools)
27 #:use-module (gnu packages base)
28 #:use-module (gnu packages compression)
29 #:use-module (gnu packages documentation)
30 #:use-module (gnu packages flex)
31 #:use-module (gnu packages gettext)
32 #:use-module (gnu packages gnunet)
33 #:use-module (gnu packages libidn)
34 #:use-module (gnu packages python)
35 #:use-module (gnu packages perl)
36 #:use-module (gnu packages web)
37 #:use-module (gnu packages pcre)
38 #:use-module (gnu packages pkg-config)
39 #:use-module (gnu packages tls)
40 #:use-module (guix packages)
41 #:use-module (guix download)
42 #:use-module (guix git-download)
43 #:use-module (guix build-system gnu))
44
45 (define-public wget
46 (package
47 (name "wget")
48 (version "1.20")
49 (source
50 (origin
51 (method url-fetch)
52 (uri (string-append "mirror://gnu/wget/wget-"
53 version ".tar.lz"))
54 (sha256
55 (base32
56 "07k8yd8rdn27x5fbzlnsz4db7z7qnisiqhs7r1b5wzy2b9b0zf5h"))))
57 (build-system gnu-build-system)
58 (arguments
59 '(#:phases (modify-phases %standard-phases
60 (add-before 'check 'disable-https-tests
61 (lambda _
62 ;; XXX: Skip TLS tests, which fail with "The
63 ;; certificate's owner does not match hostname" as
64 ;; reported at:
65 ;; <https://lists.gnu.org/archive/html/bug-wget/2017-07/msg00012.html>.
66 ;; The problem appears to be due to a change in GnuTLS
67 ;; 3.5.12, whereby 'gnutls_x509_crt_check_hostname2' no
68 ;; longer matches IP address against the 'CN' or
69 ;; 'DNSname' fields of certificates.
70 (substitute* "testenv/Makefile"
71 (("SSL_TESTS=1") ""))
72 #t)))))
73 (inputs
74 `(("gnutls" ,gnutls)
75 ("libidn2" ,libidn2)
76 ("libpsl" ,libpsl)
77 ("lzip" ,lzip)))
78 (native-inputs
79 `(("pkg-config" ,pkg-config)
80 ("perl" ,perl)
81 ("python" ,python) ;for testenv suite
82 ("perl-http-daemon" ,perl-http-daemon)
83 ("perl-io-socket-ssl" ,perl-io-socket-ssl)))
84 (home-page "https://www.gnu.org/software/wget/")
85 (synopsis "Non-interactive command-line utility for downloading files")
86 (description
87 "GNU Wget is a non-interactive tool for fetching files using the HTTP,
88 HTTPS and FTP protocols. It can resume interrupted downloads, use file name
89 wild cards, supports proxies and cookies, and it can convert absolute links
90 in downloaded documents to relative links.")
91 (license gpl3+))) ; some files are under GPLv2+
92
93 (define-public wgetpaste
94 (package
95 (name "wgetpaste")
96 (version "2.28")
97 (source
98 (origin
99 (method url-fetch)
100 (uri (string-append "http://wgetpaste.zlin.dk/wgetpaste-"
101 version ".tar.bz2"))
102 (sha256
103 (base32
104 "1hh9svyypqcvdg5mjxyyfzpdzhylhf7s7xq5dzglnm4injx3i3ak"))))
105 (build-system gnu-build-system)
106 (arguments
107 '(#:phases
108 (modify-phases %standard-phases
109 (delete 'configure)
110 (delete 'build)
111 (replace 'install
112 (lambda* (#:key outputs #:allow-other-keys)
113 (let* ((out (assoc-ref outputs "out"))
114 (bin (string-append out "/bin"))
115 (zsh (string-append out "/share/zsh/site-functions")))
116 (install-file "wgetpaste" bin)
117 (install-file "_wgetpaste" zsh)))))
118 #:tests? #f)) ; no test target
119 (home-page "http://wgetpaste.zlin.dk/")
120 (synopsis "Script that automates pasting to a number of pastebin services")
121 (description
122 "@code{wgetpaste} is an extremely simple command-line interface to various
123 online pastebin services.")
124 (license public-domain)))
125
126 (define-public wget2
127 (package
128 (name "wget2")
129 (version "1.0.0")
130 (source
131 (origin
132 (method git-fetch)
133 (uri (git-reference
134 (url "https://gitlab.com/gnuwget/wget2.git")
135 (commit "b45709d3d21714135ce79df6abbdcb704684063d")
136 (recursive? #t))) ;; Needed for 'gnulib' git submodule.
137 (file-name (string-append name "-" version "-checkout"))
138 (sha256
139 (base32
140 "0ww84wwzmpyylkz8rnb6nk6f7x040132z81x52w7rjhk68p9mm24"))))
141 (build-system gnu-build-system)
142 (arguments
143 `(#:phases (modify-phases %standard-phases
144 (replace 'bootstrap
145 (lambda _
146 ;; Make sure all the files are writable so that ./bootstrap
147 ;; can proceed.
148 (for-each (lambda (file)
149 (chmod file #o755))
150 (find-files "."))
151 (substitute* "./gnulib/gnulib-tool.py"
152 (("/usr/bin/python") (which "python3")))
153 (invoke "sh" "./bootstrap"
154 "--gnulib-srcdir=gnulib"
155 "--no-git"))))))
156 (inputs `(("autoconf" ,autoconf)
157 ("automake" ,automake)
158 ("doxygen" ,doxygen)
159 ("flex" ,flex)
160 ("gettext" ,gettext-minimal)
161 ("gnutls" ,gnutls/dane)
162 ("libiconv" ,libiconv)
163 ("libidn2" ,libidn2)
164 ("libmicrohttpd" ,libmicrohttpd)
165 ("libpsl" ,libpsl)
166 ("libtool" ,libtool)
167 ("pcre2" ,pcre2)
168 ("python" ,python)))
169 ;; TODO: Add libbrotlidec, libnghttp2.
170 (native-inputs `(("pkg-config" ,pkg-config)))
171 (home-page "https://gitlab.com/gnuwget/wget2")
172 (synopsis "Successor of GNU Wget")
173 (description "GNU Wget2 is the successor of GNU Wget, a file and recursive
174 website downloader. Designed and written from scratch it wraps around libwget,
175 that provides the basic functions needed by a web client.")
176 (license (list gpl3+ lgpl3+))))