wget.scm 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
  3. ;;; Copyright © 2014, 2015, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
  4. ;;; Copyright © 2016, 2017, 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
  5. ;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
  6. ;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <me@tobias.gr>
  7. ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
  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 wget)
  24. #:use-module ((guix licenses) #:prefix license:)
  25. #:use-module (gnu packages)
  26. #:use-module (gnu packages base)
  27. #:use-module (gnu packages compression)
  28. #:use-module (gnu packages documentation)
  29. #:use-module (gnu packages gnunet)
  30. #:use-module (gnu packages gnupg)
  31. #:use-module (gnu packages libidn)
  32. #:use-module (gnu packages pcre)
  33. #:use-module (gnu packages perl)
  34. #:use-module (gnu packages pkg-config)
  35. #:use-module (gnu packages python)
  36. #:use-module (gnu packages tls)
  37. #:use-module (gnu packages web)
  38. #:use-module (gnu packages xdisorg)
  39. #:use-module (guix packages)
  40. #:use-module (guix download)
  41. #:use-module (guix git-download)
  42. #:use-module (guix build-system gnu))
  43. (define-public wget
  44. (package
  45. (name "wget")
  46. (version "1.21.1")
  47. (source
  48. (origin
  49. (method url-fetch)
  50. (uri (string-append "mirror://gnu/wget/wget-"
  51. version ".tar.lz"))
  52. (sha256
  53. (base32
  54. "1bchzkacjsc5c0x01ngaana9fs5j12wfw1c8qxps1yp68x9vx6yv"))))
  55. (build-system gnu-build-system)
  56. (inputs
  57. `(("gnutls" ,gnutls)
  58. ("libidn2" ,libidn2)
  59. ("libpsl" ,libpsl)))
  60. (native-inputs
  61. `(("lzip" ,lzip)
  62. ("pkg-config" ,pkg-config)
  63. ("perl" ,perl)
  64. ("python" ,python) ;for testenv suite
  65. ("perl-http-daemon" ,perl-http-daemon)
  66. ("perl-io-socket-ssl" ,perl-io-socket-ssl)))
  67. (home-page "https://www.gnu.org/software/wget/")
  68. (synopsis "Non-interactive command-line utility for downloading files")
  69. (description
  70. "GNU Wget is a non-interactive tool for fetching files using the HTTP,
  71. HTTPS and FTP protocols. It can resume interrupted downloads, use file name
  72. wild cards, supports proxies and cookies, and it can convert absolute links
  73. in downloaded documents to relative links.")
  74. (license license:gpl3+))) ; some files are under GPLv2+
  75. (define-public wgetpaste
  76. (package
  77. (name "wgetpaste")
  78. (version "2.32")
  79. (source
  80. (origin
  81. (method git-fetch)
  82. (uri (git-reference
  83. (url "https://github.com/zlin/wgetpaste")
  84. (commit version)))
  85. (file-name (git-file-name name version))
  86. (sha256
  87. (base32 "13zdqfnbpymwz2f04icw92flj50227n5r0dcms84qxswfxrarnas"))))
  88. (build-system gnu-build-system)
  89. (arguments
  90. `(#:modules ((guix build gnu-build-system)
  91. (guix build utils)
  92. (srfi srfi-1))
  93. #:phases
  94. (modify-phases %standard-phases
  95. (delete 'configure)
  96. (delete 'build)
  97. (add-after 'unpack 'change-unfriendly-default
  98. (lambda _
  99. (substitute* "wgetpaste"
  100. ;; dpaste blocks Tor users. Use a better default.
  101. (("DEFAULT_SERVICE:-dpaste")
  102. "DEFAULT_SERVICE-bpaste"))
  103. #t))
  104. (replace 'install
  105. (lambda* (#:key outputs #:allow-other-keys)
  106. (let* ((out (assoc-ref outputs "out"))
  107. (bin (string-append out "/bin"))
  108. (zsh (string-append out "/share/zsh/site-functions")))
  109. (install-file "wgetpaste" bin)
  110. (install-file "_wgetpaste" zsh)
  111. #t)))
  112. (add-after 'install 'wrap-program
  113. ;; /bin/wgetpaste prides itself on relying only on the following
  114. ;; inputs, and doesn't need to execute arbitrary commands, so
  115. ;; override PATH completely to detect any new dependencies early.
  116. (lambda* (#:key outputs #:allow-other-keys)
  117. (let ((out (assoc-ref outputs "out")))
  118. (wrap-program (string-append out "/bin/wgetpaste")
  119. `("PATH" ":" =
  120. ,(delete-duplicates
  121. (map (lambda (command) (dirname (which command)))
  122. (list "bash" "mktemp" "sed" "sort" "tee" "tr"
  123. "wget" "xclip")))))
  124. #t))))
  125. #:tests? #f)) ; no test target
  126. (inputs
  127. `(("wget" ,wget)
  128. ("xclip" ,xclip)))
  129. (home-page "https://wgetpaste.zlin.dk/")
  130. (synopsis "Script that automates pasting to a number of pastebin services")
  131. (description
  132. "@code{wgetpaste} is an extremely simple command-line interface to various
  133. online pastebin services.")
  134. (license license:expat)))
  135. (define-public wget2
  136. (package
  137. (name "wget2")
  138. (version "1.99.2")
  139. (source
  140. (origin
  141. (method url-fetch)
  142. (uri (string-append "mirror://gnu/wget/wget2-" version ".tar.gz"))
  143. (sha256
  144. (base32
  145. "0qv55f4bablrlhc8bnic8g3mkk1kq44c4cphrk5jmv92z9aqzi6b"))))
  146. (build-system gnu-build-system)
  147. (arguments
  148. `(#:phases
  149. (modify-phases %standard-phases
  150. (add-after 'unpack 'skip-network-tests
  151. (lambda _
  152. (substitute* "tests/Makefile.in"
  153. (("test-gpg-verify-no-file\\$\\(EXEEXT)") "")
  154. (("test-gpg-valid\\$\\(EXEEXT)") "")
  155. (("test-gpg-styles\\$\\(EXEEXT)") ""))
  156. #t)))
  157. #:configure-flags '("--enable-static=no")))
  158. (inputs
  159. `(("bzip2" ,bzip2)
  160. ("gnutls" ,gnutls/dane)
  161. ("gpgme" ,gpgme)
  162. ("libiconv" ,libiconv)
  163. ("libidn2" ,libidn2)
  164. ("libmicrohttpd" ,libmicrohttpd)
  165. ("libpsl" ,libpsl)
  166. ("pcre2" ,pcre2)
  167. ("zlib" ,zlib)))
  168. ;; TODO: Add libbrotlidec, libnghttp2.
  169. (native-inputs
  170. `(("pkg-config" ,pkg-config)))
  171. (home-page "https://gitlab.com/gnuwget/wget2")
  172. (synopsis "Successor of GNU Wget")
  173. (description "GNU Wget2 is the successor of GNU Wget, a file and recursive
  174. website downloader. Designed and written from scratch it wraps around libwget,
  175. that provides the basic functions needed by a web client.")
  176. (properties '((ftp-directory . "/gnu/wget")))
  177. (license (list license:gpl3+ license:lgpl3+))))