Merge remote-tracking branch 'origin/master' into wip-texlive
[jackhill/guix/guix.git] / gnu / packages / wget.scm
CommitLineData
233e7676
LC
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
189be331 3;;; Copyright © 2014, 2015, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
f5e08f17 4;;; Copyright © 2016, 2017, 2019 Efraim Flashner <efraim@flashner.co.il>
afc43823 5;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
4d3990c9 6;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
da7b042d 7;;;
233e7676 8;;; This file is part of GNU Guix.
da7b042d 9;;;
233e7676 10;;; GNU Guix is free software; you can redistribute it and/or modify it
da7b042d
NK
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;;;
233e7676 15;;; GNU Guix is distributed in the hope that it will be useful, but
da7b042d
NK
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
233e7676 21;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
da7b042d 22
1ffa7090 23(define-module (gnu packages wget)
4a44e743 24 #:use-module (guix licenses)
c84c8f66 25 #:use-module (gnu packages)
afc43823
RH
26 #:use-module (gnu packages autotools)
27 #:use-module (gnu packages base)
6b88912e 28 #:use-module (gnu packages compression)
afc43823
RH
29 #:use-module (gnu packages documentation)
30 #:use-module (gnu packages flex)
31 #:use-module (gnu packages gettext)
32 #:use-module (gnu packages gnunet)
fb7bdb43 33 #:use-module (gnu packages libidn)
afc43823 34 #:use-module (gnu packages pcre)
e3873113 35 #:use-module (gnu packages perl)
6b9540bc 36 #:use-module (gnu packages pkg-config)
e3873113 37 #:use-module (gnu packages python)
a7fd7b68 38 #:use-module (gnu packages tls)
e3873113 39 #:use-module (gnu packages web)
08b00d38 40 #:use-module (gnu packages xdisorg)
da7b042d
NK
41 #:use-module (guix packages)
42 #:use-module (guix download)
afc43823 43 #:use-module (guix git-download)
da7b042d
NK
44 #:use-module (guix build-system gnu))
45
46(define-public wget
47 (package
48 (name "wget")
25cb591c 49 (version "1.20.3")
da7b042d
NK
50 (source
51 (origin
52 (method url-fetch)
53 (uri (string-append "mirror://gnu/wget/wget-"
6b88912e 54 version ".tar.lz"))
da7b042d
NK
55 (sha256
56 (base32
25cb591c 57 "1frajd86ds8vz2hprq30wq8ya89z9dcxnwm8nwk12bbc47l7qq39"))))
da7b042d
NK
58 (build-system gnu-build-system)
59 (inputs
fb7bdb43 60 `(("gnutls" ,gnutls)
dd2c73f6 61 ("libidn2" ,libidn2)
6b88912e
MB
62 ("libpsl" ,libpsl)
63 ("lzip" ,lzip)))
b5d4a811 64 (native-inputs
6b9540bc
LC
65 `(("pkg-config" ,pkg-config)
66 ("perl" ,perl)
fb7bdb43
EB
67 ("python" ,python) ;for testenv suite
68 ("perl-http-daemon" ,perl-http-daemon)
69 ("perl-io-socket-ssl" ,perl-io-socket-ssl)))
38eefbb1 70 (home-page "https://www.gnu.org/software/wget/")
f50d2669 71 (synopsis "Non-interactive command-line utility for downloading files")
da7b042d 72 (description
79c311b8 73 "GNU Wget is a non-interactive tool for fetching files using the HTTP,
e881752c 74HTTPS and FTP protocols. It can resume interrupted downloads, use file name
a22dc0c4
LC
75wild cards, supports proxies and cookies, and it can convert absolute links
76in downloaded documents to relative links.")
4a44e743 77 (license gpl3+))) ; some files are under GPLv2+
22486fbe
EF
78
79(define-public wgetpaste
80 (package
81 (name "wgetpaste")
710f0277 82 (version "2.29")
22486fbe
EF
83 (source
84 (origin
85 (method url-fetch)
86 (uri (string-append "http://wgetpaste.zlin.dk/wgetpaste-"
87 version ".tar.bz2"))
88 (sha256
89 (base32
710f0277 90 "1rp0wxr3zy7y2xp3azaadfghrx7g0m138f9qg6icjxkkz4vj9r22"))))
22486fbe
EF
91 (build-system gnu-build-system)
92 (arguments
710f0277 93 `(#:modules ((guix build gnu-build-system)
c8e214e8
TGR
94 (guix build utils)
95 (srfi srfi-1))
96 #:phases
22486fbe
EF
97 (modify-phases %standard-phases
98 (delete 'configure)
99 (delete 'build)
23499949
EF
100 (add-after 'unpack 'remove-dead-paste-site
101 ;; This phase is adaped from the following patch:
102 ;; https://gitweb.gentoo.org/repo/gentoo.git/tree/app-text/wgetpaste/files/wgetpaste-remove-dead.patch
103 (lambda _
104 (substitute* "wgetpaste"
710f0277 105 (("-bpaste") "-dpaste")) ; dpaste blocks tor users
23499949 106 #t))
22486fbe
EF
107 (replace 'install
108 (lambda* (#:key outputs #:allow-other-keys)
109 (let* ((out (assoc-ref outputs "out"))
110 (bin (string-append out "/bin"))
710f0277
EF
111 (zsh (string-append out "/share/zsh/site-functions"))
112 (doc (string-append out "/share/doc/" ,name "-" ,version)))
22486fbe 113 (install-file "wgetpaste" bin)
4d3990c9 114 (install-file "_wgetpaste" zsh)
710f0277 115 (install-file "LICENSE" doc)
c8e214e8
TGR
116 #t)))
117 (add-after 'install 'wrap-program
118 ;; /bin/wgetpaste prides itself on relying only on the following
119 ;; inputs, and doesn't need to execute arbitrary commands, so
120 ;; override PATH completely to detect any new dependencies early.
121 (lambda* (#:key outputs #:allow-other-keys)
122 (let ((out (assoc-ref outputs "out")))
123 (wrap-program (string-append out "/bin/wgetpaste")
124 `("PATH" ":" =
125 ,(delete-duplicates
126 (map (lambda (command) (dirname (which command)))
127 (list "bash" "mktemp" "sed" "sort" "tee" "tr"
08b00d38 128 "wget" "xclip")))))
4d3990c9 129 #t))))
7342923d
TGR
130 #:tests? #f)) ; no test target
131 (inputs
08b00d38
EF
132 `(("wget" ,wget)
133 ("xclip" ,xclip)))
22486fbe
EF
134 (home-page "http://wgetpaste.zlin.dk/")
135 (synopsis "Script that automates pasting to a number of pastebin services")
136 (description
137 "@code{wgetpaste} is an extremely simple command-line interface to various
138online pastebin services.")
139 (license public-domain)))
afc43823
RH
140
141(define-public wget2
142 (package
143 (name "wget2")
f5e08f17 144 (version "1.99.1")
afc43823 145 (source
f5e08f17
EF
146 (origin
147 (method git-fetch)
148 (uri (git-reference
149 (url "https://gitlab.com/gnuwget/wget2.git")
150 (commit (string-append name "-" version))
151 (recursive? #t))) ;; Needed for 'gnulib' git submodule.
152 (file-name (string-append name "-" version "-checkout"))
153 (sha256
154 (base32
155 "15wxsnjhc6bzk7f60i1djmsarh1w31gwi5h2gh9k19ncwypfj5dm"))))
afc43823
RH
156 (build-system gnu-build-system)
157 (arguments
f5e08f17
EF
158 `(#:phases
159 (modify-phases %standard-phases
160 (add-after 'unpack 'skip-network-test
161 (lambda _
162 (substitute* "tests/Makefile.am"
163 (("test-auth-digest\\$\\(EXEEXT)") ""))
164 #t))
165 (replace 'bootstrap
166 (lambda _
167 ;; Make sure all the files are writable so that ./bootstrap
168 ;; can proceed.
169 (for-each (lambda (file)
170 (chmod file #o755))
171 (find-files "."))
172 (patch-shebang "./gnulib/gnulib-tool.py")
173 ;; Remove unnecessary inputs from bootstrap.conf
174 (substitute* "bootstrap.conf"
175 (("flex.*") "")
176 (("makeinfo.*") "")
177 (("lzip.*") "")
178 (("rsync.*") ""))
179 (invoke "sh" "./bootstrap"
180 "--gnulib-srcdir=gnulib"
181 "--no-git"))))))
182 (inputs
183 `(("gnutls" ,gnutls/dane)
184 ("libiconv" ,libiconv)
185 ("libidn2" ,libidn2)
186 ("libmicrohttpd" ,libmicrohttpd)
187 ("libpsl" ,libpsl)
188 ("pcre2" ,pcre2)))
afc43823 189 ;; TODO: Add libbrotlidec, libnghttp2.
f5e08f17
EF
190 (native-inputs
191 `(("autoconf" ,autoconf)
192 ("automake" ,automake)
193 ("flex" ,flex)
194 ("gettext" ,gettext-minimal)
195 ("libtool" ,libtool)
196 ("pkg-config" ,pkg-config)
197 ("python" ,python-2)))
4b1ba80c 198 (home-page "https://gitlab.com/gnuwget/wget2")
afc43823
RH
199 (synopsis "Successor of GNU Wget")
200 (description "GNU Wget2 is the successor of GNU Wget, a file and recursive
201website downloader. Designed and written from scratch it wraps around libwget,
202that provides the basic functions needed by a web client.")
203 (license (list gpl3+ lgpl3+))))