wget.scm 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  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-2022 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. ;;; Copyright © 2021 Michael Rohleder <mike@rohleder.de>
  9. ;;;
  10. ;;; This file is part of GNU Guix.
  11. ;;;
  12. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  13. ;;; under the terms of the GNU General Public License as published by
  14. ;;; the Free Software Foundation; either version 3 of the License, or (at
  15. ;;; your option) any later version.
  16. ;;;
  17. ;;; GNU Guix is distributed in the hope that it will be useful, but
  18. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  19. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. ;;; GNU General Public License for more details.
  21. ;;;
  22. ;;; You should have received a copy of the GNU General Public License
  23. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  24. (define-module (gnu packages wget)
  25. #:use-module ((guix licenses) #:prefix license:)
  26. #:use-module (gnu packages)
  27. #:use-module (gnu packages bash)
  28. #:use-module (gnu packages compression)
  29. #:use-module (gnu packages documentation)
  30. #:use-module (gnu packages gnunet)
  31. #:use-module (gnu packages gnupg)
  32. #:use-module (gnu packages libidn)
  33. #:use-module (gnu packages pcre)
  34. #:use-module (gnu packages perl)
  35. #:use-module (gnu packages pkg-config)
  36. #:use-module (gnu packages python)
  37. #:use-module (gnu packages tls)
  38. #:use-module (gnu packages web)
  39. #:use-module (gnu packages xdisorg)
  40. #:use-module (guix packages)
  41. #:use-module (guix download)
  42. #:use-module (guix git-download)
  43. #:use-module (guix build-system gnu))
  44. (define-public wget
  45. (package
  46. (name "wget")
  47. (version "1.21.3.24")
  48. (source
  49. (origin
  50. (method url-fetch)
  51. ;;(uri (string-append "mirror://gnu/wget/wget-"
  52. ;; version ".tar.lz"))
  53. (uri "https://www.multiprecision.org/wget-1.21.3.24-2b723.tar.lz")
  54. (sha256
  55. (base32
  56. "17ip94mvax83h0gh4905jqc64g5qf3vgxr3bj9gn02pijjm5lzbp"))))
  57. (build-system gnu-build-system)
  58. (inputs
  59. (list gnutls libidn2 libpsl))
  60. (native-inputs
  61. (list lzip
  62. pkg-config
  63. perl
  64. python ;for testenv suite
  65. perl-http-daemon
  66. 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.33")
  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 "0gx5y3f0qf3hrah1z0q243hyldshaq6mvbg1lnjzciviv1vc8zx0"))))
  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. (replace 'install
  104. (lambda* (#:key outputs #:allow-other-keys)
  105. (let* ((out (assoc-ref outputs "out"))
  106. (bin (string-append out "/bin"))
  107. (zsh (string-append out "/share/zsh/site-functions")))
  108. (install-file "wgetpaste" bin)
  109. (install-file "_wgetpaste" zsh))))
  110. (add-after 'install 'wrap-program
  111. ;; /bin/wgetpaste prides itself on relying only on the following
  112. ;; inputs, and doesn't need to execute arbitrary commands, so
  113. ;; override PATH completely to detect any new dependencies early.
  114. (lambda* (#:key outputs #:allow-other-keys)
  115. (let ((out (assoc-ref outputs "out")))
  116. (wrap-program (string-append out "/bin/wgetpaste")
  117. `("PATH" ":" =
  118. ,(delete-duplicates
  119. (map (lambda (command) (dirname (which command)))
  120. (list "bash" "mktemp" "sed" "sort" "tee" "tr"
  121. "wget" "xclip")))))))))
  122. #:tests? #f)) ; no test target
  123. (inputs
  124. (list bash-minimal wget xclip))
  125. (home-page "https://wgetpaste.zlin.dk/")
  126. (synopsis "Script that automates pasting to a number of pastebin services")
  127. (description
  128. "@code{wgetpaste} is an extremely simple command-line interface to various
  129. online pastebin services.")
  130. (license license:expat)))
  131. (define-public wget2
  132. (package
  133. (name "wget2")
  134. (version "2.0.1")
  135. (source (origin
  136. (method url-fetch)
  137. (uri (string-append "mirror://gnu/wget/wget2-" version ".tar.gz"))
  138. (sha256
  139. (base32
  140. "1caxhkwk08z3npzw8x2qhkmjc224cfw1aphvbv8bidbvd41zmdqb"))))
  141. (build-system gnu-build-system)
  142. (arguments
  143. `(#:phases (modify-phases %standard-phases
  144. (add-after 'unpack 'skip-network-tests
  145. (lambda _
  146. (substitute* "tests/Makefile.in"
  147. (("test-gpg-verify-no-file\\$\\(EXEEXT)") "")
  148. (("test-gpg-valid\\$\\(EXEEXT)") "")
  149. (("test-gpg-styles\\$\\(EXEEXT)") "")))))
  150. #:configure-flags
  151. '("--enable-static=no")))
  152. (inputs (list bzip2
  153. gnutls/dane
  154. gpgme
  155. libidn2
  156. libmicrohttpd
  157. libpsl
  158. pcre2
  159. zlib))
  160. ;; TODO: Add libbrotlidec, libnghttp2.
  161. (native-inputs (list pkg-config))
  162. (home-page "https://gitlab.com/gnuwget/wget2")
  163. (synopsis "Successor of GNU Wget")
  164. (description
  165. "GNU Wget2 is the successor of GNU Wget, a file and recursive website
  166. downloader. Designed and written from scratch it wraps around libwget, that
  167. provides the basic functions needed by a web client.")
  168. (properties '((ftp-directory . "/gnu/wget")))
  169. (license (list license:gpl3+ license:lgpl3+))))