projects/guix·blob javascript-team · refs

473 lines · 19.5 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013, 2014, 2015 Andreas Enge <[email protected]>
3;;; Copyright © 2015 Mark H Weaver <[email protected]>
4;;; Copyright © 2015 Tomáš Čech <[email protected]>
5;;; Copyright © 2015, 2020, 2021, 2022 Ludovic Courtès <[email protected]>
6;;; Copyright © 2016, 2017, 2019 Leo Famulari <[email protected]>
7;;; Copyright © 2017, 2019, 2020, 2022 Marius Bakke <[email protected]>
8;;; Copyright © 2017, 2023, 2024 Efraim Flashner <[email protected]>
9;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <[email protected]>
10;;; Copyright © 2018 Roel Janssen <[email protected]>
11;;; Copyright © 2019, 2021 Ricardo Wurmus <[email protected]>
12;;; Copyright © 2020 Jakub Kądziołka <[email protected]>
13;;; Copyright © 2020 Dale Mellor <[email protected]>
14;;; Copyright © 2020, 2023 Janneke Nieuwenhuizen <[email protected]>
15;;; Copyright © 2021 Jean-Baptiste Volatier <[email protected]>
16;;; Copyright © 2021 Felix Gruber <[email protected]>
17;;; Copyright © 2023 Sharlatan Hellseher <[email protected]>
18;;; Copyright © 2023 John Kehayias <[email protected]>
19;;; Copyright © 2024 Ashish SHUKLA <[email protected]>
20;;; Copyright © 2026 Artyom V. Poptsov <[email protected]>
21;;;
22;;; This file is part of GNU Guix.
23;;;
24;;; GNU Guix is free software; you can redistribute it and/or modify it
25;;; under the terms of the GNU General Public License as published by
26;;; the Free Software Foundation; either version 3 of the License, or (at
27;;; your option) any later version.
28;;;
29;;; GNU Guix is distributed in the hope that it will be useful, but
30;;; WITHOUT ANY WARRANTY; without even the implied warranty of
31;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32;;; GNU General Public License for more details.
33;;;
34;;; You should have received a copy of the GNU General Public License
35;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
36
37(define-module (gnu packages curl)
38 #:use-module ((guix licenses) #:prefix license:)
39 #:use-module (guix packages)
40 #:use-module (guix gexp)
41 #:use-module (guix download)
42 #:use-module (guix git-download)
43 #:use-module (guix utils)
44 #:use-module (guix build-system cmake)
45 #:use-module (guix build-system copy)
46 #:use-module (guix build-system gnu)
47 #:use-module (guix build-system go)
48 #:use-module (guix build-system meson)
49 #:use-module ((guix search-paths) #:select ($SSL_CERT_DIR $SSL_CERT_FILE))
50 #:use-module (gnu packages)
51 #:use-module (gnu packages check)
52 #:use-module (gnu packages compression)
53 #:use-module (gnu packages golang-build)
54 #:use-module (gnu packages golang-web)
55 #:use-module (gnu packages golang-xyz)
56 #:use-module (gnu packages guile)
57 #:use-module (gnu packages kerberos)
58 #:use-module (gnu packages logging)
59 #:use-module (gnu packages libevent)
60 #:use-module (gnu packages libidn)
61 #:use-module (gnu packages perl)
62 #:use-module (gnu packages pkg-config)
63 #:use-module (gnu packages python)
64 #:use-module (gnu packages ssh)
65 #:use-module (gnu packages tls)
66 #:use-module (gnu packages web)
67 #:use-module (srfi srfi-1))
68
69(define-public curl
70 (package
71 (name "curl")
72 (version "8.21.0")
73 (source (origin
74 (method url-fetch)
75 (uri (string-append "https://curl.se/download/curl-"
76 version ".tar.xz"))
77 (sha256
78 (base32
79 "1rkjzj3sr4zvvwx41aqjwlfmdbh8dij4b1sh4k33vs5c1sknc6xa"))
80 (patches (search-patches "curl-use-ssl-cert-env.patch"))))
81 (outputs '("out"
82 "doc")) ;1.2 MiB of man3 pages
83 (build-system gnu-build-system)
84 (arguments
85 (list
86 #:disallowed-references '("doc")
87 #:configure-flags
88 #~(list "--with-gnutls"
89 (string-append "--with-gssapi="
90 (dirname (dirname
91 (search-input-file
92 %build-inputs "lib/libgssrpc.so"))))
93 "--disable-static")
94 #:test-target "test-nonflaky" ;avoid tests marked as "flaky"
95 #:phases
96 #~(modify-phases %standard-phases
97 (add-after 'unpack 'do-not-record-configure-flags
98 (lambda _
99 ;; Do not save the configure options to avoid unnecessary references.
100 (substitute* "curl-config.in"
101 (("@CONFIGURE_OPTIONS@")
102 "\"not available\""))))
103 (add-after 'install 'move-man3-pages
104 (lambda _
105 ;; Move section 3 man pages to "doc".
106 (mkdir-p (string-append #$output:doc "/share/man"))
107 (rename-file (string-append #$output "/share/man/man3")
108 (string-append #$output:doc "/share/man/man3"))))
109 (add-after 'unpack 'patch-runtests
110 (lambda _
111 (substitute* "tests/runtests.pl"
112 (("/bin/sh") (which "sh")))))
113 #$@(if (or (target-arm32?)
114 (target-aarch64?))
115 #~((add-after 'unpack 'skip-tests
116 (lambda _
117 (let ((port (open-file "tests/data/DISABLED" "a")))
118 (display "1474\n" port)
119 (close port)))))
120 #~())
121 #$@(if (system-hurd?)
122 #~((add-after 'unpack 'skip-tests/hurd
123 (lambda _
124 (let ((port (open-file "tests/data/DISABLED" "a")))
125 (display "526\n" port)
126 (display "527\n" port)
127 (display "532\n" port)
128 (display "533\n" port)
129 (display "537\n" port)
130 (display "546\n" port)
131 (display "564\n" port)
132 (display "575\n" port)
133 (display "1021\n" port)
134 (display "1474\n" port)
135 (display "1501\n" port)
136 (display "1541\n" port) ;flaky
137 ;; These tests fail because the nghttp2 server
138 ;; version 1.69 after failure to set SO_REUSEPORT.
139 (display "1700\n" port)
140 (display "1701\n" port)
141 (display "1702\n" port)
142 (display "2402\n" port)
143 (display "2403\n" port)
144 (display "2404\n" port)
145 (close port)))))
146 #~())
147 (add-after 'install 'sanitize-libcurl.pc
148 (lambda _
149 ;; The pkgconfig file has all dependencies in Requires.private
150 ;; which is unnecessary for our shared library use and would
151 ;; require propagating them.
152 (substitute* (string-append #$output "/lib/pkgconfig/libcurl.pc")
153 (("^Requires.private:.*") "")))))))
154 (native-inputs
155 (list nghttp2 perl pkg-config python-minimal-wrapper
156 openssl)) ;for tests
157 (inputs
158 (list gnutls libidn libpsl mit-krb5 `(,nghttp2 "lib") zlib))
159 (native-search-paths
160 ;; These variables are introduced by curl-use-ssl-cert-env.patch.
161 (list $SSL_CERT_DIR
162 $SSL_CERT_FILE
163 ;; Note: This search path is respected by the `curl` command-line
164 ;; tool only. Patching libcurl to read it too would bring no
165 ;; advantages and require maintaining a more complex patch.
166 (search-path-specification
167 (variable "CURL_CA_BUNDLE")
168 (file-type 'regular)
169 (separator #f) ;single entry
170 (files '("etc/ssl/certs/ca-certificates.crt")))))
171 (synopsis "Command line tool for transferring data with URL syntax")
172 (description
173 "curl is a command line tool for transferring data with URL syntax,
174supporting DICT, FILE, FTP, FTPS, Gopher, HTTP, HTTPS, IMAP, IMAPS, LDAP,
175LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, Telnet and TFTP.
176curl supports SSL certificates, HTTP POST, HTTP PUT, FTP uploading, HTTP
177form based upload, proxies, cookies, file transfer resume, user+password
178authentication (Basic, Digest, NTLM, Negotiate, kerberos...), proxy
179tunneling, and so on.")
180 (home-page "https://curl.se/")
181 (license (license:non-copyleft "file://COPYING"
182 "See COPYING in the distribution."))))
183
184(define-public curl-ssh
185 (package/inherit curl
186 (arguments
187 (substitute-keyword-arguments arguments
188 ((#:configure-flags flags)
189 #~(cons "--with-libssh2" #$flags))))
190 (inputs
191 (modify-inputs inputs
192 (prepend libssh2)))
193 (properties `((hidden? . #t)))))
194
195;; XXX: It looks like unmaintained, last time updated in 2018.
196(define-public kurly
197 (package
198 (name "kurly")
199 (version "1.2.2")
200 (source
201 (origin
202 (method git-fetch)
203 (uri (git-reference
204 (url "https://gitlab.com/davidjpeacock/kurly")
205 (commit (string-append "v" version))))
206 (file-name (git-file-name name version))
207 (sha256
208 (base32 "003jv2k45hg2svhjpy5253ccd250vi2r17x2zhm51iw54kgwxipm"))))
209 (build-system go-build-system)
210 (arguments
211 (list
212 #:install-source? #f
213 #:import-path "gitlab.com/davidjpeacock/kurly"
214 #:phases
215 #~(modify-phases %standard-phases
216 (add-after 'install 'install-documentation
217 (lambda* (#:key import-path #:allow-other-keys)
218 (let* ((source (string-append "src/" import-path))
219 (doc (string-append #$output "/share/doc/"
220 #$name "-" #$version))
221 (man (string-append #$output "/share/man/man1")))
222 (with-directory-excursion source
223 (install-file "README.md" doc)
224 (mkdir-p man)
225 (copy-file "doc/kurly.man"
226 (string-append man "/kurly.1")))))))))
227 (inputs
228 (list go-github-com-alsm-ioprogress
229 go-github-com-aki237-nscjar
230 go-github-com-urfave-cli))
231 (home-page "https://gitlab.com/davidjpeacock/kurly")
232 (synopsis "Command-line HTTP client")
233 (description
234 "kurly is an alternative to the @code{curl} program written in Go. kurly
235is designed to operate in a similar manner to curl, with select features.
236Notably, kurly is not aiming for feature parity, but common flags and
237mechanisms particularly within the HTTP(S) realm are to be expected. kurly
238does not offer a replacement for libcurl.")
239 (license license:asl2.0)))
240
241(define-public guile-curl
242 (package
243 (name "guile-curl")
244 (version "0.9")
245 (source (origin
246 (method url-fetch)
247 (uri (string-append "http://www.lonelycactus.com/tarball/"
248 "guile_curl-" version ".tar.gz"))
249 (sha256
250 (base32
251 "0y7wfhilfm6vzs0wyifrrc2pj9nsxfas905c7qa5cw4i6s74ypmi"))))
252 (build-system gnu-build-system)
253 (arguments
254 `(#:modules (((guix build guile-build-system)
255 #:select (target-guile-effective-version))
256 ,@%default-gnu-modules)
257 #:imported-modules ((guix build guile-build-system)
258 ,@%default-gnu-imported-modules)
259 #:configure-flags (list (string-append
260 "--with-guilesitedir="
261 (assoc-ref %outputs "out")
262 "/share/guile/site/"
263 (target-guile-effective-version
264 (assoc-ref %build-inputs "guile")))
265 (string-append
266 "-with-guileextensiondir="
267 (assoc-ref %outputs "out")
268 "/lib/guile/"
269 (target-guile-effective-version
270 (assoc-ref %build-inputs "guile"))
271 "/extensions"))
272 #:phases
273 (modify-phases %standard-phases
274 (add-after 'unpack 'patch-undefined-references
275 (lambda* _
276 (substitute* "module/curl.scm"
277 ;; The following #defines are missing from our curl package
278 ;; and therefore result in the evaluation of undefined symbols.
279 ((",CURLOPT_HAPROXYPROTOCOL") "#f")
280 ((",CURLOPT_DISALLOW_USERNAME_IN_URL") "#f")
281 ((",CURLOPT_TIMEVALUE_LARGE") "#f")
282 ((",CURLOPT_DNS_SHUFFLE_ADDRESSES") "#f")
283 ((",CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS") "#f"))))
284 (add-after 'install 'patch-extension-path
285 (lambda* (#:key outputs #:allow-other-keys)
286 (let* ((out (assoc-ref outputs "out"))
287 (curl.scm (string-append
288 out "/share/guile/site/"
289 (target-guile-effective-version)
290 "/curl.scm"))
291 (curl.go (string-append
292 out "/lib/guile/"
293 (target-guile-effective-version)
294 "/site-ccache/curl.go"))
295 (ext (string-append out "/lib/guile/"
296 (target-guile-effective-version)
297 "/extensions/libguile-curl")))
298 (substitute* curl.scm (("libguile-curl") ext))
299 ;; The build system does not actually compile the Scheme module.
300 ;; So we can compile it and put it in the right place in one go.
301 (invoke "guild" "compile" curl.scm "-o" curl.go)))))))
302 (native-inputs (list pkg-config))
303 (inputs
304 (list curl guile-3.0))
305 (home-page "http://www.lonelycactus.com/guile-curl.html")
306 (synopsis "Curl bindings for Guile")
307 (description "@code{guile-curl} is a project that has procedures that allow
308Guile to do client-side URL transfers, like requesting documents from HTTP or
309FTP servers. It is based on the curl library.")
310 (license license:gpl3+)))
311
312(define-public guile2.2-curl
313 (package
314 (inherit guile-curl)
315 (name "guile2.2-curl")
316 (inputs
317 (list curl guile-2.2))))
318
319(define-public curlpp
320 (package
321 (name "curlpp")
322 (version "0.8.1")
323 (source
324 (origin
325 (method git-fetch)
326 (uri (git-reference
327 (url "https://github.com/jpbarrette/curlpp")
328 (commit (string-append "v" version))))
329 (sha256
330 (base32 "1b0ylnnrhdax4kwjq64r1fk0i24n5ss6zfzf4hxwgslny01xiwrk"))
331 (file-name (git-file-name name version))))
332 (build-system cmake-build-system)
333 ;; There are no build tests to be had.
334 (arguments
335 '(#:tests? #f))
336 ;; The installed version needs the header files from the C library.
337 (propagated-inputs
338 (list curl))
339 (synopsis "C++ wrapper around libcURL")
340 (description
341 "This package provides a free and easy-to-use client-side C++ URL
342transfer library, supporting FTP, FTPS, HTTP, HTTPS, GOPHER, TELNET, DICT,
343FILE and LDAP; in particular it supports HTTPS certificates, HTTP POST, HTTP
344PUT, FTP uploading, kerberos, HTTP form based upload, proxies, cookies,
345user+password authentication, file transfer resume, http proxy tunneling and
346more!")
347 (home-page "https://www.curlpp.org")
348 (license license:expat)))
349
350(define-public h2c
351 (package
352 (name "h2c")
353 (version "1.0")
354 (source
355 (origin
356 (method git-fetch)
357 (uri (git-reference
358 (url "https://github.com/curl/h2c")
359 (commit version)))
360 (sha256
361 (base32
362 "1n8z6avzhg3yb330di2y9zymsps1qp1235p29kidcp4fkmn7fgb2"))
363 (file-name (git-file-name name version))))
364 (build-system copy-build-system)
365 (arguments
366 '(#:install-plan
367 '(("./h2c" "bin/"))))
368 (inputs
369 (list perl))
370 (home-page "https://curl.se/h2c/")
371 (synopsis "Convert HTTP headers to a curl command line")
372 (description
373 "Provided a set of HTTP request headers, h2c outputs how to invoke
374curl to obtain exactly that HTTP request.")
375 (properties `((lint-hidden-cpe-vendors . ("golang"))))
376 (license license:expat)))
377
378(define-public coeurl
379 (package
380 (name "coeurl")
381 (version "0.3.1")
382 (source
383 (origin
384 (method git-fetch)
385 (uri (git-reference
386 (url "https://nheko.im/nheko-reborn/coeurl")
387 (commit (string-append "v" version))))
388 (file-name (git-file-name name version))
389 (sha256
390 (base32 "1l9lx8chpc4bx7xxycdgr8mgqqjdrvipljmq869c2x1zjwrnasil"))))
391 (build-system meson-build-system)
392 (native-inputs
393 (list doctest pkg-config))
394 (inputs
395 (list curl libevent spdlog))
396 (home-page "https://nheko.im/nheko-reborn/coeurl")
397 (synopsis "Simple async wrapper around CURL for C++")
398 (description "Coeurl is a simple library to do HTTP requests
399asynchronously via cURL in C++.")
400 (license license:expat)))
401
402(define-public curlie
403 (package
404 (name "curlie")
405 (version "1.8.2")
406 (source
407 (origin
408 (method git-fetch)
409 (uri (git-reference
410 (url "https://github.com/rs/curlie")
411 (commit (string-append "v" version))))
412 (file-name (git-file-name name version))
413 (sha256
414 (base32
415 "0jfqx7lfia7s1w438i5ngqvlhi2il04wi0p2fcw4b1iq5474hnh6"))))
416 (build-system go-build-system)
417 (arguments
418 (list #:install-source? #f
419 #:import-path "github.com/rs/curlie"))
420 (inputs (list curl
421 go-golang-org-x-sys
422 go-golang-org-x-term))
423 (home-page "https://rs.github.io/curlie")
424 (synopsis "The power of curl, the ease of use of httpie")
425 (description "If you like the interface of HTTPie but miss the features of
426curl, curlie is what you are searching for. Curlie is a frontend to
427@code{curl} that adds the ease of use of @code{httpie}, without compromising
428on features and performance. All @code{curl} options are exposed with syntax
429sugar and output formatting inspired from @code{httpie}.")
430 (license license:expat)))
431
432(define-public trurl
433 (package
434 (name "trurl")
435 (version "0.16.1")
436 (source
437 (origin
438 (method git-fetch)
439 (uri (git-reference
440 (url "https://github.com/curl/trurl")
441 (commit (string-append name "-" version))))
442 (file-name (git-file-name name version))
443 (sha256
444 (base32 "1zdq81smm9ddqcmvwpcm01nf812fr8p4g6i2raxv3s0rd3hi68sl"))
445 (patches
446 ;; Some tests are failing due to case sensitivity in curl 8.20+:
447 ;; <https://github.com/curl/trurl/issues/440>
448 ;;
449 ;; Those patches are from Debian:
450 ;; <https://salsa.debian.org/debian/trurl/-/tree/debian/latest/debian/patches>
451 (search-patches "trurl-fix-hex-expected-case.patch"
452 "trurl-fix-tests-for-newer-libcurl.patch"
453 "trurl-mark-additional-tests-case-sensitive.patch"))))
454 (build-system gnu-build-system)
455 (arguments
456 (list
457 #:test-target "test"
458 #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
459 (string-append "PREFIX=" #$output))
460 #:phases
461 #~(modify-phases %standard-phases
462 (delete 'configure))))
463 (native-inputs (list python-minimal perl))
464 (inputs (list curl))
465 (home-page "https://curl.se/trurl/")
466 (synopsis "Command line tool for URL parsing and manipulation")
467 (description "@code{trurl} is a command line tool that parses and
468manipulates URLs, designed to help shell script authors everywhere.
469
470It is similar in spirit to @code{tr}. Here, @code{tr} stands for translate or
471transpose.")
472 (license (license:non-copyleft "file://COPYING"
473 "See COPYING in the distribution."))))