gnu: Add python-pyshp.
[jackhill/guix/guix.git] / gnu / packages / curl.scm
CommitLineData
6b9105e5 1;;; GNU Guix --- Functional package management for GNU
8cab7580 2;;; Copyright © 2013, 2014, 2015 Andreas Enge <andreas@enge.fr>
74d72608 3;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
a55e2b22 4;;; Copyright © 2015 Tomáš Čech <sleep_walker@suse.cz>
caf4a7a2 5;;; Copyright © 2015, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
af8f7eb4 6;;; Copyright © 2016, 2017, 2019 Leo Famulari <leo@famulari.name>
f5fa1a77 7;;; Copyright © 2017, 2019, 2020 Marius Bakke <mbakke@fastmail.com>
8a1716fe 8;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
1300e4ee 9;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
5e3010a2 10;;; Copyright © 2018 Roel Janssen <roel@gnu.org>
01b59dea 11;;; Copyright © 2019, 2021 Ricardo Wurmus <rekado@elephly.net>
a76a3430 12;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
cce8ab8d 13;;; Copyright © 2020 Dale Mellor <guix-devel-0brg6b@rdmp.org>
6b9105e5
AE
14;;;
15;;; This file is part of GNU Guix.
16;;;
17;;; GNU Guix is free software; you can redistribute it and/or modify it
18;;; under the terms of the GNU General Public License as published by
19;;; the Free Software Foundation; either version 3 of the License, or (at
20;;; your option) any later version.
21;;;
22;;; GNU Guix is distributed in the hope that it will be useful, but
23;;; WITHOUT ANY WARRANTY; without even the implied warranty of
24;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25;;; GNU General Public License for more details.
26;;;
27;;; You should have received a copy of the GNU General Public License
28;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
29
30(define-module (gnu packages curl)
b5b73a82 31 #:use-module ((guix licenses) #:prefix license:)
6b9105e5
AE
32 #:use-module (guix packages)
33 #:use-module (guix download)
8de9d532 34 #:use-module (guix git-download)
79d95250 35 #:use-module (guix utils)
cce8ab8d 36 #:use-module (guix build-system cmake)
6b9105e5 37 #:use-module (guix build-system gnu)
8de9d532 38 #:use-module (guix build-system go)
b6b29c77 39 #:use-module (gnu packages)
6b9105e5 40 #:use-module (gnu packages compression)
8de9d532 41 #:use-module (gnu packages golang)
5e3010a2 42 #:use-module (gnu packages guile)
828d3765 43 #:use-module (gnu packages kerberos)
6b9105e5
AE
44 #:use-module (gnu packages libidn)
45 #:use-module (gnu packages openldap)
46 #:use-module (gnu packages perl)
47 #:use-module (gnu packages pkg-config)
c0e57fb8 48 #:use-module (gnu packages python)
1300e4ee 49 #:use-module (gnu packages tls)
ff5733d1
MB
50 #:use-module (gnu packages web)
51 #:use-module (srfi srfi-1))
6b9105e5
AE
52
53(define-public curl
54 (package
55 (name "curl")
9e7d93f6 56 (replacement curl-7.77.0)
a210c0d1 57 (version "7.74.0")
6b9105e5 58 (source (origin
cb8569e1
LC
59 (method url-fetch)
60 (uri (string-append "https://curl.haxx.se/download/curl-"
61 version ".tar.xz"))
62 (sha256
63 (base32
a210c0d1
MB
64 "12w7gskrglg6qrmp822j37fmbr0icrcxv7rib1fy5xiw80n5z7cr"))
65 (patches (search-patches "curl-use-ssl-cert-env.patch"))))
6b9105e5 66 (build-system gnu-build-system)
9d9847e1
LC
67 (outputs '("out"
68 "doc")) ;1.2 MiB of man3 pages
6b9105e5 69 (inputs `(("gnutls" ,gnutls)
6b9105e5 70 ("libidn" ,libidn)
6b9105e5 71 ("openldap" ,openldap)
828d3765 72 ("mit-krb5" ,mit-krb5)
6076496b 73 ("nghttp2" ,nghttp2 "lib")
6b9105e5 74 ("zlib" ,zlib)))
c4c4cc05
JD
75 (native-inputs
76 `(("perl" ,perl)
c0e57fb8 77 ("pkg-config" ,pkg-config)
53ffc043 78 ("python" ,python-wrapper)))
dc138d6d 79 (native-search-paths
6ab31af7 80 ;; These variables are introduced by curl-use-ssl-cert-env.patch.
dc138d6d 81 (list (search-path-specification
a76a3430
JK
82 (variable "SSL_CERT_DIR")
83 (separator #f) ;single entry
84 (files '("etc/ssl/certs")))
85 (search-path-specification
86 (variable "SSL_CERT_FILE")
87 (file-type 'regular)
88 (separator #f) ;single entry
89 (files '("etc/ssl/certs/ca-certificates.crt")))
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
dc138d6d
MB
94 (variable "CURL_CA_BUNDLE")
95 (file-type 'regular)
96 (separator #f) ;single entry
97 (files '("etc/ssl/certs/ca-certificates.crt")))))
6b9105e5 98 (arguments
f5fa1a77
MB
99 `(#:disallowed-references ("doc")
100 #:configure-flags (list "--with-gnutls"
828d3765
MB
101 (string-append "--with-gssapi="
102 (assoc-ref %build-inputs "mit-krb5"))
103 "--disable-static")
c0e57fb8 104 #:phases
5625adfc 105 (modify-phases %standard-phases
f5fa1a77
MB
106 (add-after 'unpack 'do-not-record-configure-flags
107 (lambda _
108 ;; Do not save the configure options to avoid unnecessary references.
109 (substitute* "curl-config.in"
110 (("@CONFIGURE_OPTIONS@")
111 "\"not available\""))
112 #t))
9d9847e1
LC
113 (add-after
114 'install 'move-man3-pages
115 (lambda* (#:key outputs #:allow-other-keys)
116 ;; Move section 3 man pages to "doc".
117 (let ((out (assoc-ref outputs "out"))
118 (doc (assoc-ref outputs "doc")))
119 (mkdir-p (string-append doc "/share/man"))
120 (rename-file (string-append out "/share/man/man3")
121 (string-append doc "/share/man/man3"))
122 #t)))
5625adfc
LC
123 (replace
124 'check
125 (lambda _
126 (substitute* "tests/runtests.pl"
127 (("/bin/sh") (which "sh")))
186de634 128
5625adfc
LC
129 ;; The top-level "make check" does "make -C tests quiet-test", which
130 ;; is too quiet. Use the "test" target instead, which is more
131 ;; verbose.
fac441b3 132 (invoke "make" "-C" "tests" "test"))))))
35b9e423 133 (synopsis "Command line tool for transferring data with URL syntax")
6b9105e5
AE
134 (description
135 "curl is a command line tool for transferring data with URL syntax,
136supporting DICT, FILE, FTP, FTPS, Gopher, HTTP, HTTPS, IMAP, IMAPS, LDAP,
137LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, Telnet and TFTP.
7c125ce0
AK
138curl supports SSL certificates, HTTP POST, HTTP PUT, FTP uploading, HTTP
139form based upload, proxies, cookies, file transfer resume, user+password
140authentication (Basic, Digest, NTLM, Negotiate, kerberos...), proxy
141tunneling, and so on.")
166191b3 142 (license (license:non-copyleft "file://COPYING"
7c125ce0 143 "See COPYING in the distribution."))
14251e30 144 (home-page "https://curl.haxx.se/")))
e1444afa 145
ff5733d1
MB
146;; This package exists mainly to bootstrap CMake. It must not depend on
147;; anything that uses cmake-build-system.
148(define-public curl-minimal
149 (hidden-package
150 (package/inherit
151 curl
152 (name "curl-minimal")
153 (inputs (alist-delete "openldap" (package-inputs curl))))))
154
9e7d93f6 155(define-public curl-7.77.0
f4dc8ac6
LLB
156 (package
157 (inherit curl)
9e7d93f6 158 (version "7.77.0")
f4dc8ac6
LLB
159 (source
160 (origin
161 (inherit (package-source curl))
162 (uri (string-append "https://curl.haxx.se/download/curl-"
163 version ".tar.xz"))
caf4a7a2
LC
164 (patches (search-patches "curl-7.76-use-ssl-cert-env.patch"
165 "curl-7.77-tls-priority-string.patch"))
f4dc8ac6
LLB
166 (sha256
167 (base32
9e7d93f6 168 "0jsrc97vbghvljic997r9nypc9qqddcil2lzvv032br8ahn5hr0g"))))))
f4dc8ac6 169
8de9d532
LF
170(define-public kurly
171 (package
172 (name "kurly")
ea6937ad 173 (version "1.2.2")
8de9d532
LF
174 (source (origin
175 (method git-fetch)
176 (uri (git-reference
ea6937ad 177 (url "https://gitlab.com/davidjpeacock/kurly.git")
8de9d532 178 (commit (string-append "v" version))))
c2c04cde 179 (file-name (git-file-name name version))
8de9d532
LF
180 (sha256
181 (base32
ea6937ad 182 "003jv2k45hg2svhjpy5253ccd250vi2r17x2zhm51iw54kgwxipm"))))
8de9d532
LF
183 (build-system go-build-system)
184 (arguments
ea6937ad 185 `(#:import-path "gitlab.com/davidjpeacock/kurly"
4880fddd
LF
186 #:install-source? #f
187 #:phases
188 (modify-phases %standard-phases
fdcbe78b
TGR
189 (add-after 'install 'install-documentation
190 (lambda* (#:key import-path outputs #:allow-other-keys)
191 (let* ((source (string-append "src/" import-path))
192 (out (assoc-ref outputs "out"))
193 (doc (string-append out "/share/doc/" ,name "-" ,version))
194 (man (string-append out "/share/man/man1")))
195 (with-directory-excursion source
196 (install-file "README.md" doc)
197 (mkdir-p man)
ea6937ad 198 (copy-file "doc/kurly.man"
fdcbe78b 199 (string-append man "/kurly.1")))
4880fddd 200 #t))))))
8de9d532
LF
201 (inputs
202 `(("go-github-com-alsm-ioprogress" ,go-github-com-alsm-ioprogress)
203 ("go-github-com-aki237-nscjar" ,go-github-com-aki237-nscjar)
ea6937ad 204 ("go-github-com-urfave-cli" ,go-github-com-urfave-cli)))
8de9d532
LF
205 (synopsis "Command-line HTTP client")
206 (description "kurly is an alternative to the @code{curl} program written in
207Go. kurly is designed to operate in a similar manner to curl, with select
208features. Notably, kurly is not aiming for feature parity, but common flags and
209mechanisms particularly within the HTTP(S) realm are to be expected. kurly does
210not offer a replacement for libcurl.")
ea6937ad 211 (home-page "https://gitlab.com/davidjpeacock/kurly")
8de9d532 212 (license license:asl2.0)))
5e3010a2
RJ
213
214(define-public guile-curl
215 (package
216 (name "guile-curl")
42d5efc0 217 (version "0.9")
5e3010a2
RJ
218 (source (origin
219 (method url-fetch)
f30d5f7f
RW
220 (uri (string-append "http://www.lonelycactus.com/tarball/"
221 "guile_curl-" version ".tar.gz"))
5e3010a2
RJ
222 (sha256
223 (base32
42d5efc0 224 "0y7wfhilfm6vzs0wyifrrc2pj9nsxfas905c7qa5cw4i6s74ypmi"))))
5e3010a2
RJ
225 (build-system gnu-build-system)
226 (arguments
8d766132
LP
227 `(#:modules (((guix build guile-build-system)
228 #:select (target-guile-effective-version))
229 ,@%gnu-build-system-modules)
230 #:imported-modules ((guix build guile-build-system)
231 ,@%gnu-build-system-modules)
232 #:configure-flags (list (string-append
5e3010a2
RJ
233 "--with-guilesitedir="
234 (assoc-ref %outputs "out")
8d766132
LP
235 "/share/guile/site/"
236 (target-guile-effective-version
237 (assoc-ref %build-inputs "guile")))
5e3010a2
RJ
238 (string-append
239 "-with-guileextensiondir="
240 (assoc-ref %outputs "out")
8d766132
LP
241 "/lib/guile/"
242 (target-guile-effective-version
243 (assoc-ref %build-inputs "guile"))
244 "/extensions"))
5e3010a2
RJ
245 #:phases
246 (modify-phases %standard-phases
8d766132
LP
247 (add-after 'unpack 'patch-undefined-references
248 (lambda* _
42d5efc0 249 (substitute* "module/curl.scm"
8d766132
LP
250 ;; The following #defines are missing from our curl package
251 ;; and therefore result in the evaluation of undefined symbols.
252 ((",CURLOPT_HAPROXYPROTOCOL") "#f")
253 ((",CURLOPT_DISALLOW_USERNAME_IN_URL") "#f")
254 ((",CURLOPT_TIMEVALUE_LARGE") "#f")
255 ((",CURLOPT_DNS_SHUFFLE_ADDRESSES") "#f")
256 ((",CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS") "#f"))))
5e3010a2
RJ
257 (add-after 'install 'patch-extension-path
258 (lambda* (#:key outputs #:allow-other-keys)
8d766132
LP
259 (let* ((out (assoc-ref outputs "out"))
260 (curl.scm (string-append
261 out "/share/guile/site/"
262 (target-guile-effective-version)
263 "/curl.scm"))
264 (curl.go (string-append
265 out "/lib/guile/"
266 (target-guile-effective-version)
267 "/site-ccache/curl.go"))
268 (ext (string-append out "/lib/guile/"
269 (target-guile-effective-version)
270 "/extensions/libguile-curl")))
271 (substitute* curl.scm (("libguile-curl") ext))
272 ;; The build system does not actually compile the Scheme module.
273 ;; So we can compile it and put it in the right place in one go.
274 (invoke "guild" "compile" curl.scm "-o" curl.go)))))))
5e3010a2
RJ
275 (native-inputs `(("pkg-config" ,pkg-config)))
276 (inputs
277 `(("curl" ,curl)
8d766132 278 ("guile" ,guile-3.0)))
5e3010a2
RJ
279 (home-page "http://www.lonelycactus.com/guile-curl.html")
280 (synopsis "Curl bindings for Guile")
281 (description "@code{guile-curl} is a project that has procedures that allow
282Guile to do client-side URL transfers, like requesting documents from HTTP or
283FTP servers. It is based on the curl library.")
284 (license license:gpl3+)))
cce8ab8d 285
cdad0a2f
LP
286(define-public guile2.2-curl
287 (package
288 (inherit guile-curl)
289 (name "guile2.2-curl")
290 (inputs
291 `(("curl" ,curl)
292 ("guile" ,guile-2.2)))))
293
cce8ab8d
DM
294(define-public curlpp
295 (package
296 (name "curlpp")
297 (version "0.8.1")
298 (source
299 (origin
300 (method git-fetch)
301 (uri (git-reference
b0e7b699 302 (url "https://github.com/jpbarrette/curlpp")
cce8ab8d
DM
303 (commit (string-append "v" version))))
304 (sha256
305 (base32 "1b0ylnnrhdax4kwjq64r1fk0i24n5ss6zfzf4hxwgslny01xiwrk"))
306 (file-name (git-file-name name version))))
307 (build-system cmake-build-system)
308 ;; There are no build tests to be had.
309 (arguments
310 '(#:tests? #f))
311 ;; The installed version needs the header files from the C library.
312 (propagated-inputs
313 `(("curl" ,curl)))
314 (synopsis "C++ wrapper around libcURL")
315 (description
316 "This package provides a free and easy-to-use client-side C++ URL
317transfer library, supporting FTP, FTPS, HTTP, HTTPS, GOPHER, TELNET, DICT,
318FILE and LDAP; in particular it supports HTTPS certificates, HTTP POST, HTTP
319PUT, FTP uploading, kerberos, HTTP form based upload, proxies, cookies,
320user+password authentication, file transfer resume, http proxy tunneling and
321more!")
322 (home-page "http://www.curlpp.org")
323 (license license:expat)))