Merge branch 'staging' into core-updates
[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)
7fb74221 24 #:use-module ((guix licenses) #:prefix license:)
c84c8f66 25 #:use-module (gnu packages)
afc43823 26 #:use-module (gnu packages base)
6b88912e 27 #:use-module (gnu packages compression)
afc43823 28 #:use-module (gnu packages documentation)
afc43823 29 #:use-module (gnu packages gnunet)
78249ebf 30 #:use-module (gnu packages gnupg)
fb7bdb43 31 #:use-module (gnu packages libidn)
afc43823 32 #:use-module (gnu packages pcre)
e3873113 33 #:use-module (gnu packages perl)
6b9540bc 34 #:use-module (gnu packages pkg-config)
e3873113 35 #:use-module (gnu packages python)
a7fd7b68 36 #:use-module (gnu packages tls)
e3873113 37 #:use-module (gnu packages web)
08b00d38 38 #:use-module (gnu packages xdisorg)
da7b042d
NK
39 #:use-module (guix packages)
40 #:use-module (guix download)
41 #:use-module (guix build-system gnu))
42
43(define-public wget
44 (package
45 (name "wget")
25cb591c 46 (version "1.20.3")
da7b042d
NK
47 (source
48 (origin
49 (method url-fetch)
50 (uri (string-append "mirror://gnu/wget/wget-"
6b88912e 51 version ".tar.lz"))
da7b042d
NK
52 (sha256
53 (base32
25cb591c 54 "1frajd86ds8vz2hprq30wq8ya89z9dcxnwm8nwk12bbc47l7qq39"))))
da7b042d
NK
55 (build-system gnu-build-system)
56 (inputs
fb7bdb43 57 `(("gnutls" ,gnutls)
dd2c73f6 58 ("libidn2" ,libidn2)
6b88912e
MB
59 ("libpsl" ,libpsl)
60 ("lzip" ,lzip)))
b5d4a811 61 (native-inputs
6b9540bc
LC
62 `(("pkg-config" ,pkg-config)
63 ("perl" ,perl)
fb7bdb43
EB
64 ("python" ,python) ;for testenv suite
65 ("perl-http-daemon" ,perl-http-daemon)
66 ("perl-io-socket-ssl" ,perl-io-socket-ssl)))
38eefbb1 67 (home-page "https://www.gnu.org/software/wget/")
f50d2669 68 (synopsis "Non-interactive command-line utility for downloading files")
da7b042d 69 (description
79c311b8 70 "GNU Wget is a non-interactive tool for fetching files using the HTTP,
e881752c 71HTTPS and FTP protocols. It can resume interrupted downloads, use file name
a22dc0c4
LC
72wild cards, supports proxies and cookies, and it can convert absolute links
73in downloaded documents to relative links.")
7fb74221 74 (license license:gpl3+))) ; some files are under GPLv2+
22486fbe
EF
75
76(define-public wgetpaste
77 (package
78 (name "wgetpaste")
710f0277 79 (version "2.29")
22486fbe
EF
80 (source
81 (origin
82 (method url-fetch)
83 (uri (string-append "http://wgetpaste.zlin.dk/wgetpaste-"
84 version ".tar.bz2"))
85 (sha256
86 (base32
710f0277 87 "1rp0wxr3zy7y2xp3azaadfghrx7g0m138f9qg6icjxkkz4vj9r22"))))
22486fbe
EF
88 (build-system gnu-build-system)
89 (arguments
710f0277 90 `(#:modules ((guix build gnu-build-system)
c8e214e8
TGR
91 (guix build utils)
92 (srfi srfi-1))
93 #:phases
22486fbe
EF
94 (modify-phases %standard-phases
95 (delete 'configure)
96 (delete 'build)
23499949
EF
97 (add-after 'unpack 'remove-dead-paste-site
98 ;; This phase is adaped from the following patch:
99 ;; https://gitweb.gentoo.org/repo/gentoo.git/tree/app-text/wgetpaste/files/wgetpaste-remove-dead.patch
100 (lambda _
101 (substitute* "wgetpaste"
710f0277 102 (("-bpaste") "-dpaste")) ; dpaste blocks tor users
23499949 103 #t))
22486fbe
EF
104 (replace 'install
105 (lambda* (#:key outputs #:allow-other-keys)
106 (let* ((out (assoc-ref outputs "out"))
107 (bin (string-append out "/bin"))
710f0277
EF
108 (zsh (string-append out "/share/zsh/site-functions"))
109 (doc (string-append out "/share/doc/" ,name "-" ,version)))
22486fbe 110 (install-file "wgetpaste" bin)
4d3990c9 111 (install-file "_wgetpaste" zsh)
710f0277 112 (install-file "LICENSE" doc)
c8e214e8
TGR
113 #t)))
114 (add-after 'install 'wrap-program
115 ;; /bin/wgetpaste prides itself on relying only on the following
116 ;; inputs, and doesn't need to execute arbitrary commands, so
117 ;; override PATH completely to detect any new dependencies early.
118 (lambda* (#:key outputs #:allow-other-keys)
119 (let ((out (assoc-ref outputs "out")))
120 (wrap-program (string-append out "/bin/wgetpaste")
121 `("PATH" ":" =
122 ,(delete-duplicates
123 (map (lambda (command) (dirname (which command)))
124 (list "bash" "mktemp" "sed" "sort" "tee" "tr"
08b00d38 125 "wget" "xclip")))))
4d3990c9 126 #t))))
7342923d
TGR
127 #:tests? #f)) ; no test target
128 (inputs
08b00d38
EF
129 `(("wget" ,wget)
130 ("xclip" ,xclip)))
22486fbe
EF
131 (home-page "http://wgetpaste.zlin.dk/")
132 (synopsis "Script that automates pasting to a number of pastebin services")
133 (description
134 "@code{wgetpaste} is an extremely simple command-line interface to various
135online pastebin services.")
6610c518 136 (license license:expat)))
afc43823
RH
137
138(define-public wget2
139 (package
140 (name "wget2")
78249ebf 141 (version "1.99.2")
afc43823 142 (source
f5e08f17 143 (origin
78249ebf
EF
144 (method url-fetch)
145 (uri (string-append "mirror://gnu/wget/wget2-" version ".tar.gz"))
f5e08f17
EF
146 (sha256
147 (base32
78249ebf 148 "0qv55f4bablrlhc8bnic8g3mkk1kq44c4cphrk5jmv92z9aqzi6b"))))
afc43823
RH
149 (build-system gnu-build-system)
150 (arguments
f5e08f17
EF
151 `(#:phases
152 (modify-phases %standard-phases
78249ebf 153 (add-after 'unpack 'skip-network-tests
f5e08f17 154 (lambda _
78249ebf
EF
155 (substitute* "tests/Makefile.in"
156 (("test-gpg-verify-no-file\\$\\(EXEEXT)") "")
157 (("test-gpg-valid\\$\\(EXEEXT)") "")
158 (("test-gpg-styles\\$\\(EXEEXT)") ""))
159 #t)))
160 #:configure-flags '("--enable-static=no")))
f5e08f17 161 (inputs
78249ebf
EF
162 `(("bzip2" ,bzip2)
163 ("gnutls" ,gnutls/dane)
164 ("gpgme" ,gpgme)
f5e08f17
EF
165 ("libiconv" ,libiconv)
166 ("libidn2" ,libidn2)
167 ("libmicrohttpd" ,libmicrohttpd)
168 ("libpsl" ,libpsl)
78249ebf
EF
169 ("pcre2" ,pcre2)
170 ("zlib" ,zlib)))
afc43823 171 ;; TODO: Add libbrotlidec, libnghttp2.
f5e08f17 172 (native-inputs
78249ebf 173 `(("pkg-config" ,pkg-config)))
4b1ba80c 174 (home-page "https://gitlab.com/gnuwget/wget2")
afc43823
RH
175 (synopsis "Successor of GNU Wget")
176 (description "GNU Wget2 is the successor of GNU Wget, a file and recursive
177website downloader. Designed and written from scratch it wraps around libwget,
178that provides the basic functions needed by a web client.")
7fb74221 179 (license (list license:gpl3+ license:lgpl3+))))