Merge branch 'master' into staging
[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>
9d9847e1 5;;; Copyright © 2015 Ludovic Courtès <ludo@gnu.org>
af8f7eb4 6;;; Copyright © 2016, 2017, 2019 Leo Famulari <leo@famulari.name>
79d95250 7;;; Copyright © 2017 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>
f30d5f7f 11;;; Copyright © 2019 Ricardo Wurmus <rekado@elephly.net>
6b9105e5
AE
12;;;
13;;; This file is part of GNU Guix.
14;;;
15;;; GNU Guix is free software; you can redistribute it and/or modify it
16;;; under the terms of the GNU General Public License as published by
17;;; the Free Software Foundation; either version 3 of the License, or (at
18;;; your option) any later version.
19;;;
20;;; GNU Guix is distributed in the hope that it will be useful, but
21;;; WITHOUT ANY WARRANTY; without even the implied warranty of
22;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23;;; GNU General Public License for more details.
24;;;
25;;; You should have received a copy of the GNU General Public License
26;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
27
28(define-module (gnu packages curl)
b5b73a82 29 #:use-module ((guix licenses) #:prefix license:)
6b9105e5
AE
30 #:use-module (guix packages)
31 #:use-module (guix download)
8de9d532 32 #:use-module (guix git-download)
79d95250 33 #:use-module (guix utils)
6b9105e5 34 #:use-module (guix build-system gnu)
8de9d532 35 #:use-module (guix build-system go)
b6b29c77 36 #:use-module (gnu packages)
6b9105e5 37 #:use-module (gnu packages compression)
8de9d532 38 #:use-module (gnu packages golang)
6b9105e5
AE
39 #:use-module (gnu packages groff)
40 #:use-module (gnu packages gsasl)
5e3010a2 41 #:use-module (gnu packages guile)
6b9105e5
AE
42 #:use-module (gnu packages libidn)
43 #:use-module (gnu packages openldap)
44 #:use-module (gnu packages perl)
45 #:use-module (gnu packages pkg-config)
c0e57fb8 46 #:use-module (gnu packages python)
a7fd7b68 47 #:use-module (gnu packages ssh)
1300e4ee
TGR
48 #:use-module (gnu packages tls)
49 #:use-module (gnu packages web))
6b9105e5
AE
50
51(define-public curl
52 (package
53 (name "curl")
8b09f1ce 54 (replacement curl-7.65.0)
4aef33b1 55 (version "7.63.0")
6b9105e5
AE
56 (source (origin
57 (method url-fetch)
6588c283 58 (uri (string-append "https://curl.haxx.se/download/curl-"
e0afc09d 59 version ".tar.xz"))
6b9105e5
AE
60 (sha256
61 (base32
4aef33b1 62 "1i38v49233jirzlfqd8fy6jyf80assa953hk7w6qmysbg562604n"))))
6b9105e5 63 (build-system gnu-build-system)
9d9847e1
LC
64 (outputs '("out"
65 "doc")) ;1.2 MiB of man3 pages
6b9105e5 66 (inputs `(("gnutls" ,gnutls)
6b9105e5
AE
67 ("gss" ,gss)
68 ("libidn" ,libidn)
af8f7eb4
LF
69 ;; TODO XXX <https://bugs.gnu.org/34927>
70 ;; Curl doesn't actually use or refer to libssh2 because the build
71 ;; is not configured with '--with-libssh2'. Remove this input when
72 ;; a mass rebuild is appropriate (e.g. core-updates).
c1f4e649
MB
73 ("libssh2" ,libssh2-1.8.0)
74 ("openldap" ,openldap)
75 ("nghttp2" ,nghttp2 "lib")
76 ("zlib" ,zlib)))
c4c4cc05
JD
77 (native-inputs
78 `(("perl" ,perl)
79 ;; to enable the --manual option and make test 1026 pass
80 ("groff" ,groff)
c0e57fb8
SHT
81 ("pkg-config" ,pkg-config)
82 ("python" ,python-2)))
dc138d6d
MB
83 (native-search-paths
84 ;; Note: This search path is respected by the `curl` command-line tool only.
85 ;; Ideally we would bake this into libcurl itself so other users can benefit,
86 ;; but it's not supported upstream due to thread safety concerns.
87 (list (search-path-specification
88 (variable "CURL_CA_BUNDLE")
89 (file-type 'regular)
90 (separator #f) ;single entry
91 (files '("etc/ssl/certs/ca-certificates.crt")))))
6b9105e5 92 (arguments
7b844100
MB
93 `(#:configure-flags '("--with-gnutls" "--with-gssapi"
94 "--disable-static")
c0e57fb8
SHT
95 ;; Add a phase to patch '/bin/sh' occurances in tests/runtests.pl
96 #:phases
5625adfc 97 (modify-phases %standard-phases
9d9847e1
LC
98 (add-after
99 'install 'move-man3-pages
100 (lambda* (#:key outputs #:allow-other-keys)
101 ;; Move section 3 man pages to "doc".
102 (let ((out (assoc-ref outputs "out"))
103 (doc (assoc-ref outputs "doc")))
104 (mkdir-p (string-append doc "/share/man"))
105 (rename-file (string-append out "/share/man/man3")
106 (string-append doc "/share/man/man3"))
107 #t)))
5625adfc
LC
108 (replace
109 'check
110 (lambda _
111 (substitute* "tests/runtests.pl"
112 (("/bin/sh") (which "sh")))
186de634 113
5625adfc 114 ;; XXX FIXME: Test #1510 seems to work on some machines and not
59e80445 115 ;; others, possibly based on the kernel version. It works on Guix System
5625adfc
LC
116 ;; on x86_64 with linux-libre-4.1, but fails on Hydra for both i686
117 ;; and x86_64 with the following error:
118 ;;
119 ;; test 1510...[HTTP GET connection cache limit (CURLOPT_MAXCONNECTS)]
120 ;;
121 ;; 1510: output (log/stderr1510) FAILED:
a124bbd2
SB
122 ;; --- log/check-expected 2015-06-27 07:45:53.166720834 +0000
123 ;; +++ log/check-generated 2015-06-27 07:45:53.166720834 +0000
5625adfc
LC
124 ;; @@ -1,5 +1,5 @@
125 ;; * Connection #0 to host server1.example.com left intact[LF]
126 ;; * Connection #1 to host server2.example.com left intact[LF]
127 ;; * Connection #2 to host server3.example.com left intact[LF]
128 ;; -* Closing connection 0[LF]
129 ;; +* Closing connection 1[LF]
130 ;; * Connection #3 to host server4.example.com left intact[LF]
131 (delete-file "tests/data/test1510")
d2e3caba 132
5625adfc
LC
133 ;; The top-level "make check" does "make -C tests quiet-test", which
134 ;; is too quiet. Use the "test" target instead, which is more
135 ;; verbose.
fac441b3 136 (invoke "make" "-C" "tests" "test"))))))
35b9e423 137 (synopsis "Command line tool for transferring data with URL syntax")
6b9105e5
AE
138 (description
139 "curl is a command line tool for transferring data with URL syntax,
140supporting DICT, FILE, FTP, FTPS, Gopher, HTTP, HTTPS, IMAP, IMAPS, LDAP,
141LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, Telnet and TFTP.
7c125ce0
AK
142curl supports SSL certificates, HTTP POST, HTTP PUT, FTP uploading, HTTP
143form based upload, proxies, cookies, file transfer resume, user+password
144authentication (Basic, Digest, NTLM, Negotiate, kerberos...), proxy
145tunneling, and so on.")
166191b3 146 (license (license:non-copyleft "file://COPYING"
7c125ce0 147 "See COPYING in the distribution."))
14251e30 148 (home-page "https://curl.haxx.se/")))
e1444afa 149
8b09f1ce 150(define-public curl-7.65.0
8f9c5aa3
LF
151 (package
152 (inherit curl)
8b09f1ce 153 (version "7.65.0")
8f9c5aa3
LF
154 (source
155 (origin
156 (method url-fetch)
157 (uri (string-append "https://curl.haxx.se/download/curl-"
158 version ".tar.xz"))
159 (sha256
160 (base32
8b09f1ce 161 "1kb6p510m0n0y1c8fjxbcs6dyaqgm8i54pjvj29zc14lj9ix4rkp"))))))
8f9c5aa3 162
8de9d532
LF
163(define-public kurly
164 (package
165 (name "kurly")
ea6937ad 166 (version "1.2.2")
8de9d532
LF
167 (source (origin
168 (method git-fetch)
169 (uri (git-reference
ea6937ad 170 (url "https://gitlab.com/davidjpeacock/kurly.git")
8de9d532 171 (commit (string-append "v" version))))
c2c04cde 172 (file-name (git-file-name name version))
8de9d532
LF
173 (sha256
174 (base32
ea6937ad 175 "003jv2k45hg2svhjpy5253ccd250vi2r17x2zhm51iw54kgwxipm"))))
8de9d532
LF
176 (build-system go-build-system)
177 (arguments
ea6937ad 178 `(#:import-path "gitlab.com/davidjpeacock/kurly"
4880fddd
LF
179 #:install-source? #f
180 #:phases
181 (modify-phases %standard-phases
fdcbe78b
TGR
182 (add-after 'install 'install-documentation
183 (lambda* (#:key import-path outputs #:allow-other-keys)
184 (let* ((source (string-append "src/" import-path))
185 (out (assoc-ref outputs "out"))
186 (doc (string-append out "/share/doc/" ,name "-" ,version))
187 (man (string-append out "/share/man/man1")))
188 (with-directory-excursion source
189 (install-file "README.md" doc)
190 (mkdir-p man)
ea6937ad 191 (copy-file "doc/kurly.man"
fdcbe78b 192 (string-append man "/kurly.1")))
4880fddd 193 #t))))))
8de9d532
LF
194 (inputs
195 `(("go-github-com-alsm-ioprogress" ,go-github-com-alsm-ioprogress)
196 ("go-github-com-aki237-nscjar" ,go-github-com-aki237-nscjar)
ea6937ad 197 ("go-github-com-urfave-cli" ,go-github-com-urfave-cli)))
8de9d532
LF
198 (synopsis "Command-line HTTP client")
199 (description "kurly is an alternative to the @code{curl} program written in
200Go. kurly is designed to operate in a similar manner to curl, with select
201features. Notably, kurly is not aiming for feature parity, but common flags and
202mechanisms particularly within the HTTP(S) realm are to be expected. kurly does
203not offer a replacement for libcurl.")
ea6937ad 204 (home-page "https://gitlab.com/davidjpeacock/kurly")
8de9d532 205 (license license:asl2.0)))
5e3010a2
RJ
206
207(define-public guile-curl
208 (package
209 (name "guile-curl")
f30d5f7f 210 (version "0.6")
5e3010a2
RJ
211 (source (origin
212 (method url-fetch)
f30d5f7f
RW
213 (uri (string-append "http://www.lonelycactus.com/tarball/"
214 "guile_curl-" version ".tar.gz"))
5e3010a2
RJ
215 (sha256
216 (base32
f30d5f7f 217 "1pxdhnk288ky6gkpad8i60m0p6404rdvls43lr1b5d3csrklyc70"))))
5e3010a2
RJ
218 (build-system gnu-build-system)
219 (arguments
220 `(#:configure-flags (list (string-append
221 "--with-guilesitedir="
222 (assoc-ref %outputs "out")
223 "/share/guile/site/2.2")
224 (string-append
225 "-with-guileextensiondir="
226 (assoc-ref %outputs "out")
227 "/lib/guile/2.2/extensions"))
228 #:phases
229 (modify-phases %standard-phases
230 (add-after 'install 'patch-extension-path
231 (lambda* (#:key outputs #:allow-other-keys)
232 (let* ((out (assoc-ref outputs "out"))
233 (curl.scm (string-append
234 out "/share/guile/site/2.2/curl.scm"))
235 (curl.go (string-append
236 out "/lib/guile/2.2/site-ccache/curl.go"))
237 (ext (string-append out "/lib/guile/2.2/"
238 "extensions/libguile-curl")))
239 (substitute* curl.scm (("libguile-curl") ext))
240 ;; The build system does not actually compile the Scheme module.
241 ;; So we can compile it and put it in the right place in one go.
d28e5ad2 242 (invoke "guild" "compile" curl.scm "-o" curl.go)))))))
5e3010a2
RJ
243 (native-inputs `(("pkg-config" ,pkg-config)))
244 (inputs
245 `(("curl" ,curl)
246 ("guile" ,guile-2.2)))
247 (home-page "http://www.lonelycactus.com/guile-curl.html")
248 (synopsis "Curl bindings for Guile")
249 (description "@code{guile-curl} is a project that has procedures that allow
250Guile to do client-side URL transfers, like requesting documents from HTTP or
251FTP servers. It is based on the curl library.")
252 (license license:gpl3+)))