1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2015 Tomáš Čech <sleep_walker@suse.cz>
5 ;;; Copyright © 2015, 2020, 2021, 2022 Ludovic Courtès <ludo@gnu.org>
6 ;;; Copyright © 2016, 2017, 2019 Leo Famulari <leo@famulari.name>
7 ;;; Copyright © 2017, 2019, 2020, 2022 Marius Bakke <marius@gnu.org>
8 ;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
9 ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
10 ;;; Copyright © 2018 Roel Janssen <roel@gnu.org>
11 ;;; Copyright © 2019, 2021 Ricardo Wurmus <rekado@elephly.net>
12 ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
13 ;;; Copyright © 2020 Dale Mellor <guix-devel-0brg6b@rdmp.org>
14 ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
15 ;;; Copyright © 2021 Jean-Baptiste Volatier <jbv@pm.me>
16 ;;; Copyright © 2021 Felix Gruber <felgru@posteo.net>
18 ;;; This file is part of GNU Guix.
20 ;;; GNU Guix is free software; you can redistribute it and/or modify it
21 ;;; under the terms of the GNU General Public License as published by
22 ;;; the Free Software Foundation; either version 3 of the License, or (at
23 ;;; your option) any later version.
25 ;;; GNU Guix is distributed in the hope that it will be useful, but
26 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
27 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 ;;; GNU General Public License for more details.
30 ;;; You should have received a copy of the GNU General Public License
31 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
33 (define-module (gnu packages curl)
34 #:use-module ((guix licenses) #:prefix license:)
35 #:use-module (guix packages)
36 #:use-module (guix gexp)
37 #:use-module (guix download)
38 #:use-module (guix git-download)
39 #:use-module (guix utils)
40 #:use-module (guix build-system cmake)
41 #:use-module (guix build-system copy)
42 #:use-module (guix build-system gnu)
43 #:use-module (guix build-system go)
44 #:use-module (guix build-system meson)
45 #:use-module ((guix search-paths) #:select ($SSL_CERT_DIR $SSL_CERT_FILE))
46 #:use-module (gnu packages)
47 #:use-module (gnu packages check)
48 #:use-module (gnu packages compression)
49 #:use-module (gnu packages golang)
50 #:use-module (gnu packages guile)
51 #:use-module (gnu packages kerberos)
52 #:use-module (gnu packages logging)
53 #:use-module (gnu packages libevent)
54 #:use-module (gnu packages libidn)
55 #:use-module (gnu packages perl)
56 #:use-module (gnu packages pkg-config)
57 #:use-module (gnu packages python)
58 #:use-module (gnu packages ssh)
59 #:use-module (gnu packages tls)
60 #:use-module (gnu packages web)
61 #:use-module (srfi srfi-1))
67 (replacement curl-7.84.0)
70 (uri (string-append "https://curl.se/download/curl-"
74 "129n9hi7rbg3s112chyadhp4y27ppb5i65n12wm77aw2255zf1h6"))
75 (patches (search-patches "curl-use-ssl-cert-env.patch"))))
76 (build-system gnu-build-system)
78 "doc")) ;1.2 MiB of man3 pages
79 (inputs (list gnutls libidn mit-krb5
80 `(,nghttp2 "lib") zlib))
82 `(("nghttp2" ,nghttp2)
84 ("pkg-config" ,pkg-config)
85 ("python" ,python-minimal-wrapper)))
87 ;; These variables are introduced by curl-use-ssl-cert-env.patch.
90 ;; Note: This search path is respected by the `curl` command-line
91 ;; tool only. Patching libcurl to read it too would bring no
92 ;; advantages and require maintaining a more complex patch.
93 (search-path-specification
94 (variable "CURL_CA_BUNDLE")
96 (separator #f) ;single entry
97 (files '("etc/ssl/certs/ca-certificates.crt")))))
99 `(#:disallowed-references ("doc")
100 #:configure-flags (list "--with-gnutls"
101 (string-append "--with-gssapi="
102 (assoc-ref %build-inputs "mit-krb5"))
105 (modify-phases %standard-phases
106 (add-after 'unpack 'do-not-record-configure-flags
108 ;; Do not save the configure options to avoid unnecessary references.
109 (substitute* "curl-config.in"
110 (("@CONFIGURE_OPTIONS@")
111 "\"not available\""))))
113 'install 'move-man3-pages
114 (lambda* (#:key outputs #:allow-other-keys)
115 ;; Move section 3 man pages to "doc".
116 (let ((out (assoc-ref outputs "out"))
117 (doc (assoc-ref outputs "doc")))
118 (mkdir-p (string-append doc "/share/man"))
119 (rename-file (string-append out "/share/man/man3")
120 (string-append doc "/share/man/man3")))))
122 (lambda* (#:key tests? #:allow-other-keys)
123 (substitute* "tests/runtests.pl"
124 (("/bin/sh") (which "sh")))
127 ;; The top-level "make check" does "make -C tests quiet-test", which
128 ;; is too quiet. Use the "test" target instead, which is more
130 (invoke "make" "-C" "tests" "test")))))))
131 (synopsis "Command line tool for transferring data with URL syntax")
133 "curl is a command line tool for transferring data with URL syntax,
134 supporting DICT, FILE, FTP, FTPS, Gopher, HTTP, HTTPS, IMAP, IMAPS, LDAP,
135 LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, Telnet and TFTP.
136 curl supports SSL certificates, HTTP POST, HTTP PUT, FTP uploading, HTTP
137 form based upload, proxies, cookies, file transfer resume, user+password
138 authentication (Basic, Digest, NTLM, Negotiate, kerberos...), proxy
139 tunneling, and so on.")
140 (license (license:non-copyleft "file://COPYING"
141 "See COPYING in the distribution."))
142 (home-page "https://curl.haxx.se/")))
144 ;; Replacement package with fixes for multiple vulnerabilities.
145 ;; See <https://curl.se/docs/security.html>.
151 (inherit (package-source curl))
152 (uri (string-append "https://curl.se/download/curl-"
156 "1f2xgj0wvys9xw50h7vcbaraavjr9rxx9n06x2xfbgs7ym1qn49d"))
157 (patches (append (origin-patches (package-source curl))
158 (search-patches "curl-easy-lock.patch")))))
159 (arguments (substitute-keyword-arguments (package-arguments curl)
162 ((not (target-64bit?))
163 #~(modify-phases #$phases
164 (add-after 'unpack 'tweak-lib3026-test
166 ;; Have that test create a hundred threads, not a
168 (substitute* "tests/libtest/lib3026.c"
170 "NUM_THREADS 100\n"))))))
173 (define-public curl-minimal
174 (deprecated-package "curl-minimal" curl))
176 (define-public curl-ssh
177 (package/inherit curl
179 (substitute-keyword-arguments (package-arguments curl)
180 ((#:configure-flags flags)
181 `(cons "--with-libssh2" ,flags))))
183 `(("libssh2" ,libssh2)
184 ,@(package-inputs curl)))
185 (properties `((hidden? . #t)))))
194 (url "https://gitlab.com/davidjpeacock/kurly.git")
195 (commit (string-append "v" version))))
196 (file-name (git-file-name name version))
199 "003jv2k45hg2svhjpy5253ccd250vi2r17x2zhm51iw54kgwxipm"))))
200 (build-system go-build-system)
202 `(#:import-path "gitlab.com/davidjpeacock/kurly"
205 (modify-phases %standard-phases
206 (add-after 'install 'install-documentation
207 (lambda* (#:key import-path outputs #:allow-other-keys)
208 (let* ((source (string-append "src/" import-path))
209 (out (assoc-ref outputs "out"))
210 (doc (string-append out "/share/doc/" ,name "-" ,version))
211 (man (string-append out "/share/man/man1")))
212 (with-directory-excursion source
213 (install-file "README.md" doc)
215 (copy-file "doc/kurly.man"
216 (string-append man "/kurly.1")))
219 (list go-github-com-alsm-ioprogress go-github-com-aki237-nscjar
220 go-github-com-urfave-cli))
221 (synopsis "Command-line HTTP client")
222 (description "kurly is an alternative to the @code{curl} program written in
223 Go. kurly is designed to operate in a similar manner to curl, with select
224 features. Notably, kurly is not aiming for feature parity, but common flags and
225 mechanisms particularly within the HTTP(S) realm are to be expected. kurly does
226 not offer a replacement for libcurl.")
227 (home-page "https://gitlab.com/davidjpeacock/kurly")
228 (license license:asl2.0)))
230 (define-public guile-curl
236 (uri (string-append "http://www.lonelycactus.com/tarball/"
237 "guile_curl-" version ".tar.gz"))
240 "0y7wfhilfm6vzs0wyifrrc2pj9nsxfas905c7qa5cw4i6s74ypmi"))))
241 (build-system gnu-build-system)
243 `(#:modules (((guix build guile-build-system)
244 #:select (target-guile-effective-version))
245 ,@%gnu-build-system-modules)
246 #:imported-modules ((guix build guile-build-system)
247 ,@%gnu-build-system-modules)
248 #:configure-flags (list (string-append
249 "--with-guilesitedir="
250 (assoc-ref %outputs "out")
252 (target-guile-effective-version
253 (assoc-ref %build-inputs "guile")))
255 "-with-guileextensiondir="
256 (assoc-ref %outputs "out")
258 (target-guile-effective-version
259 (assoc-ref %build-inputs "guile"))
262 (modify-phases %standard-phases
263 (add-after 'unpack 'patch-undefined-references
265 (substitute* "module/curl.scm"
266 ;; The following #defines are missing from our curl package
267 ;; and therefore result in the evaluation of undefined symbols.
268 ((",CURLOPT_HAPROXYPROTOCOL") "#f")
269 ((",CURLOPT_DISALLOW_USERNAME_IN_URL") "#f")
270 ((",CURLOPT_TIMEVALUE_LARGE") "#f")
271 ((",CURLOPT_DNS_SHUFFLE_ADDRESSES") "#f")
272 ((",CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS") "#f"))))
273 (add-after 'install 'patch-extension-path
274 (lambda* (#:key outputs #:allow-other-keys)
275 (let* ((out (assoc-ref outputs "out"))
276 (curl.scm (string-append
277 out "/share/guile/site/"
278 (target-guile-effective-version)
280 (curl.go (string-append
282 (target-guile-effective-version)
283 "/site-ccache/curl.go"))
284 (ext (string-append out "/lib/guile/"
285 (target-guile-effective-version)
286 "/extensions/libguile-curl")))
287 (substitute* curl.scm (("libguile-curl") ext))
288 ;; The build system does not actually compile the Scheme module.
289 ;; So we can compile it and put it in the right place in one go.
290 (invoke "guild" "compile" curl.scm "-o" curl.go)))))))
291 (native-inputs (list pkg-config))
293 (list curl guile-3.0))
294 (home-page "http://www.lonelycactus.com/guile-curl.html")
295 (synopsis "Curl bindings for Guile")
296 (description "@code{guile-curl} is a project that has procedures that allow
297 Guile to do client-side URL transfers, like requesting documents from HTTP or
298 FTP servers. It is based on the curl library.")
299 (license license:gpl3+)))
301 (define-public guile2.2-curl
304 (name "guile2.2-curl")
306 (list curl guile-2.2))))
308 (define-public curlpp
316 (url "https://github.com/jpbarrette/curlpp")
317 (commit (string-append "v" version))))
319 (base32 "1b0ylnnrhdax4kwjq64r1fk0i24n5ss6zfzf4hxwgslny01xiwrk"))
320 (file-name (git-file-name name version))))
321 (build-system cmake-build-system)
322 ;; There are no build tests to be had.
325 ;; The installed version needs the header files from the C library.
328 (synopsis "C++ wrapper around libcURL")
330 "This package provides a free and easy-to-use client-side C++ URL
331 transfer library, supporting FTP, FTPS, HTTP, HTTPS, GOPHER, TELNET, DICT,
332 FILE and LDAP; in particular it supports HTTPS certificates, HTTP POST, HTTP
333 PUT, FTP uploading, kerberos, HTTP form based upload, proxies, cookies,
334 user+password authentication, file transfer resume, http proxy tunneling and
336 (home-page "http://www.curlpp.org")
337 (license license:expat)))
347 (url "https://github.com/curl/h2c")
351 "1n8z6avzhg3yb330di2y9zymsps1qp1235p29kidcp4fkmn7fgb2"))
352 (file-name (git-file-name name version))))
353 (build-system copy-build-system)
356 '(("./h2c" "bin/"))))
359 (home-page "https://curl.se/h2c/")
360 (synopsis "Convert HTTP headers to a curl command line")
362 "Provided a set of HTTP request headers, h2c outputs how to invoke
363 curl to obtain exactly that HTTP request.")
364 (license license:expat)))
366 (define-public coeurl
374 (url "https://nheko.im/nheko-reborn/coeurl")
375 (commit (string-append "v" version))))
376 (file-name (git-file-name name version))
379 "0kbazvrb4hzc9jr7yywd36ack1yy7bh8sh1kc4jzv6jfzvxjb0i0"))))
380 (build-system meson-build-system)
382 (list doctest pkg-config))
384 (list curl libevent spdlog))
385 (home-page "https://nheko.im/nheko-reborn/coeurl")
386 (synopsis "Simple async wrapper around CURL for C++")
387 (description "Coeurl is a simple library to do HTTP requests
388 asynchronously via cURL in C++.")
389 (license license:expat)))
391 (define-public curlie
399 (url "https://github.com/rs/curlie")
400 (commit (string-append "v" version))))
401 (file-name (git-file-name name version))
404 "1b94wfliivfq06i5sf664nhmp3v1k0lpz33cv9lyk6s59awb2hnw"))))
405 (build-system go-build-system)
407 `(#:import-path "github.com/rs/curlie"))
409 (list curl go-golang-org-x-crypto go-golang-org-x-sys))
410 (home-page "https://curlie.io")
411 (synopsis "The power of curl, the ease of use of httpie")
412 (description "If you like the interface of HTTPie but miss the features of
413 curl, curlie is what you are searching for. Curlie is a frontend to
414 @code{curl} that adds the ease of use of @code{httpie}, without compromising
415 on features and performance. All @code{curl} options are exposed with syntax
416 sugar and output formatting inspired from @code{httpie}.")
417 (license license:expat)))