Commit | Line | Data |
---|---|---|
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 | 74 | HTTPS and FTP protocols. It can resume interrupted downloads, use file name |
a22dc0c4 LC |
75 | wild cards, supports proxies and cookies, and it can convert absolute links |
76 | in 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") | |
82 | (version "2.28") | |
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 | |
90 | "1hh9svyypqcvdg5mjxyyfzpdzhylhf7s7xq5dzglnm4injx3i3ak")))) | |
91 | (build-system gnu-build-system) | |
92 | (arguments | |
c8e214e8 TGR |
93 | '(#:modules ((guix build gnu-build-system) |
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" | |
105 | ((" poundpython\"") "\"") | |
d7397187 | 106 | (("-poundpython") "-bpaste")) ; dpaste blocks tor users |
23499949 | 107 | #t)) |
22486fbe EF |
108 | (replace 'install |
109 | (lambda* (#:key outputs #:allow-other-keys) | |
110 | (let* ((out (assoc-ref outputs "out")) | |
111 | (bin (string-append out "/bin")) | |
112 | (zsh (string-append out "/share/zsh/site-functions"))) | |
113 | (install-file "wgetpaste" bin) | |
4d3990c9 | 114 | (install-file "_wgetpaste" zsh) |
c8e214e8 TGR |
115 | #t))) |
116 | (add-after 'install 'wrap-program | |
117 | ;; /bin/wgetpaste prides itself on relying only on the following | |
118 | ;; inputs, and doesn't need to execute arbitrary commands, so | |
119 | ;; override PATH completely to detect any new dependencies early. | |
120 | (lambda* (#:key outputs #:allow-other-keys) | |
121 | (let ((out (assoc-ref outputs "out"))) | |
122 | (wrap-program (string-append out "/bin/wgetpaste") | |
123 | `("PATH" ":" = | |
124 | ,(delete-duplicates | |
125 | (map (lambda (command) (dirname (which command))) | |
126 | (list "bash" "mktemp" "sed" "sort" "tee" "tr" | |
08b00d38 | 127 | "wget" "xclip"))))) |
4d3990c9 | 128 | #t)))) |
7342923d TGR |
129 | #:tests? #f)) ; no test target |
130 | (inputs | |
08b00d38 EF |
131 | `(("wget" ,wget) |
132 | ("xclip" ,xclip))) | |
22486fbe EF |
133 | (home-page "http://wgetpaste.zlin.dk/") |
134 | (synopsis "Script that automates pasting to a number of pastebin services") | |
135 | (description | |
136 | "@code{wgetpaste} is an extremely simple command-line interface to various | |
137 | online pastebin services.") | |
138 | (license public-domain))) | |
afc43823 RH |
139 | |
140 | (define-public wget2 | |
141 | (package | |
142 | (name "wget2") | |
f5e08f17 | 143 | (version "1.99.1") |
afc43823 | 144 | (source |
f5e08f17 EF |
145 | (origin |
146 | (method git-fetch) | |
147 | (uri (git-reference | |
148 | (url "https://gitlab.com/gnuwget/wget2.git") | |
149 | (commit (string-append name "-" version)) | |
150 | (recursive? #t))) ;; Needed for 'gnulib' git submodule. | |
151 | (file-name (string-append name "-" version "-checkout")) | |
152 | (sha256 | |
153 | (base32 | |
154 | "15wxsnjhc6bzk7f60i1djmsarh1w31gwi5h2gh9k19ncwypfj5dm")))) | |
afc43823 RH |
155 | (build-system gnu-build-system) |
156 | (arguments | |
f5e08f17 EF |
157 | `(#:phases |
158 | (modify-phases %standard-phases | |
159 | (add-after 'unpack 'skip-network-test | |
160 | (lambda _ | |
161 | (substitute* "tests/Makefile.am" | |
162 | (("test-auth-digest\\$\\(EXEEXT)") "")) | |
163 | #t)) | |
164 | (replace 'bootstrap | |
165 | (lambda _ | |
166 | ;; Make sure all the files are writable so that ./bootstrap | |
167 | ;; can proceed. | |
168 | (for-each (lambda (file) | |
169 | (chmod file #o755)) | |
170 | (find-files ".")) | |
171 | (patch-shebang "./gnulib/gnulib-tool.py") | |
172 | ;; Remove unnecessary inputs from bootstrap.conf | |
173 | (substitute* "bootstrap.conf" | |
174 | (("flex.*") "") | |
175 | (("makeinfo.*") "") | |
176 | (("lzip.*") "") | |
177 | (("rsync.*") "")) | |
178 | (invoke "sh" "./bootstrap" | |
179 | "--gnulib-srcdir=gnulib" | |
180 | "--no-git")))))) | |
181 | (inputs | |
182 | `(("gnutls" ,gnutls/dane) | |
183 | ("libiconv" ,libiconv) | |
184 | ("libidn2" ,libidn2) | |
185 | ("libmicrohttpd" ,libmicrohttpd) | |
186 | ("libpsl" ,libpsl) | |
187 | ("pcre2" ,pcre2))) | |
afc43823 | 188 | ;; TODO: Add libbrotlidec, libnghttp2. |
f5e08f17 EF |
189 | (native-inputs |
190 | `(("autoconf" ,autoconf) | |
191 | ("automake" ,automake) | |
192 | ("flex" ,flex) | |
193 | ("gettext" ,gettext-minimal) | |
194 | ("libtool" ,libtool) | |
195 | ("pkg-config" ,pkg-config) | |
196 | ("python" ,python-2))) | |
4b1ba80c | 197 | (home-page "https://gitlab.com/gnuwget/wget2") |
afc43823 RH |
198 | (synopsis "Successor of GNU Wget") |
199 | (description "GNU Wget2 is the successor of GNU Wget, a file and recursive | |
200 | website downloader. Designed and written from scratch it wraps around libwget, | |
201 | that provides the basic functions needed by a web client.") | |
202 | (license (list gpl3+ lgpl3+)))) |