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