gnu: python2-testpath: Remove package.
[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>
2213d00f 4;;; Copyright © 2016, 2017, 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
afc43823 5;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
2e97761e 6;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <me@tobias.gr>
8a6898b6 7;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
da7b042d 8;;;
233e7676 9;;; This file is part of GNU Guix.
da7b042d 10;;;
233e7676 11;;; GNU Guix is free software; you can redistribute it and/or modify it
da7b042d
NK
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;;;
233e7676 16;;; GNU Guix is distributed in the hope that it will be useful, but
da7b042d
NK
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
233e7676 22;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
da7b042d 23
1ffa7090 24(define-module (gnu packages wget)
7fb74221 25 #:use-module ((guix licenses) #:prefix license:)
c84c8f66 26 #:use-module (gnu packages)
afc43823 27 #:use-module (gnu packages base)
6b88912e 28 #:use-module (gnu packages compression)
afc43823 29 #:use-module (gnu packages documentation)
afc43823 30 #:use-module (gnu packages gnunet)
78249ebf 31 #:use-module (gnu packages gnupg)
fb7bdb43 32 #:use-module (gnu packages libidn)
afc43823 33 #:use-module (gnu packages pcre)
e3873113 34 #:use-module (gnu packages perl)
6b9540bc 35 #:use-module (gnu packages pkg-config)
e3873113 36 #:use-module (gnu packages python)
a7fd7b68 37 #:use-module (gnu packages tls)
e3873113 38 #:use-module (gnu packages web)
08b00d38 39 #:use-module (gnu packages xdisorg)
da7b042d
NK
40 #:use-module (guix packages)
41 #:use-module (guix download)
2e97761e 42 #:use-module (guix git-download)
da7b042d
NK
43 #:use-module (guix build-system gnu))
44
45(define-public wget
46 (package
47 (name "wget")
25cb591c 48 (version "1.20.3")
da7b042d
NK
49 (source
50 (origin
51 (method url-fetch)
52 (uri (string-append "mirror://gnu/wget/wget-"
6b88912e 53 version ".tar.lz"))
da7b042d
NK
54 (sha256
55 (base32
25cb591c 56 "1frajd86ds8vz2hprq30wq8ya89z9dcxnwm8nwk12bbc47l7qq39"))))
da7b042d
NK
57 (build-system gnu-build-system)
58 (inputs
fb7bdb43 59 `(("gnutls" ,gnutls)
dd2c73f6 60 ("libidn2" ,libidn2)
8a6898b6 61 ("libpsl" ,libpsl)))
b5d4a811 62 (native-inputs
8a6898b6
JN
63 `(("lzip" ,lzip)
64 ("pkg-config" ,pkg-config)
6b9540bc 65 ("perl" ,perl)
fb7bdb43
EB
66 ("python" ,python) ;for testenv suite
67 ("perl-http-daemon" ,perl-http-daemon)
68 ("perl-io-socket-ssl" ,perl-io-socket-ssl)))
38eefbb1 69 (home-page "https://www.gnu.org/software/wget/")
f50d2669 70 (synopsis "Non-interactive command-line utility for downloading files")
da7b042d 71 (description
79c311b8 72 "GNU Wget is a non-interactive tool for fetching files using the HTTP,
e881752c 73HTTPS and FTP protocols. It can resume interrupted downloads, use file name
a22dc0c4
LC
74wild cards, supports proxies and cookies, and it can convert absolute links
75in downloaded documents to relative links.")
7fb74221 76 (license license:gpl3+))) ; some files are under GPLv2+
22486fbe
EF
77
78(define-public wgetpaste
79 (package
80 (name "wgetpaste")
bdd2970c 81 (version "2.32")
22486fbe
EF
82 (source
83 (origin
2e97761e
TGR
84 (method git-fetch)
85 (uri (git-reference
86 (url "https://github.com/zlin/wgetpaste")
87 (commit version)))
88 (file-name (git-file-name name version))
22486fbe 89 (sha256
bdd2970c 90 (base32 "13zdqfnbpymwz2f04icw92flj50227n5r0dcms84qxswfxrarnas"))))
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)
57ea4dfc 100 (add-after 'unpack 'change-unfriendly-default
23499949
EF
101 (lambda _
102 (substitute* "wgetpaste"
57ea4dfc
TGR
103 ;; dpaste blocks Tor users. Use a better default.
104 (("DEFAULT_SERVICE:-dpaste")
105 "DEFAULT_SERVICE-bpaste"))
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"))
c107a30b 111 (zsh (string-append out "/share/zsh/site-functions")))
22486fbe 112 (install-file "wgetpaste" bin)
4d3990c9 113 (install-file "_wgetpaste" zsh)
c8e214e8
TGR
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"
08b00d38 126 "wget" "xclip")))))
4d3990c9 127 #t))))
7342923d
TGR
128 #:tests? #f)) ; no test target
129 (inputs
08b00d38
EF
130 `(("wget" ,wget)
131 ("xclip" ,xclip)))
1b075501 132 (home-page "https://wgetpaste.zlin.dk/")
22486fbe
EF
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
136online pastebin services.")
6610c518 137 (license license:expat)))
afc43823
RH
138
139(define-public wget2
140 (package
141 (name "wget2")
78249ebf 142 (version "1.99.2")
afc43823 143 (source
f5e08f17 144 (origin
78249ebf
EF
145 (method url-fetch)
146 (uri (string-append "mirror://gnu/wget/wget2-" version ".tar.gz"))
f5e08f17
EF
147 (sha256
148 (base32
78249ebf 149 "0qv55f4bablrlhc8bnic8g3mkk1kq44c4cphrk5jmv92z9aqzi6b"))))
afc43823
RH
150 (build-system gnu-build-system)
151 (arguments
f5e08f17
EF
152 `(#:phases
153 (modify-phases %standard-phases
78249ebf 154 (add-after 'unpack 'skip-network-tests
f5e08f17 155 (lambda _
78249ebf
EF
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")))
f5e08f17 162 (inputs
78249ebf
EF
163 `(("bzip2" ,bzip2)
164 ("gnutls" ,gnutls/dane)
165 ("gpgme" ,gpgme)
f5e08f17
EF
166 ("libiconv" ,libiconv)
167 ("libidn2" ,libidn2)
168 ("libmicrohttpd" ,libmicrohttpd)
169 ("libpsl" ,libpsl)
78249ebf
EF
170 ("pcre2" ,pcre2)
171 ("zlib" ,zlib)))
afc43823 172 ;; TODO: Add libbrotlidec, libnghttp2.
f5e08f17 173 (native-inputs
78249ebf 174 `(("pkg-config" ,pkg-config)))
4b1ba80c 175 (home-page "https://gitlab.com/gnuwget/wget2")
afc43823
RH
176 (synopsis "Successor of GNU Wget")
177 (description "GNU Wget2 is the successor of GNU Wget, a file and recursive
178website downloader. Designed and written from scratch it wraps around libwget,
179that provides the basic functions needed by a web client.")
2213d00f 180 (properties '((ftp-directory . "/gnu/wget")))
7fb74221 181 (license (list license:gpl3+ license:lgpl3+))))