projects/guix·blob ruby-team · refs

172 lines · 6.8 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2012 Nikita Karetnikov <[email protected]>
3;;; Copyright © 2014, 2015, 2017, 2018 Ludovic Courtès <[email protected]>
4;;; Copyright © 2016, 2017, 2019-2024 Efraim Flashner <[email protected]>
5;;; Copyright © 2017 Rutger Helling <[email protected]>
6;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <[email protected]>
7;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <[email protected]>
8;;; Copyright © 2021 Michael Rohleder <[email protected]>
9;;; Copyright © 2025 John Kehayias <[email protected]>
10;;;
11;;; This file is part of GNU Guix.
12;;;
13;;; GNU Guix is free software; you can redistribute it and/or modify it
14;;; under the terms of the GNU General Public License as published by
15;;; the Free Software Foundation; either version 3 of the License, or (at
16;;; your option) any later version.
17;;;
18;;; GNU Guix is distributed in the hope that it will be useful, but
19;;; WITHOUT ANY WARRANTY; without even the implied warranty of
20;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21;;; GNU General Public License for more details.
22;;;
23;;; You should have received a copy of the GNU General Public License
24;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
25
26(define-module (gnu packages wget)
27 #:use-module ((guix licenses) #:prefix license:)
28 #:use-module (guix gexp)
29 #:use-module (gnu packages)
30 #:use-module (gnu packages bash)
31 #:use-module (gnu packages compression)
32 #:use-module (gnu packages documentation)
33 #:use-module (gnu packages gnunet)
34 #:use-module (gnu packages gnupg)
35 #:use-module (gnu packages libidn)
36 #:use-module (gnu packages pcre)
37 #:use-module (gnu packages perl)
38 #:use-module (gnu packages pkg-config)
39 #:use-module (gnu packages python)
40 #:use-module (gnu packages tls)
41 #:use-module (gnu packages web)
42 #:use-module (gnu packages xdisorg)
43 #:use-module (guix packages)
44 #:use-module (guix download)
45 #:use-module (guix git-download)
46 #:use-module (guix build-system gnu))
47
48(define-public wget
49 (package
50 (name "wget")
51 (version "1.25.0")
52 (source
53 (origin
54 (method url-fetch)
55 (uri (string-append "mirror://gnu/wget/wget-" version ".tar.lz"))
56 (sha256
57 (base32 "07waw3s51zmjqzqq717xyyd353qc1ajcd38lh7y8i85hav3mq8hr"))))
58 (build-system gnu-build-system)
59 (inputs
60 (list gnutls libidn2 libpsl))
61 (native-inputs
62 (list lzip
63 pkg-config
64 perl
65 python ;for testenv suite
66 perl-http-daemon
67 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,
72HTTPS and FTP protocols. It can resume interrupted downloads, use file name
73wild cards, supports proxies and cookies, and it can convert absolute links
74in 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.34")
81 (source
82 (origin
83 (method git-fetch)
84 (uri (git-reference
85 (url "https://github.com/zlin/wgetpaste")
86 (commit version)))
87 (file-name (git-file-name name version))
88 (sha256
89 (base32 "1z70wfzkrzlhhqm82i5gdk6clmsc06n9gsf2wizb1kzk3h61h296"))))
90 (build-system gnu-build-system)
91 (arguments
92 `(#:modules ((guix build gnu-build-system)
93 (guix build utils)
94 (srfi srfi-1))
95 #:phases
96 (modify-phases %standard-phases
97 (delete 'configure)
98 (delete 'build)
99 (replace 'install
100 (lambda* (#:key outputs #:allow-other-keys)
101 (let* ((out (assoc-ref outputs "out"))
102 (bin (string-append out "/bin"))
103 (zsh (string-append out "/share/zsh/site-functions")))
104 (install-file "wgetpaste" bin)
105 (install-file "_wgetpaste" zsh))))
106 (add-after 'install 'wrap-program
107 ;; /bin/wgetpaste prides itself on relying only on the following
108 ;; inputs, and doesn't need to execute arbitrary commands, so
109 ;; override PATH completely to detect any new dependencies early.
110 (lambda* (#:key outputs #:allow-other-keys)
111 (let ((out (assoc-ref outputs "out")))
112 (wrap-program (string-append out "/bin/wgetpaste")
113 `("PATH" ":" =
114 ,(delete-duplicates
115 (map (lambda (command) (dirname (which command)))
116 (list "bash" "mktemp" "sed" "sort" "tee" "tr"
117 "wget" "xclip")))))))))
118 #:tests? #f)) ; no test target
119 (inputs
120 (list bash-minimal wget xclip))
121 (home-page "https://wgetpaste.zlin.dk/")
122 (synopsis "Script that automates pasting to a number of pastebin services")
123 (description
124 "@code{wgetpaste} is an extremely simple command-line interface to various
125online pastebin services.")
126 (license license:expat)))
127
128(define-public wget2
129 (package
130 (name "wget2")
131 (version "2.2.1")
132 (source (origin
133 (method url-fetch)
134 (uri (string-append "mirror://gnu/wget/wget2-" version ".tar.gz"))
135 (sha256
136 (base32
137 "1d27nhgywchsn3xy0hcmmgbc32k881gmzkjg4h0yc63zwc9lnm6p"))))
138 (build-system gnu-build-system)
139 (arguments
140 (list #:phases #~(modify-phases %standard-phases
141 (add-after 'unpack 'skip-network-tests
142 (lambda _
143 (substitute* "tests/Makefile.in"
144 (("test-gpg-verify-no-file\\$\\(EXEEXT)") "")
145 (("test-gpg-valid\\$\\(EXEEXT)") "")
146 (("test-gpg-styles\\$\\(EXEEXT)") "")))))
147 #:configure-flags
148 #~(list "--enable-static=no"
149 "--with-bzip2=yes"
150 "--with-lzma=yes")))
151 (inputs (list brotli
152 bzip2
153 gnutls/dane
154 gpgme
155 libidn2
156 libmicrohttpd
157 libpsl
158 `(,nghttp2 "lib")
159 pcre2
160 xz
161 zlib
162 `(,zstd "lib")))
163 ;; TODO: Add libhsts.
164 (native-inputs (list pkg-config))
165 (home-page "https://gitlab.com/gnuwget/wget2")
166 (synopsis "Successor of GNU Wget")
167 (description
168 "GNU Wget2 is the successor of GNU Wget, a file and recursive website
169downloader. Designed and written from scratch it wraps around libwget, that
170provides the basic functions needed by a web client.")
171 (properties '((ftp-directory . "/gnu/wget")))
172 (license (list license:gpl3+ license:lgpl3+))))