gnu: Add cl-ana.statistical-learning.
[jackhill/guix/guix.git] / gnu / packages / curl.scm
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 Ludovic Courtès <ludo@gnu.org>
6 ;;; Copyright © 2016, 2017, 2019 Leo Famulari <leo@famulari.name>
7 ;;; Copyright © 2017, 2019 Marius Bakke <mbakke@fastmail.com>
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 Ricardo Wurmus <rekado@elephly.net>
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)
29 #:use-module ((guix licenses) #:prefix license:)
30 #:use-module (guix packages)
31 #:use-module (guix download)
32 #:use-module (guix git-download)
33 #:use-module (guix utils)
34 #:use-module (guix build-system gnu)
35 #:use-module (guix build-system go)
36 #:use-module (gnu packages)
37 #:use-module (gnu packages compression)
38 #:use-module (gnu packages golang)
39 #:use-module (gnu packages groff)
40 #:use-module (gnu packages guile)
41 #:use-module (gnu packages kerberos)
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)
46 #:use-module (gnu packages python)
47 #:use-module (gnu packages tls)
48 #:use-module (gnu packages web))
49
50 (define-public curl
51 (package
52 (name "curl")
53 (version "7.65.3")
54 (replacement curl-7.66.0)
55 (source (origin
56 (method url-fetch)
57 (uri (string-append "https://curl.haxx.se/download/curl-"
58 version ".tar.xz"))
59 (sha256
60 (base32
61 "1sjz4fq7jg96mpmpqq82nd61njna6jp3c4m9yrbx2j1rh5a8ingj"))))
62 (build-system gnu-build-system)
63 (outputs '("out"
64 "doc")) ;1.2 MiB of man3 pages
65 (inputs `(("gnutls" ,gnutls)
66 ("libidn" ,libidn)
67 ("openldap" ,openldap)
68 ("mit-krb5" ,mit-krb5)
69 ("nghttp2" ,nghttp2 "lib")
70 ("zlib" ,zlib)))
71 (native-inputs
72 `(("perl" ,perl)
73 ;; to enable the --manual option and make test 1026 pass
74 ("groff" ,groff)
75 ("pkg-config" ,pkg-config)
76 ("python" ,python-wrapper)))
77 (native-search-paths
78 ;; Note: This search path is respected by the `curl` command-line tool only.
79 ;; Ideally we would bake this into libcurl itself so other users can benefit,
80 ;; but it's not supported upstream due to thread safety concerns.
81 (list (search-path-specification
82 (variable "CURL_CA_BUNDLE")
83 (file-type 'regular)
84 (separator #f) ;single entry
85 (files '("etc/ssl/certs/ca-certificates.crt")))))
86 (arguments
87 `(#:configure-flags (list "--with-gnutls"
88 (string-append "--with-gssapi="
89 (assoc-ref %build-inputs "mit-krb5"))
90 "--disable-static")
91 ;; Add a phase to patch '/bin/sh' occurances in tests/runtests.pl
92 #:phases
93 (modify-phases %standard-phases
94 (add-after
95 'install 'move-man3-pages
96 (lambda* (#:key outputs #:allow-other-keys)
97 ;; Move section 3 man pages to "doc".
98 (let ((out (assoc-ref outputs "out"))
99 (doc (assoc-ref outputs "doc")))
100 (mkdir-p (string-append doc "/share/man"))
101 (rename-file (string-append out "/share/man/man3")
102 (string-append doc "/share/man/man3"))
103 #t)))
104 (replace
105 'check
106 (lambda _
107 (substitute* "tests/runtests.pl"
108 (("/bin/sh") (which "sh")))
109
110 ;; XXX FIXME: Test #1510 seems to work on some machines and not
111 ;; others, possibly based on the kernel version. It works on Guix System
112 ;; on x86_64 with linux-libre-4.1, but fails on Hydra for both i686
113 ;; and x86_64 with the following error:
114 ;;
115 ;; test 1510...[HTTP GET connection cache limit (CURLOPT_MAXCONNECTS)]
116 ;;
117 ;; 1510: output (log/stderr1510) FAILED:
118 ;; --- log/check-expected 2015-06-27 07:45:53.166720834 +0000
119 ;; +++ log/check-generated 2015-06-27 07:45:53.166720834 +0000
120 ;; @@ -1,5 +1,5 @@
121 ;; * Connection #0 to host server1.example.com left intact[LF]
122 ;; * Connection #1 to host server2.example.com left intact[LF]
123 ;; * Connection #2 to host server3.example.com left intact[LF]
124 ;; -* Closing connection 0[LF]
125 ;; +* Closing connection 1[LF]
126 ;; * Connection #3 to host server4.example.com left intact[LF]
127 (delete-file "tests/data/test1510")
128
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.
132 (invoke "make" "-C" "tests" "test"))))))
133 (synopsis "Command line tool for transferring data with URL syntax")
134 (description
135 "curl is a command line tool for transferring data with URL syntax,
136 supporting DICT, FILE, FTP, FTPS, Gopher, HTTP, HTTPS, IMAP, IMAPS, LDAP,
137 LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, Telnet and TFTP.
138 curl supports SSL certificates, HTTP POST, HTTP PUT, FTP uploading, HTTP
139 form based upload, proxies, cookies, file transfer resume, user+password
140 authentication (Basic, Digest, NTLM, Negotiate, kerberos...), proxy
141 tunneling, and so on.")
142 (license (license:non-copyleft "file://COPYING"
143 "See COPYING in the distribution."))
144 (home-page "https://curl.haxx.se/")))
145
146 (define curl-7.66.0
147 (package
148 (inherit curl)
149 (version "7.66.0")
150 (source (origin
151 (method url-fetch)
152 (uri (string-append "https://curl.haxx.se/download/curl-"
153 version ".tar.xz"))
154 (sha256
155 (base32
156 "1hcqxpibhknhjy56wcxz5vd6m9ggx3ykwp3wp5wx05ih36481d6v"))))))
157
158 (define-public kurly
159 (package
160 (name "kurly")
161 (version "1.2.2")
162 (source (origin
163 (method git-fetch)
164 (uri (git-reference
165 (url "https://gitlab.com/davidjpeacock/kurly.git")
166 (commit (string-append "v" version))))
167 (file-name (git-file-name name version))
168 (sha256
169 (base32
170 "003jv2k45hg2svhjpy5253ccd250vi2r17x2zhm51iw54kgwxipm"))))
171 (build-system go-build-system)
172 (arguments
173 `(#:import-path "gitlab.com/davidjpeacock/kurly"
174 #:install-source? #f
175 #:phases
176 (modify-phases %standard-phases
177 (add-after 'install 'install-documentation
178 (lambda* (#:key import-path outputs #:allow-other-keys)
179 (let* ((source (string-append "src/" import-path))
180 (out (assoc-ref outputs "out"))
181 (doc (string-append out "/share/doc/" ,name "-" ,version))
182 (man (string-append out "/share/man/man1")))
183 (with-directory-excursion source
184 (install-file "README.md" doc)
185 (mkdir-p man)
186 (copy-file "doc/kurly.man"
187 (string-append man "/kurly.1")))
188 #t))))))
189 (inputs
190 `(("go-github-com-alsm-ioprogress" ,go-github-com-alsm-ioprogress)
191 ("go-github-com-aki237-nscjar" ,go-github-com-aki237-nscjar)
192 ("go-github-com-urfave-cli" ,go-github-com-urfave-cli)))
193 (synopsis "Command-line HTTP client")
194 (description "kurly is an alternative to the @code{curl} program written in
195 Go. kurly is designed to operate in a similar manner to curl, with select
196 features. Notably, kurly is not aiming for feature parity, but common flags and
197 mechanisms particularly within the HTTP(S) realm are to be expected. kurly does
198 not offer a replacement for libcurl.")
199 (home-page "https://gitlab.com/davidjpeacock/kurly")
200 (license license:asl2.0)))
201
202 (define-public guile-curl
203 (package
204 (name "guile-curl")
205 (version "0.6")
206 (source (origin
207 (method url-fetch)
208 (uri (string-append "http://www.lonelycactus.com/tarball/"
209 "guile_curl-" version ".tar.gz"))
210 (sha256
211 (base32
212 "1pxdhnk288ky6gkpad8i60m0p6404rdvls43lr1b5d3csrklyc70"))))
213 (build-system gnu-build-system)
214 (arguments
215 `(#:configure-flags (list (string-append
216 "--with-guilesitedir="
217 (assoc-ref %outputs "out")
218 "/share/guile/site/2.2")
219 (string-append
220 "-with-guileextensiondir="
221 (assoc-ref %outputs "out")
222 "/lib/guile/2.2/extensions"))
223 #:phases
224 (modify-phases %standard-phases
225 (add-after 'install 'patch-extension-path
226 (lambda* (#:key outputs #:allow-other-keys)
227 (let* ((out (assoc-ref outputs "out"))
228 (curl.scm (string-append
229 out "/share/guile/site/2.2/curl.scm"))
230 (curl.go (string-append
231 out "/lib/guile/2.2/site-ccache/curl.go"))
232 (ext (string-append out "/lib/guile/2.2/"
233 "extensions/libguile-curl")))
234 (substitute* curl.scm (("libguile-curl") ext))
235 ;; The build system does not actually compile the Scheme module.
236 ;; So we can compile it and put it in the right place in one go.
237 (invoke "guild" "compile" curl.scm "-o" curl.go)))))))
238 (native-inputs `(("pkg-config" ,pkg-config)))
239 (inputs
240 `(("curl" ,curl)
241 ("guile" ,guile-2.2)))
242 (home-page "http://www.lonelycactus.com/guile-curl.html")
243 (synopsis "Curl bindings for Guile")
244 (description "@code{guile-curl} is a project that has procedures that allow
245 Guile to do client-side URL transfers, like requesting documents from HTTP or
246 FTP servers. It is based on the curl library.")
247 (license license:gpl3+)))