magic-wormhole.scm 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2019 Leo Famulari <leo@famulari.name>
  3. ;;;
  4. ;;; This file is part of GNU Guix.
  5. ;;;
  6. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  7. ;;; under the terms of the GNU General Public License as published by
  8. ;;; the Free Software Foundation; either version 3 of the License, or (at
  9. ;;; your option) any later version.
  10. ;;;
  11. ;;; GNU Guix is distributed in the hope that it will be useful, but
  12. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. ;;; GNU General Public License for more details.
  15. ;;;
  16. ;;; You should have received a copy of the GNU General Public License
  17. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  18. (define-module (gnu packages magic-wormhole)
  19. #:use-module (guix packages)
  20. #:use-module (guix download)
  21. #:use-module (guix licenses)
  22. #:use-module (guix build-system python)
  23. #:use-module (gnu packages check)
  24. #:use-module (gnu packages python-crypto)
  25. #:use-module (gnu packages python-web)
  26. #:use-module (gnu packages python-xyz))
  27. (define-public magic-wormhole-mailbox-server
  28. (package
  29. (name "magic-wormhole-mailbox-server")
  30. (version "0.4.1")
  31. (source
  32. (origin
  33. (method url-fetch)
  34. (uri (pypi-uri "magic-wormhole-mailbox-server" version))
  35. (sha256
  36. (base32
  37. "1yw8i8jv5iv1kkz1aqimskw7fpichjn6ww0fq0czbalwj290bw8s"))))
  38. (build-system python-build-system)
  39. (arguments
  40. '(#:phases
  41. (modify-phases %standard-phases
  42. (add-after 'unpack 'patch-tests
  43. (lambda _
  44. ;; This test requires network access.
  45. (substitute* "src/wormhole_mailbox_server/test/test_web.py"
  46. (("test_log_http") "disabled_test_log_http"))
  47. #t)))))
  48. (native-inputs
  49. `(("python-mock" ,python-mock)))
  50. (propagated-inputs
  51. `(("python-attrs" ,python-attrs)
  52. ("python-autobahn" ,python-autobahn)
  53. ("python-idna" ,python-idna)
  54. ("python-service-identity" ,python-service-identity)
  55. ("python-six" ,python-six)
  56. ("python-treq" ,python-treq)
  57. ("python-twisted" ,python-twisted)))
  58. (home-page "https://github.com/warner/magic-wormhole-mailbox-server")
  59. (synopsis "Magic-Wormhole central mailbox server")
  60. (description "This package provides the main server that Magic-Wormhole
  61. clients connect to. The server performs store-and-forward delivery for small
  62. key-exchange and control messages. Bulk data is sent over a direct TCP
  63. connection, or through a transit-relay.")
  64. (license expat)))
  65. (define-public magic-wormhole-transit-relay
  66. (package
  67. (name "magic-wormhole-transit-relay")
  68. (version "0.2.1")
  69. (source
  70. (origin
  71. (method url-fetch)
  72. (uri (pypi-uri "magic-wormhole-transit-relay" version))
  73. (sha256
  74. (base32
  75. "0ppsx2s1ysikns1h053x67z2zmficbn3y3kf52bzzslhd2s02j6b"))))
  76. (build-system python-build-system)
  77. (arguments
  78. `(#:phases
  79. (modify-phases %standard-phases
  80. (add-after 'install 'install-docs
  81. (lambda* (#:key outputs #:allow-other-keys)
  82. (let* ((out (assoc-ref outputs "out"))
  83. (docs (string-append out "/share/doc/magic-wormhole-transit-relay")))
  84. (for-each (lambda (file)
  85. (install-file file docs))
  86. (find-files "docs/"))
  87. #t))))))
  88. (native-inputs
  89. `(("python-mock" ,python-mock)
  90. ("python-pyflakes" ,python-pyflakes)
  91. ("python-tox" ,python-tox)))
  92. (propagated-inputs
  93. `(("python-twisted" ,python-twisted)))
  94. (home-page
  95. "https://github.com/warner/magic-wormhole-transit-relay")
  96. (synopsis "Magic-Wormhole relay server")
  97. (description "This package provides the Magic-Wormhole Transit Relay
  98. server, which helps clients establish bulk-data transit connections even when
  99. both are behind NAT boxes. Each side makes a TCP connection to this server and
  100. presents a handshake. Two connections with identical handshakes are glued
  101. together, allowing them to pretend they have a direct connection.")
  102. (license expat)))
  103. (define-public magic-wormhole
  104. (package
  105. (name "magic-wormhole")
  106. (version "0.12.0")
  107. (source
  108. (origin
  109. (method url-fetch)
  110. (uri (pypi-uri "magic-wormhole" version))
  111. (sha256
  112. (base32
  113. "0q41j99718y7m95zg1vaybnsp31lp6lhyqkbv4yqz5ys6jixh3qv"))))
  114. (build-system python-build-system)
  115. (arguments
  116. '(#:phases
  117. (modify-phases %standard-phases
  118. ;; XXX I can't figure out how to build the docs properly.
  119. ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=34515#101
  120. (add-after 'install 'install-docs
  121. (lambda* (#:key outputs #:allow-other-keys)
  122. (let* ((out (assoc-ref outputs "out"))
  123. (man (string-append out "/share/man/man1")))
  124. (install-file "docs/wormhole.1" man))
  125. #t)))))
  126. (native-inputs
  127. `(("python-mock" ,python-mock)
  128. ;; XXX These are required for the test suite but end up being referenced
  129. ;; by the built package.
  130. ;; https://bugs.gnu.org/25235
  131. ("magic-wormhole-mailbox-server" ,magic-wormhole-mailbox-server)
  132. ("magic-wormhole-transit-relay" ,magic-wormhole-transit-relay)))
  133. (propagated-inputs
  134. `(("python-autobahn" ,python-autobahn)
  135. ("python-click" ,python-click)
  136. ("python-hkdf" ,python-hkdf)
  137. ("python-humanize" ,python-humanize)
  138. ("python-pynacl" ,python-pynacl)
  139. ("python-spake2" ,python-spake2)
  140. ("python-tqdm" ,python-tqdm)
  141. ("python-twisted" ,python-twisted)
  142. ("python-txtorcon" ,python-txtorcon)))
  143. (home-page "https://github.com/warner/magic-wormhole")
  144. (synopsis "Securely transfer data between computers")
  145. (description "Magic-Wormhole is a library and a command-line tool named
  146. wormhole, which makes it possible to securely transfer arbitrary-sized files and
  147. directories (or short pieces of text) from one computer to another. The two
  148. endpoints are identified by using identical \"wormhole codes\": in general, the
  149. sending machine generates and displays the code, which must then be typed into
  150. the receiving machine.
  151. The codes are short and human-pronounceable, using a phonetically-distinct
  152. wordlist. The receiving side offers tab-completion on the codewords, so usually
  153. only a few characters must be typed. Wormhole codes are single-use and do not
  154. need to be memorized.")
  155. (license expat)))