| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 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.21.0")
|
| 73 | (source (origin
|
| 74 | (method url-fetch)
|
| 75 | (uri (string-append "https://curl.se/download/curl-"
|
| 76 | version ".tar.xz"))
|
| 77 | (sha256
|
| 78 | (base32
|
| 79 | "1rkjzj3sr4zvvwx41aqjwlfmdbh8dij4b1sh4k33vs5c1sknc6xa"))
|
| 80 | (patches (search-patches "curl-use-ssl-cert-env.patch"))))
|
| 81 | (outputs '("out"
|
| 82 | "doc")) |
| 83 | (build-system gnu-build-system)
|
| 84 | (arguments
|
| 85 | (list
|
| 86 | #:disallowed-references '("doc")
|
| 87 | #:configure-flags
|
| 88 | #~(list "--with-gnutls"
|
| 89 | (string-append "--with-gssapi="
|
| 90 | (dirname (dirname
|
| 91 | (search-input-file
|
| 92 | %build-inputs "lib/libgssrpc.so"))))
|
| 93 | "--disable-static")
|
| 94 | #:test-target "test-nonflaky" |
| 95 | #:phases
|
| 96 | #~(modify-phases %standard-phases
|
| 97 | (add-after 'unpack 'do-not-record-configure-flags
|
| 98 | (lambda _
|
| 99 | |
| 100 | (substitute* "curl-config.in"
|
| 101 | (("@CONFIGURE_OPTIONS@")
|
| 102 | "\"not available\""))))
|
| 103 | (add-after 'install 'move-man3-pages
|
| 104 | (lambda _
|
| 105 | |
| 106 | (mkdir-p (string-append #$output:doc "/share/man"))
|
| 107 | (rename-file (string-append #$output "/share/man/man3")
|
| 108 | (string-append #$output:doc "/share/man/man3"))))
|
| 109 | (add-after 'unpack 'patch-runtests
|
| 110 | (lambda _
|
| 111 | (substitute* "tests/runtests.pl"
|
| 112 | (("/bin/sh") (which "sh")))))
|
| 113 | #$@(if (or (target-arm32?)
|
| 114 | (target-aarch64?))
|
| 115 | #~((add-after 'unpack 'skip-tests
|
| 116 | (lambda _
|
| 117 | (let ((port (open-file "tests/data/DISABLED" "a")))
|
| 118 | (display "1474\n" port)
|
| 119 | (close port)))))
|
| 120 | #~())
|
| 121 | #$@(if (system-hurd?)
|
| 122 | #~((add-after 'unpack 'skip-tests/hurd
|
| 123 | (lambda _
|
| 124 | (let ((port (open-file "tests/data/DISABLED" "a")))
|
| 125 | (display "526\n" port)
|
| 126 | (display "527\n" port)
|
| 127 | (display "532\n" port)
|
| 128 | (display "533\n" port)
|
| 129 | (display "537\n" port)
|
| 130 | (display "546\n" port)
|
| 131 | (display "564\n" port)
|
| 132 | (display "575\n" port)
|
| 133 | (display "1021\n" port)
|
| 134 | (display "1474\n" port)
|
| 135 | (display "1501\n" port)
|
| 136 | (display "1541\n" port) |
| 137 | |
| 138 | |
| 139 | (display "1700\n" port)
|
| 140 | (display "1701\n" port)
|
| 141 | (display "1702\n" port)
|
| 142 | (display "2402\n" port)
|
| 143 | (display "2403\n" port)
|
| 144 | (display "2404\n" port)
|
| 145 | (close port)))))
|
| 146 | #~())
|
| 147 | (add-after 'install 'sanitize-libcurl.pc
|
| 148 | (lambda _
|
| 149 | |
| 150 | |
| 151 | |
| 152 | (substitute* (string-append #$output "/lib/pkgconfig/libcurl.pc")
|
| 153 | (("^Requires.private:.*") "")))))))
|
| 154 | (native-inputs
|
| 155 | (list nghttp2 perl pkg-config python-minimal-wrapper
|
| 156 | openssl)) |
| 157 | (inputs
|
| 158 | (list gnutls libidn libpsl mit-krb5 `(,nghttp2 "lib") zlib))
|
| 159 | (native-search-paths
|
| 160 | |
| 161 | (list $SSL_CERT_DIR
|
| 162 | $SSL_CERT_FILE
|
| 163 | |
| 164 | |
| 165 | |
| 166 | (search-path-specification
|
| 167 | (variable "CURL_CA_BUNDLE")
|
| 168 | (file-type 'regular)
|
| 169 | (separator #f) |
| 170 | (files '("etc/ssl/certs/ca-certificates.crt")))))
|
| 171 | (synopsis "Command line tool for transferring data with URL syntax")
|
| 172 | (description
|
| 173 | "curl is a command line tool for transferring data with URL syntax,
|
| 174 | supporting DICT, FILE, FTP, FTPS, Gopher, HTTP, HTTPS, IMAP, IMAPS, LDAP,
|
| 175 | LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, Telnet and TFTP.
|
| 176 | curl supports SSL certificates, HTTP POST, HTTP PUT, FTP uploading, HTTP
|
| 177 | form based upload, proxies, cookies, file transfer resume, user+password
|
| 178 | authentication (Basic, Digest, NTLM, Negotiate, kerberos...), proxy
|
| 179 | tunneling, and so on.")
|
| 180 | (home-page "https://curl.se/")
|
| 181 | (license (license:non-copyleft "file://COPYING"
|
| 182 | "See COPYING in the distribution."))))
|
| 183 |
|
| 184 | (define-public curl-ssh
|
| 185 | (package/inherit curl
|
| 186 | (arguments
|
| 187 | (substitute-keyword-arguments arguments
|
| 188 | ((#:configure-flags flags)
|
| 189 | #~(cons "--with-libssh2" #$flags))))
|
| 190 | (inputs
|
| 191 | (modify-inputs inputs
|
| 192 | (prepend libssh2)))
|
| 193 | (properties `((hidden? . #t)))))
|
| 194 |
|
| 195 | |
| 196 | (define-public kurly
|
| 197 | (package
|
| 198 | (name "kurly")
|
| 199 | (version "1.2.2")
|
| 200 | (source
|
| 201 | (origin
|
| 202 | (method git-fetch)
|
| 203 | (uri (git-reference
|
| 204 | (url "https://gitlab.com/davidjpeacock/kurly")
|
| 205 | (commit (string-append "v" version))))
|
| 206 | (file-name (git-file-name name version))
|
| 207 | (sha256
|
| 208 | (base32 "003jv2k45hg2svhjpy5253ccd250vi2r17x2zhm51iw54kgwxipm"))))
|
| 209 | (build-system go-build-system)
|
| 210 | (arguments
|
| 211 | (list
|
| 212 | #:install-source? #f
|
| 213 | #:import-path "gitlab.com/davidjpeacock/kurly"
|
| 214 | #:phases
|
| 215 | #~(modify-phases %standard-phases
|
| 216 | (add-after 'install 'install-documentation
|
| 217 | (lambda* (#:key import-path #:allow-other-keys)
|
| 218 | (let* ((source (string-append "src/" import-path))
|
| 219 | (doc (string-append #$output "/share/doc/"
|
| 220 | #$name "-" #$version))
|
| 221 | (man (string-append #$output "/share/man/man1")))
|
| 222 | (with-directory-excursion source
|
| 223 | (install-file "README.md" doc)
|
| 224 | (mkdir-p man)
|
| 225 | (copy-file "doc/kurly.man"
|
| 226 | (string-append man "/kurly.1")))))))))
|
| 227 | (inputs
|
| 228 | (list go-github-com-alsm-ioprogress
|
| 229 | go-github-com-aki237-nscjar
|
| 230 | go-github-com-urfave-cli))
|
| 231 | (home-page "https://gitlab.com/davidjpeacock/kurly")
|
| 232 | (synopsis "Command-line HTTP client")
|
| 233 | (description
|
| 234 | "kurly is an alternative to the @code{curl} program written in Go. kurly
|
| 235 | is designed to operate in a similar manner to curl, with select features.
|
| 236 | Notably, kurly is not aiming for feature parity, but common flags and
|
| 237 | mechanisms particularly within the HTTP(S) realm are to be expected. kurly
|
| 238 | does not offer a replacement for libcurl.")
|
| 239 | (license license:asl2.0)))
|
| 240 |
|
| 241 | (define-public guile-curl
|
| 242 | (package
|
| 243 | (name "guile-curl")
|
| 244 | (version "0.9")
|
| 245 | (source (origin
|
| 246 | (method url-fetch)
|
| 247 | (uri (string-append "http://www.lonelycactus.com/tarball/"
|
| 248 | "guile_curl-" version ".tar.gz"))
|
| 249 | (sha256
|
| 250 | (base32
|
| 251 | "0y7wfhilfm6vzs0wyifrrc2pj9nsxfas905c7qa5cw4i6s74ypmi"))))
|
| 252 | (build-system gnu-build-system)
|
| 253 | (arguments
|
| 254 | `(#:modules (((guix build guile-build-system)
|
| 255 | #:select (target-guile-effective-version))
|
| 256 | ,@%default-gnu-modules)
|
| 257 | #:imported-modules ((guix build guile-build-system)
|
| 258 | ,@%default-gnu-imported-modules)
|
| 259 | #:configure-flags (list (string-append
|
| 260 | "--with-guilesitedir="
|
| 261 | (assoc-ref %outputs "out")
|
| 262 | "/share/guile/site/"
|
| 263 | (target-guile-effective-version
|
| 264 | (assoc-ref %build-inputs "guile")))
|
| 265 | (string-append
|
| 266 | "-with-guileextensiondir="
|
| 267 | (assoc-ref %outputs "out")
|
| 268 | "/lib/guile/"
|
| 269 | (target-guile-effective-version
|
| 270 | (assoc-ref %build-inputs "guile"))
|
| 271 | "/extensions"))
|
| 272 | #:phases
|
| 273 | (modify-phases %standard-phases
|
| 274 | (add-after 'unpack 'patch-undefined-references
|
| 275 | (lambda* _
|
| 276 | (substitute* "module/curl.scm"
|
| 277 | |
| 278 | |
| 279 | ((",CURLOPT_HAPROXYPROTOCOL") "#f")
|
| 280 | ((",CURLOPT_DISALLOW_USERNAME_IN_URL") "#f")
|
| 281 | ((",CURLOPT_TIMEVALUE_LARGE") "#f")
|
| 282 | ((",CURLOPT_DNS_SHUFFLE_ADDRESSES") "#f")
|
| 283 | ((",CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS") "#f"))))
|
| 284 | (add-after 'install 'patch-extension-path
|
| 285 | (lambda* (#:key outputs #:allow-other-keys)
|
| 286 | (let* ((out (assoc-ref outputs "out"))
|
| 287 | (curl.scm (string-append
|
| 288 | out "/share/guile/site/"
|
| 289 | (target-guile-effective-version)
|
| 290 | "/curl.scm"))
|
| 291 | (curl.go (string-append
|
| 292 | out "/lib/guile/"
|
| 293 | (target-guile-effective-version)
|
| 294 | "/site-ccache/curl.go"))
|
| 295 | (ext (string-append out "/lib/guile/"
|
| 296 | (target-guile-effective-version)
|
| 297 | "/extensions/libguile-curl")))
|
| 298 | (substitute* curl.scm (("libguile-curl") ext))
|
| 299 | |
| 300 | |
| 301 | (invoke "guild" "compile" curl.scm "-o" curl.go)))))))
|
| 302 | (native-inputs (list pkg-config))
|
| 303 | (inputs
|
| 304 | (list curl guile-3.0))
|
| 305 | (home-page "http://www.lonelycactus.com/guile-curl.html")
|
| 306 | (synopsis "Curl bindings for Guile")
|
| 307 | (description "@code{guile-curl} is a project that has procedures that allow
|
| 308 | Guile to do client-side URL transfers, like requesting documents from HTTP or
|
| 309 | FTP servers. It is based on the curl library.")
|
| 310 | (license license:gpl3+)))
|
| 311 |
|
| 312 | (define-public guile2.2-curl
|
| 313 | (package
|
| 314 | (inherit guile-curl)
|
| 315 | (name "guile2.2-curl")
|
| 316 | (inputs
|
| 317 | (list curl guile-2.2))))
|
| 318 |
|
| 319 | (define-public curlpp
|
| 320 | (package
|
| 321 | (name "curlpp")
|
| 322 | (version "0.8.1")
|
| 323 | (source
|
| 324 | (origin
|
| 325 | (method git-fetch)
|
| 326 | (uri (git-reference
|
| 327 | (url "https://github.com/jpbarrette/curlpp")
|
| 328 | (commit (string-append "v" version))))
|
| 329 | (sha256
|
| 330 | (base32 "1b0ylnnrhdax4kwjq64r1fk0i24n5ss6zfzf4hxwgslny01xiwrk"))
|
| 331 | (file-name (git-file-name name version))))
|
| 332 | (build-system cmake-build-system)
|
| 333 | |
| 334 | (arguments
|
| 335 | '(#:tests? #f))
|
| 336 | |
| 337 | (propagated-inputs
|
| 338 | (list curl))
|
| 339 | (synopsis "C++ wrapper around libcURL")
|
| 340 | (description
|
| 341 | "This package provides a free and easy-to-use client-side C++ URL
|
| 342 | transfer library, supporting FTP, FTPS, HTTP, HTTPS, GOPHER, TELNET, DICT,
|
| 343 | FILE and LDAP; in particular it supports HTTPS certificates, HTTP POST, HTTP
|
| 344 | PUT, FTP uploading, kerberos, HTTP form based upload, proxies, cookies,
|
| 345 | user+password authentication, file transfer resume, http proxy tunneling and
|
| 346 | more!")
|
| 347 | (home-page "https://www.curlpp.org")
|
| 348 | (license license:expat)))
|
| 349 |
|
| 350 | (define-public h2c
|
| 351 | (package
|
| 352 | (name "h2c")
|
| 353 | (version "1.0")
|
| 354 | (source
|
| 355 | (origin
|
| 356 | (method git-fetch)
|
| 357 | (uri (git-reference
|
| 358 | (url "https://github.com/curl/h2c")
|
| 359 | (commit version)))
|
| 360 | (sha256
|
| 361 | (base32
|
| 362 | "1n8z6avzhg3yb330di2y9zymsps1qp1235p29kidcp4fkmn7fgb2"))
|
| 363 | (file-name (git-file-name name version))))
|
| 364 | (build-system copy-build-system)
|
| 365 | (arguments
|
| 366 | '(#:install-plan
|
| 367 | '(("./h2c" "bin/"))))
|
| 368 | (inputs
|
| 369 | (list perl))
|
| 370 | (home-page "https://curl.se/h2c/")
|
| 371 | (synopsis "Convert HTTP headers to a curl command line")
|
| 372 | (description
|
| 373 | "Provided a set of HTTP request headers, h2c outputs how to invoke
|
| 374 | curl to obtain exactly that HTTP request.")
|
| 375 | (properties `((lint-hidden-cpe-vendors . ("golang"))))
|
| 376 | (license license:expat)))
|
| 377 |
|
| 378 | (define-public coeurl
|
| 379 | (package
|
| 380 | (name "coeurl")
|
| 381 | (version "0.3.1")
|
| 382 | (source
|
| 383 | (origin
|
| 384 | (method git-fetch)
|
| 385 | (uri (git-reference
|
| 386 | (url "https://nheko.im/nheko-reborn/coeurl")
|
| 387 | (commit (string-append "v" version))))
|
| 388 | (file-name (git-file-name name version))
|
| 389 | (sha256
|
| 390 | (base32 "1l9lx8chpc4bx7xxycdgr8mgqqjdrvipljmq869c2x1zjwrnasil"))))
|
| 391 | (build-system meson-build-system)
|
| 392 | (native-inputs
|
| 393 | (list doctest pkg-config))
|
| 394 | (inputs
|
| 395 | (list curl libevent spdlog))
|
| 396 | (home-page "https://nheko.im/nheko-reborn/coeurl")
|
| 397 | (synopsis "Simple async wrapper around CURL for C++")
|
| 398 | (description "Coeurl is a simple library to do HTTP requests
|
| 399 | asynchronously via cURL in C++.")
|
| 400 | (license license:expat)))
|
| 401 |
|
| 402 | (define-public curlie
|
| 403 | (package
|
| 404 | (name "curlie")
|
| 405 | (version "1.8.2")
|
| 406 | (source
|
| 407 | (origin
|
| 408 | (method git-fetch)
|
| 409 | (uri (git-reference
|
| 410 | (url "https://github.com/rs/curlie")
|
| 411 | (commit (string-append "v" version))))
|
| 412 | (file-name (git-file-name name version))
|
| 413 | (sha256
|
| 414 | (base32
|
| 415 | "0jfqx7lfia7s1w438i5ngqvlhi2il04wi0p2fcw4b1iq5474hnh6"))))
|
| 416 | (build-system go-build-system)
|
| 417 | (arguments
|
| 418 | (list #:install-source? #f
|
| 419 | #:import-path "github.com/rs/curlie"))
|
| 420 | (inputs (list curl
|
| 421 | go-golang-org-x-sys
|
| 422 | go-golang-org-x-term))
|
| 423 | (home-page "https://rs.github.io/curlie")
|
| 424 | (synopsis "The power of curl, the ease of use of httpie")
|
| 425 | (description "If you like the interface of HTTPie but miss the features of
|
| 426 | curl, curlie is what you are searching for. Curlie is a frontend to
|
| 427 | @code{curl} that adds the ease of use of @code{httpie}, without compromising
|
| 428 | on features and performance. All @code{curl} options are exposed with syntax
|
| 429 | sugar and output formatting inspired from @code{httpie}.")
|
| 430 | (license license:expat)))
|
| 431 |
|
| 432 | (define-public trurl
|
| 433 | (package
|
| 434 | (name "trurl")
|
| 435 | (version "0.16.1")
|
| 436 | (source
|
| 437 | (origin
|
| 438 | (method git-fetch)
|
| 439 | (uri (git-reference
|
| 440 | (url "https://github.com/curl/trurl")
|
| 441 | (commit (string-append name "-" version))))
|
| 442 | (file-name (git-file-name name version))
|
| 443 | (sha256
|
| 444 | (base32 "1zdq81smm9ddqcmvwpcm01nf812fr8p4g6i2raxv3s0rd3hi68sl"))
|
| 445 | (patches
|
| 446 | |
| 447 | |
| 448 | |
| 449 | |
| 450 | |
| 451 | (search-patches "trurl-fix-hex-expected-case.patch"
|
| 452 | "trurl-fix-tests-for-newer-libcurl.patch"
|
| 453 | "trurl-mark-additional-tests-case-sensitive.patch"))))
|
| 454 | (build-system gnu-build-system)
|
| 455 | (arguments
|
| 456 | (list
|
| 457 | #:test-target "test"
|
| 458 | #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
|
| 459 | (string-append "PREFIX=" #$output))
|
| 460 | #:phases
|
| 461 | #~(modify-phases %standard-phases
|
| 462 | (delete 'configure))))
|
| 463 | (native-inputs (list python-minimal perl))
|
| 464 | (inputs (list curl))
|
| 465 | (home-page "https://curl.se/trurl/")
|
| 466 | (synopsis "Command line tool for URL parsing and manipulation")
|
| 467 | (description "@code{trurl} is a command line tool that parses and
|
| 468 | manipulates URLs, designed to help shell script authors everywhere.
|
| 469 |
|
| 470 | It is similar in spirit to @code{tr}. Here, @code{tr} stands for translate or
|
| 471 | transpose.")
|
| 472 | (license (license:non-copyleft "file://COPYING"
|
| 473 | "See COPYING in the distribution."))))
|