curl.scm 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  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. ;;;
  9. ;;; This file is part of GNU Guix.
  10. ;;;
  11. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  12. ;;; under the terms of the GNU General Public License as published by
  13. ;;; the Free Software Foundation; either version 3 of the License, or (at
  14. ;;; your option) any later version.
  15. ;;;
  16. ;;; GNU Guix is distributed in the hope that it will be useful, but
  17. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  18. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. ;;; GNU General Public License for more details.
  20. ;;;
  21. ;;; You should have received a copy of the GNU General Public License
  22. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  23. (define-module (gnu packages curl)
  24. #:use-module ((guix licenses) #:prefix license:)
  25. #:use-module (guix packages)
  26. #:use-module (guix download)
  27. #:use-module (guix utils)
  28. #:use-module (guix build-system gnu)
  29. #:use-module (gnu packages)
  30. #:use-module (gnu packages compression)
  31. #:use-module (gnu packages groff)
  32. #:use-module (gnu packages gsasl)
  33. #:use-module (gnu packages libidn)
  34. #:use-module (gnu packages openldap)
  35. #:use-module (gnu packages perl)
  36. #:use-module (gnu packages pkg-config)
  37. #:use-module (gnu packages python)
  38. #:use-module (gnu packages ssh)
  39. #:use-module (gnu packages tls))
  40. (define-public curl
  41. (package
  42. (name "curl")
  43. (replacement curl-7.56.0)
  44. (version "7.54.1")
  45. (source (origin
  46. (method url-fetch)
  47. (uri (string-append "https://curl.haxx.se/download/curl-"
  48. version ".tar.lzma"))
  49. (sha256
  50. (base32
  51. "0vnv3cz0s1l5cjby86hm0x6pgzqijmdm97qa9q5px200956z6yib"))))
  52. (build-system gnu-build-system)
  53. (outputs '("out"
  54. "doc")) ;1.2 MiB of man3 pages
  55. (inputs `(("gnutls" ,gnutls)
  56. ("gss" ,gss)
  57. ("libidn" ,libidn)
  58. ("libssh2" ,libssh2)
  59. ("openldap" ,openldap)
  60. ("zlib" ,zlib)))
  61. (native-inputs
  62. `(("perl" ,perl)
  63. ;; to enable the --manual option and make test 1026 pass
  64. ("groff" ,groff)
  65. ("pkg-config" ,pkg-config)
  66. ("python" ,python-2)))
  67. (arguments
  68. `(#:configure-flags '("--with-gnutls" "--with-gssapi")
  69. ;; Add a phase to patch '/bin/sh' occurances in tests/runtests.pl
  70. #:phases
  71. (modify-phases %standard-phases
  72. (add-after
  73. 'install 'move-man3-pages
  74. (lambda* (#:key outputs #:allow-other-keys)
  75. ;; Move section 3 man pages to "doc".
  76. (let ((out (assoc-ref outputs "out"))
  77. (doc (assoc-ref outputs "doc")))
  78. (mkdir-p (string-append doc "/share/man"))
  79. (rename-file (string-append out "/share/man/man3")
  80. (string-append doc "/share/man/man3"))
  81. #t)))
  82. (replace
  83. 'check
  84. (lambda _
  85. (substitute* "tests/runtests.pl"
  86. (("/bin/sh") (which "sh")))
  87. ;; XXX FIXME: Test #1510 seems to work on some machines and not
  88. ;; others, possibly based on the kernel version. It works on GuixSD
  89. ;; on x86_64 with linux-libre-4.1, but fails on Hydra for both i686
  90. ;; and x86_64 with the following error:
  91. ;;
  92. ;; test 1510...[HTTP GET connection cache limit (CURLOPT_MAXCONNECTS)]
  93. ;;
  94. ;; 1510: output (log/stderr1510) FAILED:
  95. ;; --- log/check-expected 2015-06-27 07:45:53.166720834 +0000
  96. ;; +++ log/check-generated 2015-06-27 07:45:53.166720834 +0000
  97. ;; @@ -1,5 +1,5 @@
  98. ;; * Connection #0 to host server1.example.com left intact[LF]
  99. ;; * Connection #1 to host server2.example.com left intact[LF]
  100. ;; * Connection #2 to host server3.example.com left intact[LF]
  101. ;; -* Closing connection 0[LF]
  102. ;; +* Closing connection 1[LF]
  103. ;; * Connection #3 to host server4.example.com left intact[LF]
  104. (delete-file "tests/data/test1510")
  105. ;; The top-level "make check" does "make -C tests quiet-test", which
  106. ;; is too quiet. Use the "test" target instead, which is more
  107. ;; verbose.
  108. (zero? (system* "make" "-C" "tests" "test")))))))
  109. (synopsis "Command line tool for transferring data with URL syntax")
  110. (description
  111. "curl is a command line tool for transferring data with URL syntax,
  112. supporting DICT, FILE, FTP, FTPS, Gopher, HTTP, HTTPS, IMAP, IMAPS, LDAP,
  113. LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, Telnet and TFTP.
  114. curl supports SSL certificates, HTTP POST, HTTP PUT, FTP uploading, HTTP
  115. form based upload, proxies, cookies, file transfer resume, user+password
  116. authentication (Basic, Digest, NTLM, Negotiate, kerberos...), proxy
  117. tunneling, and so on.")
  118. (license (license:non-copyleft "file://COPYING"
  119. "See COPYING in the distribution."))
  120. (home-page "https://curl.haxx.se/")))
  121. (define-public curl-7.56.0
  122. (package
  123. (inherit curl)
  124. (version "7.56.0")
  125. (source
  126. (origin
  127. (method url-fetch)
  128. (uri (string-append "https://curl.haxx.se/download/curl-"
  129. version ".tar.xz"))
  130. (sha256
  131. (base32
  132. "0wni3zkw7jyrwgwkqnrkf2x2b7c78wsp7p4z6a246hz9l367nhrj"))))))