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