bittorrent.scm 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2014 Taylan Ulrich Bayirli/Kammer <taylanbayirli@gmail.com>
  3. ;;; Copyright © 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
  4. ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
  5. ;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name>
  6. ;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
  7. ;;; Copyright © 2016 Tomáš Čech <sleep_walker@gnu.org>
  8. ;;; Copyright © 2016 Tobias Geerinckx-Rice <me@tobias.gr>
  9. ;;; Copyright © 2017 Jelle Licht <jlicht@fsfe.org>
  10. ;;;
  11. ;;; This file is part of GNU Guix.
  12. ;;;
  13. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  14. ;;; under the terms of the GNU General Public License as published by
  15. ;;; the Free Software Foundation; either version 3 of the License, or (at
  16. ;;; your option) any later version.
  17. ;;;
  18. ;;; GNU Guix is distributed in the hope that it will be useful, but
  19. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  20. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  21. ;;; GNU General Public License for more details.
  22. ;;;
  23. ;;; You should have received a copy of the GNU General Public License
  24. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  25. (define-module (gnu packages bittorrent)
  26. #:use-module (guix packages)
  27. #:use-module (guix download)
  28. #:use-module (guix git-download)
  29. #:use-module (guix build-system gnu)
  30. #:use-module (guix build-system python)
  31. #:use-module (guix build-system glib-or-gtk)
  32. #:use-module ((guix licenses) #:prefix l:)
  33. #:use-module (gnu packages)
  34. #:use-module (gnu packages adns)
  35. #:use-module (gnu packages boost)
  36. #:use-module (gnu packages check)
  37. #:use-module (gnu packages compression)
  38. #:use-module (gnu packages crypto)
  39. #:use-module (gnu packages curl)
  40. #:use-module (gnu packages cyrus-sasl)
  41. #:use-module (gnu packages databases)
  42. #:use-module (gnu packages file)
  43. #:use-module (gnu packages glib)
  44. #:use-module (gnu packages gnome)
  45. #:use-module (gnu packages gnupg)
  46. #:use-module (gnu packages gstreamer)
  47. #:use-module (gnu packages gtk)
  48. #:use-module (gnu packages libevent)
  49. #:use-module (gnu packages linux)
  50. #:use-module (gnu packages multiprecision)
  51. #:use-module (gnu packages nettle)
  52. #:use-module (gnu packages ncurses)
  53. #:use-module (gnu packages pkg-config)
  54. #:use-module (gnu packages python)
  55. #:use-module (gnu packages ssh)
  56. #:use-module (gnu packages tls)
  57. #:use-module (gnu packages xml))
  58. (define-public transmission
  59. (package
  60. (name "transmission")
  61. (version "2.92")
  62. (source (origin
  63. (method url-fetch)
  64. (uri (string-append
  65. "https://transmission.cachefly.net/transmission-"
  66. version ".tar.xz"))
  67. (sha256
  68. (base32
  69. "0pykmhi7pdmzq47glbj8i2im6iarp4wnj4l1pyvsrnba61f0939s"))))
  70. (build-system glib-or-gtk-build-system)
  71. (outputs '("out" ; library and command-line interface
  72. "gui")) ; graphical user interface
  73. (arguments
  74. '(#:glib-or-gtk-wrap-excluded-outputs '("out")
  75. #:phases (alist-cons-after
  76. 'install 'move-gui
  77. (lambda* (#:key outputs #:allow-other-keys)
  78. ;; Move the GUI to its own output, so that "out" doesn't
  79. ;; depend on GTK+.
  80. (let ((out (assoc-ref outputs "out"))
  81. (gui (assoc-ref outputs "gui")))
  82. (mkdir-p (string-append gui "/bin"))
  83. (rename-file (string-append out "/bin/transmission-gtk")
  84. (string-append gui
  85. "/bin/transmission-gtk"))
  86. ;; Move the '.desktop' file as well.
  87. (mkdir (string-append gui "/share"))
  88. (rename-file (string-append out "/share/applications")
  89. (string-append gui "/share/applications"))))
  90. %standard-phases)))
  91. (inputs
  92. `(("inotify-tools" ,inotify-tools)
  93. ("libevent" ,libevent)
  94. ("curl" ,curl)
  95. ("cyrus-sasl" ,cyrus-sasl)
  96. ("openssl" ,openssl)
  97. ("file" ,file)
  98. ("zlib" ,zlib)
  99. ("gtk+" ,gtk+)))
  100. (native-inputs
  101. `(("intltool" ,intltool)
  102. ("pkg-config" ,pkg-config)))
  103. (home-page "http://www.transmissionbt.com/")
  104. (synopsis "Fast and easy BitTorrent client")
  105. (description
  106. "Transmission is a BitTorrent client that comes with graphical,
  107. textual, and Web user interfaces. Transmission also has a daemon for
  108. unattended operations. It supports local peer discovery, full encryption,
  109. DHT, µTP, PEX and Magnet Links.")
  110. ;; COPYING reads:
  111. ;;
  112. ;; Transmission can be redistributed and/or modified under the terms of
  113. ;; the GNU GPLv2 (http://www.gnu.org/licenses/license-list.html#GPLv2),
  114. ;; the GNU GPLv3 (http://www.gnu.org/licenses/license-list.html#GNUGPLv3),
  115. ;; or any future license endorsed by Mnemosyne LLC.
  116. ;;
  117. ;; A few files files carry an MIT/X11 license header.
  118. (license l:gpl3+)))
  119. (define-public libtorrent
  120. (package
  121. (name "libtorrent")
  122. (version "0.13.6")
  123. (source (origin
  124. (method url-fetch)
  125. (uri (string-append
  126. "http://rtorrent.net/downloads/libtorrent-"
  127. version ".tar.gz"))
  128. (sha256
  129. (base32
  130. "012s1nwcvz5m5r4d2z9klgy2n34kpgn9kgwgzxm97zgdjs6a0f18"))))
  131. (build-system gnu-build-system)
  132. (inputs `(("openssl" ,openssl)
  133. ("zlib" ,zlib)))
  134. (native-inputs `(("pkg-config" ,pkg-config)
  135. ("cppunit" ,cppunit)))
  136. (synopsis "BitTorrent library of rtorrent")
  137. (description
  138. "LibTorrent is a BitTorrent library used by and developed in parallel
  139. with the BitTorrent client rtorrent. It is written in C++ with emphasis on
  140. speed and efficiency.")
  141. (home-page "https://github.com/rakshasa/libtorrent")
  142. (license l:gpl2+)))
  143. (define-public rtorrent
  144. (package
  145. (name "rtorrent")
  146. (version "0.9.6")
  147. (source (origin
  148. (method url-fetch)
  149. (uri (string-append
  150. "http://rtorrent.net/downloads/rtorrent-"
  151. version ".tar.gz"))
  152. (sha256
  153. (base32
  154. "03jvzw9pi2mhcm913h8qg0qw9gwjqc6lhwynb1yz1y163x7w4s8y"))))
  155. (build-system gnu-build-system)
  156. (inputs `(("libtorrent" ,libtorrent)
  157. ("ncurses" ,ncurses)
  158. ("curl" ,curl)
  159. ("cyrus-sasl" ,cyrus-sasl)
  160. ("openssl" ,openssl)
  161. ("zlib" ,zlib)))
  162. (native-inputs `(("pkg-config" ,pkg-config)
  163. ("cppunit" ,cppunit)))
  164. (synopsis "BitTorrent client with ncurses interface")
  165. (description
  166. "rTorrent is a BitTorrent client with an ncurses interface. It supports
  167. full encryption, DHT, PEX, and Magnet Links. It can also be controlled via
  168. XML-RPC over SCGI.")
  169. (home-page "https://github.com/rakshasa/rtorrent")
  170. (license l:gpl2+)))
  171. (define-public tremc
  172. (let ((commit "401f2303c9b5a6e2e7b0808617d794576d4aa29e")
  173. (revision "0"))
  174. (package
  175. (name "tremc")
  176. (version (string-append "0.9.0-" revision "." (string-take commit 7)))
  177. (source
  178. (origin
  179. (method git-fetch)
  180. (uri (git-reference
  181. (url "https://github.com/louipc/tremc.git")
  182. (commit commit)))
  183. (sha256
  184. (base32
  185. "1h2720zn35iggmf9av65g119b0bhskwm1ng0zbkjryaf38nfzpin"))))
  186. (build-system python-build-system)
  187. (arguments
  188. `(#:tests? #f ; no test suite
  189. #:phases
  190. (modify-phases %standard-phases
  191. ;; The software is just a Python script that must be
  192. ;; copied into place.
  193. (delete 'build)
  194. (replace 'install
  195. (lambda* (#:key outputs #:allow-other-keys)
  196. (let* ((out (assoc-ref outputs "out"))
  197. (bin (string-append out "/bin"))
  198. (man (string-append out "/share/man/man1"))
  199. ;; FIXME install zsh completions
  200. (completions (string-append out "/etc/bash_completion.d")))
  201. (install-file "tremc" bin)
  202. (install-file "tremc.1" man)
  203. (install-file
  204. (string-append
  205. "completion/bash/"
  206. "transmission-remote-cli-bash-completion.sh")
  207. completions)))))))
  208. (synopsis "Console client for the Transmission BitTorrent daemon")
  209. (description "Tremc is a console client, with a curses interface, for the
  210. Transmission BitTorrent daemon.")
  211. (home-page "https://github.com/louipc/tremc")
  212. (license l:gpl3+))))
  213. (define-public transmission-remote-cli
  214. (package
  215. (name "transmission-remote-cli")
  216. (version "1.7.1")
  217. (source (origin
  218. (method url-fetch)
  219. (uri (string-append "https://github.com/fagga/"
  220. "transmission-remote-cli/archive/v"
  221. version ".tar.gz"))
  222. (file-name (string-append name "-" version ".tar.gz"))
  223. (sha256
  224. (base32
  225. "1y0hkpcjf6jw9xig8yf484hbhy63nip0pkchx401yxj81m25l4z9"))))
  226. (build-system python-build-system)
  227. (arguments
  228. `(#:python ,python-2 ; only supports Python 2
  229. #:tests? #f ; no test suite
  230. #:phases (modify-phases %standard-phases
  231. ;; The software is just a Python script that must be
  232. ;; copied into place.
  233. (delete 'build)
  234. (replace 'install
  235. (lambda* (#:key outputs #:allow-other-keys)
  236. (let* ((out (assoc-ref outputs "out"))
  237. (bin (string-append out "/bin"))
  238. (man (string-append out "/share/man/man1"))
  239. ;; FIXME install zsh completions
  240. (completions (string-append out "/etc/bash_completion.d")))
  241. (install-file "transmission-remote-cli" bin)
  242. (install-file "transmission-remote-cli.1" man)
  243. (install-file
  244. (string-append
  245. "completion/bash/"
  246. "transmission-remote-cli-bash-completion.sh")
  247. completions)))))))
  248. (synopsis "Console client for the Transmission BitTorrent daemon")
  249. (description "Transmission-remote-cli is a console client, with a curses
  250. interface, for the Transmission BitTorrent daemon. This package is no longer
  251. maintained upstream.")
  252. (home-page "https://github.com/fagga/transmission-remote-cli")
  253. (license l:gpl3+)
  254. (properties `((superseded . ,tremc)))))
  255. (define-public aria2
  256. (package
  257. (name "aria2")
  258. (version "1.32.0")
  259. (source (origin
  260. (method url-fetch)
  261. (uri (string-append "https://github.com/tatsuhiro-t/aria2/"
  262. "releases/download/release-" version "/"
  263. name "-" version ".tar.xz"))
  264. (sha256
  265. (base32
  266. "0l6whbbcw1qijlczlfqi3mhba3zki0ybjb2prrgncp8km6a92vjl"))))
  267. (build-system gnu-build-system)
  268. (arguments
  269. `(#:configure-flags (list "--enable-libaria2"
  270. (string-append "--with-bashcompletiondir="
  271. %output "/etc/bash_completion.d/"))
  272. #:phases
  273. (modify-phases %standard-phases
  274. (add-after 'unpack 'delete-socket-tests
  275. (lambda _
  276. (substitute* "test/LpdMessageDispatcherTest.cc"
  277. (("CPPUNIT_TEST_SUITE_REGISTRATION\\(LpdMessageDispatcherTest\\);" text)
  278. (string-append "// " text)))
  279. (substitute* "test/LpdMessageReceiverTest.cc"
  280. (("CPPUNIT_TEST_SUITE_REGISTRATION\\(LpdMessageReceiverTest\\);" text)
  281. (string-append "// " text)))
  282. #t)))))
  283. (native-inputs
  284. `(("cppunit" ,cppunit) ; for the tests
  285. ("pkg-config" ,pkg-config)))
  286. (inputs
  287. `(("c-ares" ,c-ares)
  288. ("gnutls" ,gnutls)
  289. ("gmp" ,gmp)
  290. ("libssh2" ,libssh2)
  291. ("libxml2" ,libxml2)
  292. ("nettle" ,nettle)
  293. ("sqlite" ,sqlite)
  294. ("zlib" ,zlib)))
  295. (home-page "https://aria2.github.io/")
  296. (synopsis "Utility for parallel downloading files")
  297. (description
  298. "Aria2 is a lightweight, multi-protocol & multi-source command-line
  299. download utility. It supports HTTP/HTTPS, FTP, SFTP, BitTorrent and Metalink.
  300. Aria2 can be manipulated via built-in JSON-RPC and XML-RPC interfaces.")
  301. (license l:gpl2+)))
  302. (define-public uget
  303. (package
  304. (name "uget")
  305. (version "2.0.8")
  306. (source (origin
  307. (method url-fetch)
  308. (uri (string-append "mirror://sourceforge/urlget/"
  309. "uget%20%28stable%29/" version "/uget-"
  310. version ".tar.gz"))
  311. (sha256
  312. (base32
  313. "0919cf7lfk1djdl003cahqjvafdliv7v2l8r5wg95n4isqggdk75"))))
  314. (build-system gnu-build-system)
  315. (native-inputs
  316. `(("intltool" ,intltool)))
  317. (inputs
  318. `(("curl" ,curl)
  319. ("gtk+" ,gtk+)
  320. ("glib" ,glib)
  321. ("gnutls" ,gnutls)
  322. ("gstreamer" ,gstreamer)
  323. ("libgcrypt" ,libgcrypt)
  324. ("libnotify" ,libnotify)
  325. ("openssl" ,openssl)))
  326. (native-inputs
  327. `(("intltool" ,intltool)
  328. ("pkg-config" ,pkg-config)))
  329. (home-page "http://ugetdm.com/")
  330. (synopsis "Universal download manager with GTK+ interface")
  331. (description
  332. "uGet is portable download manager with GTK+ interface supporting
  333. HTTP, HTTPS, BitTorrent and Metalink, supporting multi-connection
  334. downloads, download scheduling, download rate limiting.")
  335. (license l:lgpl2.1+)))
  336. (define-public mktorrent
  337. (package
  338. (name "mktorrent")
  339. (version "1.0")
  340. (source (origin
  341. (method url-fetch)
  342. (uri (string-append "mirror://sourceforge/mktorrent/mktorrent/"
  343. version "/" name "-" version ".tar.gz"))
  344. (sha256
  345. (base32
  346. "17qi3nfky240pq6qcmf5qg324mxm83vk9r3nvsdhsvinyqm5d3kg"))))
  347. (build-system gnu-build-system)
  348. (arguments
  349. `(#:phases (modify-phases %standard-phases
  350. (delete 'configure)) ; no configure script
  351. #:make-flags (list "CC=gcc"
  352. (string-append "PREFIX=" (assoc-ref %outputs "out"))
  353. "NO_HASH_CHECK=1"
  354. "USE_LARGE_FILES=1"
  355. "USE_LONG_OPTIONS=1"
  356. "USE_PTHREADS=1")
  357. #:tests? #f)) ; no tests
  358. (home-page "http://mktorrent.sourceforge.net/")
  359. (synopsis "Utility to create BitTorrent metainfo files")
  360. (description "mktorrent is a simple command-line utility to create
  361. BitTorrent @dfn{metainfo} files, often known simply as @dfn{torrents}, from
  362. both single files and whole directories. It can add multiple trackers and web
  363. seed URLs, and set the @code{private} flag to disallow advertisement through
  364. the distributed hash table (DHT) and Peer Exchange. Hashing is multi-threaded
  365. and will take advantage of multiple processor cores where possible.")
  366. (license (list l:public-domain ; sha1.*, used to build without OpenSSL
  367. l:gpl2+)))) ; with permission to link with OpenSSL
  368. (define-public libtorrent-rasterbar
  369. (package
  370. (name "libtorrent-rasterbar")
  371. (version "1.1.2")
  372. (source (origin
  373. (method url-fetch)
  374. (uri
  375. (string-append
  376. "https://github.com/arvidn/libtorrent/releases/download/libtorrent-"
  377. (string-join (string-split version #\.) "_")
  378. "/libtorrent-rasterbar-" version ".tar.gz"))
  379. (patches
  380. (search-patches "libtorrent-rasterbar-boost-compat.patch"))
  381. (sha256
  382. (base32
  383. "16im9qsmfrmmkhfjpij9739nqpn4s6wgc9cikdxbcyshfhimzra5"))))
  384. (build-system gnu-build-system)
  385. (arguments
  386. `(#:configure-flags
  387. (list (string-append "--with-boost-libdir="
  388. (assoc-ref %build-inputs "boost")
  389. "/lib")
  390. "--enable-python-binding"
  391. "--enable-tests")
  392. #:make-flags (list
  393. (string-append "LDFLAGS=-Wl,-rpath="
  394. (assoc-ref %outputs "out") "/lib"))))
  395. (inputs `(("boost" ,boost)
  396. ("openssl" ,openssl)))
  397. (native-inputs `(("python" ,python-2)
  398. ("pkg-config" ,pkg-config)))
  399. (home-page "http://www.rasterbar.com/products/libtorrent/")
  400. (synopsis "Feature complete BitTorrent implementation")
  401. (description
  402. "libtorrent-rasterbar is a feature complete C++ BitTorrent implementation
  403. focusing on efficiency and scalability. It runs on embedded devices as well as
  404. desktops.")
  405. (license l:bsd-2)))