gnu: icecat: Update to 78.10.0-guix0-preview1 [security fixes].
[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, 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
5 ;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
6 ;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
7 ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
8 ;;;
9 ;;; This file is part of GNU Guix.
10 ;;;
11 ;;; GNU Guix is free software; you can redistribute it and/or modify it
12 ;;; under the terms of the GNU General Public License as published by
13 ;;; the Free Software Foundation; either version 3 of the License, or (at
14 ;;; your option) any later version.
15 ;;;
16 ;;; GNU Guix is distributed in the hope that it will be useful, but
17 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;;; GNU General Public License for more details.
20 ;;;
21 ;;; You should have received a copy of the GNU General Public License
22 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23
24 (define-module (gnu packages wget)
25 #:use-module ((guix licenses) #:prefix license:)
26 #:use-module (gnu packages)
27 #:use-module (gnu packages base)
28 #:use-module (gnu packages compression)
29 #:use-module (gnu packages documentation)
30 #:use-module (gnu packages gnunet)
31 #:use-module (gnu packages gnupg)
32 #:use-module (gnu packages libidn)
33 #:use-module (gnu packages pcre)
34 #:use-module (gnu packages perl)
35 #:use-module (gnu packages pkg-config)
36 #:use-module (gnu packages python)
37 #:use-module (gnu packages tls)
38 #:use-module (gnu packages web)
39 #:use-module (gnu packages xdisorg)
40 #:use-module (guix packages)
41 #:use-module (guix download)
42 #:use-module (guix build-system gnu))
43
44 (define-public wget
45 (package
46 (name "wget")
47 (version "1.20.3")
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 "1frajd86ds8vz2hprq30wq8ya89z9dcxnwm8nwk12bbc47l7qq39"))))
56 (build-system gnu-build-system)
57 (inputs
58 `(("gnutls" ,gnutls)
59 ("libidn2" ,libidn2)
60 ("libpsl" ,libpsl)))
61 (native-inputs
62 `(("lzip" ,lzip)
63 ("pkg-config" ,pkg-config)
64 ("perl" ,perl)
65 ("python" ,python) ;for testenv suite
66 ("perl-http-daemon" ,perl-http-daemon)
67 ("perl-io-socket-ssl" ,perl-io-socket-ssl)))
68 (home-page "https://www.gnu.org/software/wget/")
69 (synopsis "Non-interactive command-line utility for downloading files")
70 (description
71 "GNU Wget is a non-interactive tool for fetching files using the HTTP,
72 HTTPS and FTP protocols. It can resume interrupted downloads, use file name
73 wild cards, supports proxies and cookies, and it can convert absolute links
74 in downloaded documents to relative links.")
75 (license license:gpl3+))) ; some files are under GPLv2+
76
77 (define-public wgetpaste
78 (package
79 (name "wgetpaste")
80 (version "2.30")
81 (source
82 (origin
83 (method url-fetch)
84 (uri (string-append "https://wgetpaste.zlin.dk/wgetpaste-"
85 version ".tar.bz2"))
86 (sha256
87 (base32 "14k5i6j6f34hcf9gdb9cnvfwscn0ys2dgd73ci421wj9zzqkbv73"))
88 (patches (search-patches "wgetpaste-update-bpaste.patch"))))
89 (build-system gnu-build-system)
90 (arguments
91 `(#:modules ((guix build gnu-build-system)
92 (guix build utils)
93 (srfi srfi-1))
94 #:phases
95 (modify-phases %standard-phases
96 (delete 'configure)
97 (delete 'build)
98 (add-after 'unpack 'change-unfriendly-default
99 (lambda _
100 (substitute* "wgetpaste"
101 ;; dpaste blocks Tor users. Use a better default.
102 (("DEFAULT_SERVICE:-dpaste")
103 "DEFAULT_SERVICE-bpaste"))
104 #t))
105 (replace 'install
106 (lambda* (#:key outputs #:allow-other-keys)
107 (let* ((out (assoc-ref outputs "out"))
108 (bin (string-append out "/bin"))
109 (zsh (string-append out "/share/zsh/site-functions"))
110 (doc (string-append out "/share/doc/" ,name "-" ,version)))
111 (install-file "wgetpaste" bin)
112 (install-file "_wgetpaste" zsh)
113 (install-file "LICENSE" doc)
114 #t)))
115 (add-after 'install 'wrap-program
116 ;; /bin/wgetpaste prides itself on relying only on the following
117 ;; inputs, and doesn't need to execute arbitrary commands, so
118 ;; override PATH completely to detect any new dependencies early.
119 (lambda* (#:key outputs #:allow-other-keys)
120 (let ((out (assoc-ref outputs "out")))
121 (wrap-program (string-append out "/bin/wgetpaste")
122 `("PATH" ":" =
123 ,(delete-duplicates
124 (map (lambda (command) (dirname (which command)))
125 (list "bash" "mktemp" "sed" "sort" "tee" "tr"
126 "wget" "xclip")))))
127 #t))))
128 #:tests? #f)) ; no test target
129 (inputs
130 `(("wget" ,wget)
131 ("xclip" ,xclip)))
132 (home-page "https://wgetpaste.zlin.dk/")
133 (synopsis "Script that automates pasting to a number of pastebin services")
134 (description
135 "@code{wgetpaste} is an extremely simple command-line interface to various
136 online pastebin services.")
137 (license license:expat)))
138
139 (define-public wget2
140 (package
141 (name "wget2")
142 (version "1.99.2")
143 (source
144 (origin
145 (method url-fetch)
146 (uri (string-append "mirror://gnu/wget/wget2-" version ".tar.gz"))
147 (sha256
148 (base32
149 "0qv55f4bablrlhc8bnic8g3mkk1kq44c4cphrk5jmv92z9aqzi6b"))))
150 (build-system gnu-build-system)
151 (arguments
152 `(#:phases
153 (modify-phases %standard-phases
154 (add-after 'unpack 'skip-network-tests
155 (lambda _
156 (substitute* "tests/Makefile.in"
157 (("test-gpg-verify-no-file\\$\\(EXEEXT)") "")
158 (("test-gpg-valid\\$\\(EXEEXT)") "")
159 (("test-gpg-styles\\$\\(EXEEXT)") ""))
160 #t)))
161 #:configure-flags '("--enable-static=no")))
162 (inputs
163 `(("bzip2" ,bzip2)
164 ("gnutls" ,gnutls/dane)
165 ("gpgme" ,gpgme)
166 ("libiconv" ,libiconv)
167 ("libidn2" ,libidn2)
168 ("libmicrohttpd" ,libmicrohttpd)
169 ("libpsl" ,libpsl)
170 ("pcre2" ,pcre2)
171 ("zlib" ,zlib)))
172 ;; TODO: Add libbrotlidec, libnghttp2.
173 (native-inputs
174 `(("pkg-config" ,pkg-config)))
175 (home-page "https://gitlab.com/gnuwget/wget2")
176 (synopsis "Successor of GNU Wget")
177 (description "GNU Wget2 is the successor of GNU Wget, a file and recursive
178 website downloader. Designed and written from scratch it wraps around libwget,
179 that provides the basic functions needed by a web client.")
180 (properties '((ftp-directory . "/gnu/wget")))
181 (license (list license:gpl3+ license:lgpl3+))))