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