Commit | Line | Data |
---|---|---|
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> |
678dd8a5 | 6 | ;;; Copyright © 2016, 2017 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> |
6b9105e5 AE |
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) | |
b5b73a82 | 28 | #:use-module ((guix licenses) #:prefix license:) |
6b9105e5 AE |
29 | #:use-module (guix packages) |
30 | #:use-module (guix download) | |
8de9d532 | 31 | #:use-module (guix git-download) |
79d95250 | 32 | #:use-module (guix utils) |
6b9105e5 | 33 | #:use-module (guix build-system gnu) |
8de9d532 | 34 | #:use-module (guix build-system go) |
b6b29c77 | 35 | #:use-module (gnu packages) |
6b9105e5 | 36 | #:use-module (gnu packages compression) |
8de9d532 | 37 | #:use-module (gnu packages golang) |
6b9105e5 AE |
38 | #:use-module (gnu packages groff) |
39 | #:use-module (gnu packages gsasl) | |
5e3010a2 | 40 | #:use-module (gnu packages guile) |
6b9105e5 AE |
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) | |
c0e57fb8 | 45 | #:use-module (gnu packages python) |
a7fd7b68 | 46 | #:use-module (gnu packages ssh) |
1300e4ee TGR |
47 | #:use-module (gnu packages tls) |
48 | #:use-module (gnu packages web)) | |
6b9105e5 AE |
49 | |
50 | (define-public curl | |
51 | (package | |
52 | (name "curl") | |
16676fc3 | 53 | (version "7.61.1") |
c438e0cc | 54 | (replacement curl-7.62.0) |
6b9105e5 AE |
55 | (source (origin |
56 | (method url-fetch) | |
6588c283 | 57 | (uri (string-append "https://curl.haxx.se/download/curl-" |
e0afc09d | 58 | version ".tar.xz")) |
6b9105e5 AE |
59 | (sha256 |
60 | (base32 | |
16676fc3 | 61 | "148qv1f32290r9pwg07mccawihz4srznkzsdwdl2xllvlgb16n9x")))) |
6b9105e5 | 62 | (build-system gnu-build-system) |
9d9847e1 LC |
63 | (outputs '("out" |
64 | "doc")) ;1.2 MiB of man3 pages | |
6b9105e5 | 65 | (inputs `(("gnutls" ,gnutls) |
6b9105e5 AE |
66 | ("gss" ,gss) |
67 | ("libidn" ,libidn) | |
8d5ceb12 | 68 | ("libssh2" ,libssh2) |
6b9105e5 | 69 | ("openldap" ,openldap) |
6076496b | 70 | ("nghttp2" ,nghttp2 "lib") |
6b9105e5 | 71 | ("zlib" ,zlib))) |
c4c4cc05 JD |
72 | (native-inputs |
73 | `(("perl" ,perl) | |
74 | ;; to enable the --manual option and make test 1026 pass | |
75 | ("groff" ,groff) | |
c0e57fb8 SHT |
76 | ("pkg-config" ,pkg-config) |
77 | ("python" ,python-2))) | |
dc138d6d MB |
78 | (native-search-paths |
79 | ;; Note: This search path is respected by the `curl` command-line tool only. | |
80 | ;; Ideally we would bake this into libcurl itself so other users can benefit, | |
81 | ;; but it's not supported upstream due to thread safety concerns. | |
82 | (list (search-path-specification | |
83 | (variable "CURL_CA_BUNDLE") | |
84 | (file-type 'regular) | |
85 | (separator #f) ;single entry | |
86 | (files '("etc/ssl/certs/ca-certificates.crt"))))) | |
6b9105e5 | 87 | (arguments |
7b844100 MB |
88 | `(#:configure-flags '("--with-gnutls" "--with-gssapi" |
89 | "--disable-static") | |
c0e57fb8 SHT |
90 | ;; Add a phase to patch '/bin/sh' occurances in tests/runtests.pl |
91 | #:phases | |
5625adfc | 92 | (modify-phases %standard-phases |
9d9847e1 LC |
93 | (add-after |
94 | 'install 'move-man3-pages | |
95 | (lambda* (#:key outputs #:allow-other-keys) | |
96 | ;; Move section 3 man pages to "doc". | |
97 | (let ((out (assoc-ref outputs "out")) | |
98 | (doc (assoc-ref outputs "doc"))) | |
99 | (mkdir-p (string-append doc "/share/man")) | |
100 | (rename-file (string-append out "/share/man/man3") | |
101 | (string-append doc "/share/man/man3")) | |
102 | #t))) | |
5625adfc LC |
103 | (replace |
104 | 'check | |
105 | (lambda _ | |
106 | (substitute* "tests/runtests.pl" | |
107 | (("/bin/sh") (which "sh"))) | |
186de634 | 108 | |
5625adfc LC |
109 | ;; XXX FIXME: Test #1510 seems to work on some machines and not |
110 | ;; others, possibly based on the kernel version. It works on GuixSD | |
111 | ;; on x86_64 with linux-libre-4.1, but fails on Hydra for both i686 | |
112 | ;; and x86_64 with the following error: | |
113 | ;; | |
114 | ;; test 1510...[HTTP GET connection cache limit (CURLOPT_MAXCONNECTS)] | |
115 | ;; | |
116 | ;; 1510: output (log/stderr1510) FAILED: | |
a124bbd2 SB |
117 | ;; --- log/check-expected 2015-06-27 07:45:53.166720834 +0000 |
118 | ;; +++ log/check-generated 2015-06-27 07:45:53.166720834 +0000 | |
5625adfc LC |
119 | ;; @@ -1,5 +1,5 @@ |
120 | ;; * Connection #0 to host server1.example.com left intact[LF] | |
121 | ;; * Connection #1 to host server2.example.com left intact[LF] | |
122 | ;; * Connection #2 to host server3.example.com left intact[LF] | |
123 | ;; -* Closing connection 0[LF] | |
124 | ;; +* Closing connection 1[LF] | |
125 | ;; * Connection #3 to host server4.example.com left intact[LF] | |
126 | (delete-file "tests/data/test1510") | |
d2e3caba | 127 | |
5625adfc LC |
128 | ;; The top-level "make check" does "make -C tests quiet-test", which |
129 | ;; is too quiet. Use the "test" target instead, which is more | |
130 | ;; verbose. | |
fac441b3 | 131 | (invoke "make" "-C" "tests" "test")))))) |
35b9e423 | 132 | (synopsis "Command line tool for transferring data with URL syntax") |
6b9105e5 AE |
133 | (description |
134 | "curl is a command line tool for transferring data with URL syntax, | |
135 | supporting DICT, FILE, FTP, FTPS, Gopher, HTTP, HTTPS, IMAP, IMAPS, LDAP, | |
136 | LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, Telnet and TFTP. | |
7c125ce0 AK |
137 | curl supports SSL certificates, HTTP POST, HTTP PUT, FTP uploading, HTTP |
138 | form based upload, proxies, cookies, file transfer resume, user+password | |
139 | authentication (Basic, Digest, NTLM, Negotiate, kerberos...), proxy | |
140 | tunneling, and so on.") | |
166191b3 | 141 | (license (license:non-copyleft "file://COPYING" |
7c125ce0 | 142 | "See COPYING in the distribution.")) |
14251e30 | 143 | (home-page "https://curl.haxx.se/"))) |
e1444afa | 144 | |
c438e0cc | 145 | (define-public curl-7.62.0 |
e1444afa LF |
146 | (package |
147 | (inherit curl) | |
c438e0cc | 148 | (version "7.62.0") |
e1444afa LF |
149 | (source |
150 | (origin | |
151 | (method url-fetch) | |
152 | (uri (string-append "https://curl.haxx.se/download/curl-" | |
79d95250 | 153 | version ".tar.xz")) |
e1444afa LF |
154 | (sha256 |
155 | (base32 | |
c438e0cc | 156 | "1hbm29r3pirhn4gkcnd94ylc4jzgn3v3v7qbay9awxg7bwx69dfs")))))) |
8de9d532 LF |
157 | |
158 | (define-public kurly | |
159 | (package | |
160 | (name "kurly") | |
ea6937ad | 161 | (version "1.2.2") |
8de9d532 LF |
162 | (source (origin |
163 | (method git-fetch) | |
164 | (uri (git-reference | |
ea6937ad | 165 | (url "https://gitlab.com/davidjpeacock/kurly.git") |
8de9d532 | 166 | (commit (string-append "v" version)))) |
c2c04cde | 167 | (file-name (git-file-name name version)) |
8de9d532 LF |
168 | (sha256 |
169 | (base32 | |
ea6937ad | 170 | "003jv2k45hg2svhjpy5253ccd250vi2r17x2zhm51iw54kgwxipm")))) |
8de9d532 LF |
171 | (build-system go-build-system) |
172 | (arguments | |
ea6937ad | 173 | `(#:import-path "gitlab.com/davidjpeacock/kurly" |
4880fddd LF |
174 | #:install-source? #f |
175 | #:phases | |
176 | (modify-phases %standard-phases | |
fdcbe78b TGR |
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) | |
ea6937ad | 186 | (copy-file "doc/kurly.man" |
fdcbe78b | 187 | (string-append man "/kurly.1"))) |
4880fddd | 188 | #t)))))) |
8de9d532 LF |
189 | (inputs |
190 | `(("go-github-com-alsm-ioprogress" ,go-github-com-alsm-ioprogress) | |
191 | ("go-github-com-aki237-nscjar" ,go-github-com-aki237-nscjar) | |
ea6937ad | 192 | ("go-github-com-urfave-cli" ,go-github-com-urfave-cli))) |
8de9d532 LF |
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.") | |
ea6937ad | 199 | (home-page "https://gitlab.com/davidjpeacock/kurly") |
8de9d532 | 200 | (license license:asl2.0))) |
5e3010a2 RJ |
201 | |
202 | (define-public guile-curl | |
203 | (package | |
204 | (name "guile-curl") | |
205 | (version "0.5") | |
206 | (source (origin | |
207 | (method url-fetch) | |
208 | (uri (string-append | |
209 | "http://www.lonelycactus.com/tarball/guile-curl-" | |
210 | version ".tar.gz")) | |
211 | (sha256 | |
212 | (base32 | |
213 | "1846rxgc0ylh8768lr79irc7nwjichzb7qb7lzs2k42m0i53sc46")))) | |
214 | (build-system gnu-build-system) | |
215 | (arguments | |
216 | `(#:configure-flags (list (string-append | |
217 | "--with-guilesitedir=" | |
218 | (assoc-ref %outputs "out") | |
219 | "/share/guile/site/2.2") | |
220 | (string-append | |
221 | "-with-guileextensiondir=" | |
222 | (assoc-ref %outputs "out") | |
223 | "/lib/guile/2.2/extensions")) | |
224 | #:phases | |
225 | (modify-phases %standard-phases | |
226 | (add-after 'install 'patch-extension-path | |
227 | (lambda* (#:key outputs #:allow-other-keys) | |
228 | (let* ((out (assoc-ref outputs "out")) | |
229 | (curl.scm (string-append | |
230 | out "/share/guile/site/2.2/curl.scm")) | |
231 | (curl.go (string-append | |
232 | out "/lib/guile/2.2/site-ccache/curl.go")) | |
233 | (ext (string-append out "/lib/guile/2.2/" | |
234 | "extensions/libguile-curl"))) | |
235 | (substitute* curl.scm (("libguile-curl") ext)) | |
236 | ;; The build system does not actually compile the Scheme module. | |
237 | ;; So we can compile it and put it in the right place in one go. | |
d28e5ad2 | 238 | (invoke "guild" "compile" curl.scm "-o" curl.go))))))) |
5e3010a2 RJ |
239 | (native-inputs `(("pkg-config" ,pkg-config))) |
240 | (inputs | |
241 | `(("curl" ,curl) | |
242 | ("guile" ,guile-2.2))) | |
243 | (home-page "http://www.lonelycactus.com/guile-curl.html") | |
244 | (synopsis "Curl bindings for Guile") | |
245 | (description "@code{guile-curl} is a project that has procedures that allow | |
246 | Guile to do client-side URL transfers, like requesting documents from HTTP or | |
247 | FTP servers. It is based on the curl library.") | |
248 | (license license:gpl3+))) |