gnu: cURL: Use G-expression.

...and reindent.

* gnu/packages/curl.scm (curl)[arguments]: Convert to G-expression.
(curl-ssh)[arguments]: Likewise.
This commit is contained in:
Marius Bakke 2022-08-29 13:00:56 +02:00
parent 9fe0131904
commit 0877f66987
No known key found for this signature in database
GPG key ID: A2A06DF2A33A54FA

View file

@ -62,90 +62,88 @@
(define-public curl (define-public curl
(package (package
(name "curl") (name "curl")
(version "7.84.0") (version "7.84.0")
(source (origin (source (origin
(method url-fetch) (method url-fetch)
(uri (string-append "https://curl.se/download/curl-" (uri (string-append "https://curl.se/download/curl-"
version ".tar.xz")) version ".tar.xz"))
(sha256 (sha256
(base32 (base32
"1f2xgj0wvys9xw50h7vcbaraavjr9rxx9n06x2xfbgs7ym1qn49d")) "1f2xgj0wvys9xw50h7vcbaraavjr9rxx9n06x2xfbgs7ym1qn49d"))
(patches (search-patches "curl-use-ssl-cert-env.patch" (patches (search-patches "curl-use-ssl-cert-env.patch"
"curl-easy-lock.patch")))) "curl-easy-lock.patch"))))
(build-system gnu-build-system) (build-system gnu-build-system)
(outputs '("out" (outputs '("out"
"doc")) ;1.2 MiB of man3 pages "doc")) ;1.2 MiB of man3 pages
(inputs (inputs
(list gnutls libidn mit-krb5 `(,nghttp2 "lib") zlib)) (list gnutls libidn mit-krb5 `(,nghttp2 "lib") zlib))
(native-inputs (native-inputs
(list nghttp2 perl pkg-config python-minimal-wrapper)) (list nghttp2 perl pkg-config python-minimal-wrapper))
(native-search-paths (native-search-paths
;; These variables are introduced by curl-use-ssl-cert-env.patch. ;; These variables are introduced by curl-use-ssl-cert-env.patch.
(list $SSL_CERT_DIR (list $SSL_CERT_DIR
$SSL_CERT_FILE $SSL_CERT_FILE
;; Note: This search path is respected by the `curl` command-line ;; Note: This search path is respected by the `curl` command-line
;; tool only. Patching libcurl to read it too would bring no ;; tool only. Patching libcurl to read it too would bring no
;; advantages and require maintaining a more complex patch. ;; advantages and require maintaining a more complex patch.
(search-path-specification (search-path-specification
(variable "CURL_CA_BUNDLE") (variable "CURL_CA_BUNDLE")
(file-type 'regular) (file-type 'regular)
(separator #f) ;single entry (separator #f) ;single entry
(files '("etc/ssl/certs/ca-certificates.crt"))))) (files '("etc/ssl/certs/ca-certificates.crt")))))
(arguments (arguments
`(#:disallowed-references ("doc") (list
#:configure-flags (list "--with-gnutls" #:disallowed-references '("doc")
(string-append "--with-gssapi=" #:configure-flags
(dirname (dirname #~(list "--with-gnutls"
(search-input-file (string-append "--with-gssapi="
%build-inputs (dirname (dirname
"lib/libgssrpc.so")))) (search-input-file
"--disable-static") %build-inputs "lib/libgssrpc.so"))))
"--disable-static")
#:phases #:phases
(modify-phases %standard-phases #~(modify-phases %standard-phases
(add-after 'unpack 'tweak-lib3026-test (add-after 'unpack 'tweak-lib3026-test
(lambda _ (lambda _
;; Have that test create a hundred threads, not a thousand. ;; Have that test create a hundred threads, not a thousand.
(substitute* "tests/libtest/lib3026.c" (substitute* "tests/libtest/lib3026.c"
(("NUM_THREADS .*$") (("NUM_THREADS .*$")
"NUM_THREADS 100\n")))) "NUM_THREADS 100\n"))))
(add-after 'unpack 'do-not-record-configure-flags (add-after 'unpack 'do-not-record-configure-flags
(lambda _ (lambda _
;; Do not save the configure options to avoid unnecessary references. ;; Do not save the configure options to avoid unnecessary references.
(substitute* "curl-config.in" (substitute* "curl-config.in"
(("@CONFIGURE_OPTIONS@") (("@CONFIGURE_OPTIONS@")
"\"not available\"")))) "\"not available\""))))
(add-after (add-after 'install 'move-man3-pages
'install 'move-man3-pages (lambda _
(lambda* (#:key outputs #:allow-other-keys) ;; Move section 3 man pages to "doc".
;; Move section 3 man pages to "doc". (mkdir-p (string-append #$output:doc "/share/man"))
(let ((out (assoc-ref outputs "out")) (rename-file (string-append #$output "/share/man/man3")
(doc (assoc-ref outputs "doc"))) (string-append #$output:doc "/share/man/man3"))))
(mkdir-p (string-append doc "/share/man")) (replace 'check
(rename-file (string-append out "/share/man/man3") (lambda* (#:key tests? #:allow-other-keys)
(string-append doc "/share/man/man3"))))) (substitute* "tests/runtests.pl"
(replace 'check (("/bin/sh") (which "sh")))
(lambda* (#:key tests? #:allow-other-keys)
(substitute* "tests/runtests.pl"
(("/bin/sh") (which "sh")))
(when tests? (when tests?
;; The top-level "make check" does "make -C tests quiet-test", which ;; The top-level "make check" does "make -C tests quiet-test", which
;; is too quiet. Use the "test" target instead, which is more ;; is too quiet. Use the "test" target instead, which is more
;; verbose. ;; verbose.
(invoke "make" "-C" "tests" "test"))))))) (invoke "make" "-C" "tests" "test")))))))
(synopsis "Command line tool for transferring data with URL syntax") (synopsis "Command line tool for transferring data with URL syntax")
(description (description
"curl is a command line tool for transferring data with URL syntax, "curl is a command line tool for transferring data with URL syntax,
supporting DICT, FILE, FTP, FTPS, Gopher, HTTP, HTTPS, IMAP, IMAPS, LDAP, supporting DICT, FILE, FTP, FTPS, Gopher, HTTP, HTTPS, IMAP, IMAPS, LDAP,
LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, Telnet and TFTP. LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, Telnet and TFTP.
curl supports SSL certificates, HTTP POST, HTTP PUT, FTP uploading, HTTP curl supports SSL certificates, HTTP POST, HTTP PUT, FTP uploading, HTTP
form based upload, proxies, cookies, file transfer resume, user+password form based upload, proxies, cookies, file transfer resume, user+password
authentication (Basic, Digest, NTLM, Negotiate, kerberos...), proxy authentication (Basic, Digest, NTLM, Negotiate, kerberos...), proxy
tunneling, and so on.") tunneling, and so on.")
(license (license:non-copyleft "file://COPYING" (license (license:non-copyleft "file://COPYING"
"See COPYING in the distribution.")) "See COPYING in the distribution."))
(home-page "https://curl.haxx.se/"))) (home-page "https://curl.haxx.se/")))
(define-public curl-minimal (define-public curl-minimal
(deprecated-package "curl-minimal" curl)) (deprecated-package "curl-minimal" curl))
@ -155,7 +153,7 @@ tunneling, and so on.")
(arguments (arguments
(substitute-keyword-arguments (package-arguments curl) (substitute-keyword-arguments (package-arguments curl)
((#:configure-flags flags) ((#:configure-flags flags)
`(cons "--with-libssh2" ,flags)))) #~(cons "--with-libssh2" #$flags))))
(inputs (inputs
(modify-inputs (package-inputs curl) (modify-inputs (package-inputs curl)
(prepend libssh2))) (prepend libssh2)))