projects/guix·blob java-team · refs

483 lines · 19.8 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013, 2014, 2015 Andreas Enge <[email protected]>
3;;; Copyright © 2015 Mark H Weaver <[email protected]>
4;;; Copyright © 2015 Tomáš Čech <[email protected]>
5;;; Copyright © 2015, 2020, 2021, 2022 Ludovic Courtès <[email protected]>
6;;; Copyright © 2016, 2017, 2019 Leo Famulari <[email protected]>
7;;; Copyright © 2017, 2019, 2020, 2022 Marius Bakke <[email protected]>
8;;; Copyright © 2017, 2023, 2024 Efraim Flashner <[email protected]>
9;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <[email protected]>
10;;; Copyright © 2018 Roel Janssen <[email protected]>
11;;; Copyright © 2019, 2021 Ricardo Wurmus <[email protected]>
12;;; Copyright © 2020 Jakub Kądziołka <[email protected]>
13;;; Copyright © 2020 Dale Mellor <[email protected]>
14;;; Copyright © 2020, 2023 Janneke Nieuwenhuizen <[email protected]>
15;;; Copyright © 2021 Jean-Baptiste Volatier <[email protected]>
16;;; Copyright © 2021 Felix Gruber <[email protected]>
17;;; Copyright © 2023 Sharlatan Hellseher <[email protected]>
18;;; Copyright © 2023 John Kehayias <[email protected]>
19;;; Copyright © 2024 Ashish SHUKLA <[email protected]>
20;;; Copyright © 2026 Artyom V. Poptsov <[email protected]>
21;;;
22;;; This file is part of GNU Guix.
23;;;
24;;; GNU Guix is free software; you can redistribute it and/or modify it
25;;; under the terms of the GNU General Public License as published by
26;;; the Free Software Foundation; either version 3 of the License, or (at
27;;; your option) any later version.
28;;;
29;;; GNU Guix is distributed in the hope that it will be useful, but
30;;; WITHOUT ANY WARRANTY; without even the implied warranty of
31;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32;;; GNU General Public License for more details.
33;;;
34;;; You should have received a copy of the GNU General Public License
35;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
36
37(define-module (gnu packages curl)
38 #:use-module ((guix licenses) #:prefix license:)
39 #:use-module (guix packages)
40 #:use-module (guix gexp)
41 #:use-module (guix download)
42 #:use-module (guix git-download)
43 #:use-module (guix utils)
44 #:use-module (guix build-system cmake)
45 #:use-module (guix build-system copy)
46 #:use-module (guix build-system gnu)
47 #:use-module (guix build-system go)
48 #:use-module (guix build-system meson)
49 #:use-module ((guix search-paths) #:select ($SSL_CERT_DIR $SSL_CERT_FILE))
50 #:use-module (gnu packages)
51 #:use-module (gnu packages check)
52 #:use-module (gnu packages compression)
53 #:use-module (gnu packages golang-build)
54 #:use-module (gnu packages golang-web)
55 #:use-module (gnu packages golang-xyz)
56 #:use-module (gnu packages guile)
57 #:use-module (gnu packages kerberos)
58 #:use-module (gnu packages logging)
59 #:use-module (gnu packages libevent)
60 #:use-module (gnu packages libidn)
61 #:use-module (gnu packages perl)
62 #:use-module (gnu packages pkg-config)
63 #:use-module (gnu packages python)
64 #:use-module (gnu packages ssh)
65 #:use-module (gnu packages tls)
66 #:use-module (gnu packages web)
67 #:use-module (srfi srfi-1))
68
69(define-public curl
70 (package
71 (name "curl")
72 (version "8.20.0")
73 (replacement curl/fixed)
74 (source (origin
75 (method url-fetch)
76 (uri (string-append "https://curl.se/download/curl-"
77 version ".tar.xz"))
78 (sha256
79 (base32
80 "15mqw8y9vdxlz9cpr2z7q9r6552wgs7q7vr2k7lfl35s930jvzk3"))
81 (patches (search-patches "curl-use-ssl-cert-env.patch"))))
82 (outputs '("out"
83 "doc")) ;1.2 MiB of man3 pages
84 (build-system gnu-build-system)
85 (arguments
86 (list
87 #:disallowed-references '("doc")
88 #:configure-flags
89 #~(list "--with-gnutls"
90 (string-append "--with-gssapi="
91 (dirname (dirname
92 (search-input-file
93 %build-inputs "lib/libgssrpc.so"))))
94 "--disable-static")
95 #:test-target "test-nonflaky" ;avoid tests marked as "flaky"
96 #:phases
97 #~(modify-phases %standard-phases
98 (add-after 'unpack 'do-not-record-configure-flags
99 (lambda _
100 ;; Do not save the configure options to avoid unnecessary references.
101 (substitute* "curl-config.in"
102 (("@CONFIGURE_OPTIONS@")
103 "\"not available\""))))
104 (add-after 'install 'move-man3-pages
105 (lambda _
106 ;; Move section 3 man pages to "doc".
107 (mkdir-p (string-append #$output:doc "/share/man"))
108 (rename-file (string-append #$output "/share/man/man3")
109 (string-append #$output:doc "/share/man/man3"))))
110 (add-after 'unpack 'patch-runtests
111 (lambda _
112 (substitute* "tests/runtests.pl"
113 (("/bin/sh") (which "sh")))))
114 #$@(if (or (target-arm32?)
115 (target-aarch64?))
116 #~((add-after 'unpack 'skip-tests
117 (lambda _
118 (let ((port (open-file "tests/data/DISABLED" "a")))
119 (display "1474\n" port)
120 (close port)))))
121 #~())
122 #$@(if (system-hurd?)
123 #~((add-after 'unpack 'skip-tests/hurd
124 (lambda _
125 (let ((port (open-file "tests/data/DISABLED" "a")))
126 (display "526\n" port)
127 (display "527\n" port)
128 (display "532\n" port)
129 (display "533\n" port)
130 (display "537\n" port)
131 (display "546\n" port)
132 (display "564\n" port)
133 (display "575\n" port)
134 (display "1021\n" port)
135 (display "1474\n" port)
136 (display "1501\n" port)
137 (display "1541\n" port) ;flaky
138 ;; These tests fail because the nghttp2 server
139 ;; version 1.69 after failure to set SO_REUSEPORT.
140 (display "1700\n" port)
141 (display "1701\n" port)
142 (display "1702\n" port)
143 (display "2402\n" port)
144 (display "2403\n" port)
145 (display "2404\n" port)
146 (close port)))))
147 #~())
148 (add-after 'install 'sanitize-libcurl.pc
149 (lambda _
150 ;; The pkgconfig file has all dependencies in Requires.private
151 ;; which is unnecessary for our shared library use and would
152 ;; require propagating them.
153 (substitute* (string-append #$output "/lib/pkgconfig/libcurl.pc")
154 (("^Requires.private:.*") "")))))))
155 (native-inputs
156 (list nghttp2 perl pkg-config python-minimal-wrapper
157 openssl)) ;for tests
158 (inputs
159 (list gnutls libidn libpsl mit-krb5 `(,nghttp2 "lib") zlib))
160 (native-search-paths
161 ;; These variables are introduced by curl-use-ssl-cert-env.patch.
162 (list $SSL_CERT_DIR
163 $SSL_CERT_FILE
164 ;; Note: This search path is respected by the `curl` command-line
165 ;; tool only. Patching libcurl to read it too would bring no
166 ;; advantages and require maintaining a more complex patch.
167 (search-path-specification
168 (variable "CURL_CA_BUNDLE")
169 (file-type 'regular)
170 (separator #f) ;single entry
171 (files '("etc/ssl/certs/ca-certificates.crt")))))
172 (synopsis "Command line tool for transferring data with URL syntax")
173 (description
174 "curl is a command line tool for transferring data with URL syntax,
175supporting DICT, FILE, FTP, FTPS, Gopher, HTTP, HTTPS, IMAP, IMAPS, LDAP,
176LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, Telnet and TFTP.
177curl supports SSL certificates, HTTP POST, HTTP PUT, FTP uploading, HTTP
178form based upload, proxies, cookies, file transfer resume, user+password
179authentication (Basic, Digest, NTLM, Negotiate, kerberos...), proxy
180tunneling, and so on.")
181 (home-page "https://curl.se/")
182 (license (license:non-copyleft "file://COPYING"
183 "See COPYING in the distribution."))))
184
185(define curl/fixed
186 (package
187 (inherit curl)
188 (name "curl")
189 (version "8.20.0")
190 (source (origin
191 (inherit (package-source curl))
192 (patches (search-patches "curl-use-ssl-cert-env.patch"
193 "curl-fix-wakeup-consumption.patch"))))))
194
195(define-public curl-ssh
196 (package/inherit curl
197 (arguments
198 (substitute-keyword-arguments arguments
199 ((#:configure-flags flags)
200 #~(cons "--with-libssh2" #$flags))))
201 (inputs
202 (modify-inputs inputs
203 (prepend libssh2)))
204 (properties `((hidden? . #t)))))
205
206;; XXX: It looks like unmaintained, last time updated in 2018.
207(define-public kurly
208 (package
209 (name "kurly")
210 (version "1.2.2")
211 (source
212 (origin
213 (method git-fetch)
214 (uri (git-reference
215 (url "https://gitlab.com/davidjpeacock/kurly")
216 (commit (string-append "v" version))))
217 (file-name (git-file-name name version))
218 (sha256
219 (base32 "003jv2k45hg2svhjpy5253ccd250vi2r17x2zhm51iw54kgwxipm"))))
220 (build-system go-build-system)
221 (arguments
222 (list
223 #:install-source? #f
224 #:import-path "gitlab.com/davidjpeacock/kurly"
225 #:phases
226 #~(modify-phases %standard-phases
227 (add-after 'install 'install-documentation
228 (lambda* (#:key import-path #:allow-other-keys)
229 (let* ((source (string-append "src/" import-path))
230 (doc (string-append #$output "/share/doc/"
231 #$name "-" #$version))
232 (man (string-append #$output "/share/man/man1")))
233 (with-directory-excursion source
234 (install-file "README.md" doc)
235 (mkdir-p man)
236 (copy-file "doc/kurly.man"
237 (string-append man "/kurly.1")))))))))
238 (inputs
239 (list go-github-com-alsm-ioprogress
240 go-github-com-aki237-nscjar
241 go-github-com-urfave-cli))
242 (home-page "https://gitlab.com/davidjpeacock/kurly")
243 (synopsis "Command-line HTTP client")
244 (description
245 "kurly is an alternative to the @code{curl} program written in Go. kurly
246is designed to operate in a similar manner to curl, with select features.
247Notably, kurly is not aiming for feature parity, but common flags and
248mechanisms particularly within the HTTP(S) realm are to be expected. kurly
249does not offer a replacement for libcurl.")
250 (license license:asl2.0)))
251
252(define-public guile-curl
253 (package
254 (name "guile-curl")
255 (version "0.9")
256 (source (origin
257 (method url-fetch)
258 (uri (string-append "http://www.lonelycactus.com/tarball/"
259 "guile_curl-" version ".tar.gz"))
260 (sha256
261 (base32
262 "0y7wfhilfm6vzs0wyifrrc2pj9nsxfas905c7qa5cw4i6s74ypmi"))))
263 (build-system gnu-build-system)
264 (arguments
265 `(#:modules (((guix build guile-build-system)
266 #:select (target-guile-effective-version))
267 ,@%default-gnu-modules)
268 #:imported-modules ((guix build guile-build-system)
269 ,@%default-gnu-imported-modules)
270 #:configure-flags (list (string-append
271 "--with-guilesitedir="
272 (assoc-ref %outputs "out")
273 "/share/guile/site/"
274 (target-guile-effective-version
275 (assoc-ref %build-inputs "guile")))
276 (string-append
277 "-with-guileextensiondir="
278 (assoc-ref %outputs "out")
279 "/lib/guile/"
280 (target-guile-effective-version
281 (assoc-ref %build-inputs "guile"))
282 "/extensions"))
283 #:phases
284 (modify-phases %standard-phases
285 (add-after 'unpack 'patch-undefined-references
286 (lambda* _
287 (substitute* "module/curl.scm"
288 ;; The following #defines are missing from our curl package
289 ;; and therefore result in the evaluation of undefined symbols.
290 ((",CURLOPT_HAPROXYPROTOCOL") "#f")
291 ((",CURLOPT_DISALLOW_USERNAME_IN_URL") "#f")
292 ((",CURLOPT_TIMEVALUE_LARGE") "#f")
293 ((",CURLOPT_DNS_SHUFFLE_ADDRESSES") "#f")
294 ((",CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS") "#f"))))
295 (add-after 'install 'patch-extension-path
296 (lambda* (#:key outputs #:allow-other-keys)
297 (let* ((out (assoc-ref outputs "out"))
298 (curl.scm (string-append
299 out "/share/guile/site/"
300 (target-guile-effective-version)
301 "/curl.scm"))
302 (curl.go (string-append
303 out "/lib/guile/"
304 (target-guile-effective-version)
305 "/site-ccache/curl.go"))
306 (ext (string-append out "/lib/guile/"
307 (target-guile-effective-version)
308 "/extensions/libguile-curl")))
309 (substitute* curl.scm (("libguile-curl") ext))
310 ;; The build system does not actually compile the Scheme module.
311 ;; So we can compile it and put it in the right place in one go.
312 (invoke "guild" "compile" curl.scm "-o" curl.go)))))))
313 (native-inputs (list pkg-config))
314 (inputs
315 (list curl guile-3.0))
316 (home-page "http://www.lonelycactus.com/guile-curl.html")
317 (synopsis "Curl bindings for Guile")
318 (description "@code{guile-curl} is a project that has procedures that allow
319Guile to do client-side URL transfers, like requesting documents from HTTP or
320FTP servers. It is based on the curl library.")
321 (license license:gpl3+)))
322
323(define-public guile2.2-curl
324 (package
325 (inherit guile-curl)
326 (name "guile2.2-curl")
327 (inputs
328 (list curl guile-2.2))))
329
330(define-public curlpp
331 (package
332 (name "curlpp")
333 (version "0.8.1")
334 (source
335 (origin
336 (method git-fetch)
337 (uri (git-reference
338 (url "https://github.com/jpbarrette/curlpp")
339 (commit (string-append "v" version))))
340 (sha256
341 (base32 "1b0ylnnrhdax4kwjq64r1fk0i24n5ss6zfzf4hxwgslny01xiwrk"))
342 (file-name (git-file-name name version))))
343 (build-system cmake-build-system)
344 ;; There are no build tests to be had.
345 (arguments
346 '(#:tests? #f))
347 ;; The installed version needs the header files from the C library.
348 (propagated-inputs
349 (list curl))
350 (synopsis "C++ wrapper around libcURL")
351 (description
352 "This package provides a free and easy-to-use client-side C++ URL
353transfer library, supporting FTP, FTPS, HTTP, HTTPS, GOPHER, TELNET, DICT,
354FILE and LDAP; in particular it supports HTTPS certificates, HTTP POST, HTTP
355PUT, FTP uploading, kerberos, HTTP form based upload, proxies, cookies,
356user+password authentication, file transfer resume, http proxy tunneling and
357more!")
358 (home-page "https://www.curlpp.org")
359 (license license:expat)))
360
361(define-public h2c
362 (package
363 (name "h2c")
364 (version "1.0")
365 (source
366 (origin
367 (method git-fetch)
368 (uri (git-reference
369 (url "https://github.com/curl/h2c")
370 (commit version)))
371 (sha256
372 (base32
373 "1n8z6avzhg3yb330di2y9zymsps1qp1235p29kidcp4fkmn7fgb2"))
374 (file-name (git-file-name name version))))
375 (build-system copy-build-system)
376 (arguments
377 '(#:install-plan
378 '(("./h2c" "bin/"))))
379 (inputs
380 (list perl))
381 (home-page "https://curl.se/h2c/")
382 (synopsis "Convert HTTP headers to a curl command line")
383 (description
384 "Provided a set of HTTP request headers, h2c outputs how to invoke
385curl to obtain exactly that HTTP request.")
386 (properties `((lint-hidden-cpe-vendors . ("golang"))))
387 (license license:expat)))
388
389(define-public coeurl
390 (package
391 (name "coeurl")
392 (version "0.3.1")
393 (source
394 (origin
395 (method git-fetch)
396 (uri (git-reference
397 (url "https://nheko.im/nheko-reborn/coeurl")
398 (commit (string-append "v" version))))
399 (file-name (git-file-name name version))
400 (sha256
401 (base32 "1l9lx8chpc4bx7xxycdgr8mgqqjdrvipljmq869c2x1zjwrnasil"))))
402 (build-system meson-build-system)
403 (native-inputs
404 (list doctest pkg-config))
405 (inputs
406 (list curl libevent spdlog))
407 (home-page "https://nheko.im/nheko-reborn/coeurl")
408 (synopsis "Simple async wrapper around CURL for C++")
409 (description "Coeurl is a simple library to do HTTP requests
410asynchronously via cURL in C++.")
411 (license license:expat)))
412
413(define-public curlie
414 (package
415 (name "curlie")
416 (version "1.8.2")
417 (source
418 (origin
419 (method git-fetch)
420 (uri (git-reference
421 (url "https://github.com/rs/curlie")
422 (commit (string-append "v" version))))
423 (file-name (git-file-name name version))
424 (sha256
425 (base32
426 "0jfqx7lfia7s1w438i5ngqvlhi2il04wi0p2fcw4b1iq5474hnh6"))))
427 (build-system go-build-system)
428 (arguments
429 (list #:install-source? #f
430 #:import-path "github.com/rs/curlie"))
431 (inputs (list curl
432 go-golang-org-x-sys
433 go-golang-org-x-term))
434 (home-page "https://rs.github.io/curlie")
435 (synopsis "The power of curl, the ease of use of httpie")
436 (description "If you like the interface of HTTPie but miss the features of
437curl, curlie is what you are searching for. Curlie is a frontend to
438@code{curl} that adds the ease of use of @code{httpie}, without compromising
439on features and performance. All @code{curl} options are exposed with syntax
440sugar and output formatting inspired from @code{httpie}.")
441 (license license:expat)))
442
443(define-public trurl
444 (package
445 (name "trurl")
446 (version "0.16.1")
447 (source
448 (origin
449 (method git-fetch)
450 (uri (git-reference
451 (url "https://github.com/curl/trurl")
452 (commit (string-append name "-" version))))
453 (file-name (git-file-name name version))
454 (sha256
455 (base32 "1zdq81smm9ddqcmvwpcm01nf812fr8p4g6i2raxv3s0rd3hi68sl"))
456 (patches
457 ;; Some tests are failing due to case sensitivity in curl 8.20:
458 ;; <https://github.com/curl/trurl/issues/440>
459 ;;
460 ;; Those patches are from Debian:
461 ;; <https://salsa.debian.org/debian/trurl/-/tree/debian/latest/debian/patches>
462 (search-patches "trurl-fix-tests-for-newer-libcurl.patch"
463 "trurl-mark-additional-tests-case-sensitive.patch"))))
464 (build-system gnu-build-system)
465 (arguments
466 (list
467 #:test-target "test"
468 #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
469 (string-append "PREFIX=" #$output))
470 #:phases
471 #~(modify-phases %standard-phases
472 (delete 'configure))))
473 (native-inputs (list python-minimal perl))
474 (inputs (list curl))
475 (home-page "https://curl.se/trurl/")
476 (synopsis "Command line tool for URL parsing and manipulation")
477 (description "@code{trurl} is a command line tool that parses and
478manipulates URLs, designed to help shell script authors everywhere.
479
480It is similar in spirit to @code{tr}. Here, @code{tr} stands for translate or
481transpose.")
482 (license (license:non-copyleft "file://COPYING"
483 "See COPYING in the distribution."))))