bittorrent.scm 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505
  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, 2017, 2018 Leo Famulari <leo@famulari.name>
  5. ;;; Copyright © 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
  6. ;;; Copyright © 2016 Tomáš Čech <sleep_walker@gnu.org>
  7. ;;; Copyright © 2016, 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
  8. ;;; Copyright © 2017 Jelle Licht <jlicht@fsfe.org>
  9. ;;; Copyright © 2018 Fis Trivial <ybbs.daans@hotmail.com>
  10. ;;; Copyright © 2018 Nam Nguyen <namn@berkeley.edu>
  11. ;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
  12. ;;;
  13. ;;; This file is part of GNU Guix.
  14. ;;;
  15. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  16. ;;; under the terms of the GNU General Public License as published by
  17. ;;; the Free Software Foundation; either version 3 of the License, or (at
  18. ;;; your option) any later version.
  19. ;;;
  20. ;;; GNU Guix is distributed in the hope that it will be useful, but
  21. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  22. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  23. ;;; GNU General Public License for more details.
  24. ;;;
  25. ;;; You should have received a copy of the GNU General Public License
  26. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  27. (define-module (gnu packages bittorrent)
  28. #:use-module (guix packages)
  29. #:use-module (guix download)
  30. #:use-module (guix git-download)
  31. #:use-module (guix build-system gnu)
  32. #:use-module (guix build-system python)
  33. #:use-module (guix build-system glib-or-gtk)
  34. #:use-module ((guix licenses) #:prefix l:)
  35. #:use-module (gnu packages)
  36. #:use-module (gnu packages adns)
  37. #:use-module (gnu packages boost)
  38. #:use-module (gnu packages check)
  39. #:use-module (gnu packages compression)
  40. #:use-module (gnu packages crypto)
  41. #:use-module (gnu packages curl)
  42. #:use-module (gnu packages cyrus-sasl)
  43. #:use-module (gnu packages file)
  44. #:use-module (gnu packages freedesktop)
  45. #:use-module (gnu packages glib)
  46. #:use-module (gnu packages gnome)
  47. #:use-module (gnu packages gnupg)
  48. #:use-module (gnu packages gstreamer)
  49. #:use-module (gnu packages gtk)
  50. #:use-module (gnu packages libevent)
  51. #:use-module (gnu packages linux)
  52. #:use-module (gnu packages multiprecision)
  53. #:use-module (gnu packages nettle)
  54. #:use-module (gnu packages ncurses)
  55. #:use-module (gnu packages pkg-config)
  56. #:use-module (gnu packages python)
  57. #:use-module (gnu packages python-crypto)
  58. #:use-module (gnu packages python-xyz)
  59. #:use-module (gnu packages qt)
  60. #:use-module (gnu packages sqlite)
  61. #:use-module (gnu packages ssh)
  62. #:use-module (gnu packages tls)
  63. #:use-module (gnu packages xml))
  64. (define-public transmission
  65. (package
  66. (name "transmission")
  67. (version "2.94")
  68. (source (origin
  69. (method url-fetch)
  70. (uri (string-append
  71. "https://github.com/transmission/transmission-releases/raw/"
  72. "master/transmission-" version ".tar.xz"))
  73. (sha256
  74. (base32
  75. "0zbbj7rlm6m7vb64x68a64cwmijhsrwx9l63hbwqs7zr9742qi1m"))))
  76. (build-system glib-or-gtk-build-system)
  77. (outputs '("out" ; library and command-line interface
  78. "gui")) ; graphical user interface
  79. (arguments
  80. '(#:glib-or-gtk-wrap-excluded-outputs '("out")
  81. #:phases
  82. (modify-phases %standard-phases
  83. (add-after 'install 'move-gui
  84. (lambda* (#:key outputs #:allow-other-keys)
  85. ;; Move the GUI to its own output, so that "out" doesn't
  86. ;; depend on GTK+.
  87. (let ((out (assoc-ref outputs "out"))
  88. (gui (assoc-ref outputs "gui")))
  89. (mkdir-p (string-append gui "/bin"))
  90. (rename-file (string-append out "/bin/transmission-gtk")
  91. (string-append gui
  92. "/bin/transmission-gtk"))
  93. ;; Move the '.desktop' file as well.
  94. (mkdir (string-append gui "/share"))
  95. (rename-file (string-append out "/share/applications")
  96. (string-append gui "/share/applications")))
  97. #t)))))
  98. (inputs
  99. `(("inotify-tools" ,inotify-tools)
  100. ("libevent" ,libevent)
  101. ("curl" ,curl)
  102. ("cyrus-sasl" ,cyrus-sasl)
  103. ("openssl" ,openssl)
  104. ("file" ,file)
  105. ("zlib" ,zlib)
  106. ("gtk+" ,gtk+)))
  107. (native-inputs
  108. `(("intltool" ,intltool)
  109. ("pkg-config" ,pkg-config)))
  110. (home-page "http://www.transmissionbt.com/")
  111. (synopsis "Fast and easy BitTorrent client")
  112. (description
  113. "Transmission is a BitTorrent client that comes with graphical,
  114. textual, and Web user interfaces. Transmission also has a daemon for
  115. unattended operations. It supports local peer discovery, full encryption,
  116. DHT, µTP, PEX and Magnet Links.")
  117. ;; COPYING reads:
  118. ;;
  119. ;; Transmission can be redistributed and/or modified under the terms of
  120. ;; the GNU GPLv2 (http://www.gnu.org/licenses/license-list.html#GPLv2),
  121. ;; the GNU GPLv3 (http://www.gnu.org/licenses/license-list.html#GNUGPLv3),
  122. ;; or any future license endorsed by Mnemosyne LLC.
  123. ;;
  124. ;; A few files files carry an MIT/X11 license header.
  125. (license l:gpl3+)))
  126. (define-public libtorrent
  127. (package
  128. (name "libtorrent")
  129. (version "0.13.6")
  130. (source (origin
  131. (method url-fetch)
  132. (uri (string-append
  133. "http://rtorrent.net/downloads/libtorrent-"
  134. version ".tar.gz"))
  135. (sha256
  136. (base32
  137. "012s1nwcvz5m5r4d2z9klgy2n34kpgn9kgwgzxm97zgdjs6a0f18"))))
  138. (build-system gnu-build-system)
  139. (inputs `(("openssl" ,openssl)
  140. ("zlib" ,zlib)))
  141. (native-inputs `(("pkg-config" ,pkg-config)
  142. ("cppunit" ,cppunit)))
  143. (synopsis "BitTorrent library of rtorrent")
  144. (description
  145. "LibTorrent is a BitTorrent library used by and developed in parallel
  146. with the BitTorrent client rtorrent. It is written in C++ with emphasis on
  147. speed and efficiency.")
  148. (home-page "https://github.com/rakshasa/libtorrent")
  149. (license l:gpl2+)))
  150. (define-public rtorrent
  151. (package
  152. (name "rtorrent")
  153. (version "0.9.6")
  154. (source (origin
  155. (method url-fetch)
  156. (uri (string-append
  157. "http://rtorrent.net/downloads/rtorrent-"
  158. version ".tar.gz"))
  159. (sha256
  160. (base32
  161. "03jvzw9pi2mhcm913h8qg0qw9gwjqc6lhwynb1yz1y163x7w4s8y"))))
  162. (build-system gnu-build-system)
  163. (inputs `(("libtorrent" ,libtorrent)
  164. ("ncurses" ,ncurses)
  165. ("curl" ,curl)
  166. ("cyrus-sasl" ,cyrus-sasl)
  167. ("openssl" ,openssl)
  168. ("zlib" ,zlib)))
  169. (native-inputs `(("pkg-config" ,pkg-config)
  170. ("cppunit" ,cppunit)))
  171. (synopsis "BitTorrent client with ncurses interface")
  172. (description
  173. "rTorrent is a BitTorrent client with an ncurses interface. It supports
  174. full encryption, DHT, PEX, and Magnet Links. It can also be controlled via
  175. XML-RPC over SCGI.")
  176. (home-page "https://github.com/rakshasa/rtorrent")
  177. (license l:gpl2+)))
  178. (define-public tremc
  179. (package
  180. (name "tremc")
  181. (version "0.9.1")
  182. (source
  183. (origin
  184. (method git-fetch)
  185. (uri (git-reference
  186. (url "https://github.com/tremc/tremc.git")
  187. (commit version)))
  188. (file-name (git-file-name name version))
  189. (sha256
  190. (base32 "1yhwvlcyv1s830p5a7q5x3mkb3mbvr5cn5nh7y62l5b6iyyynlvm"))))
  191. (build-system gnu-build-system)
  192. (arguments
  193. `(#:tests? #f ; no test suite
  194. #:make-flags
  195. (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
  196. #:phases
  197. (modify-phases %standard-phases
  198. ;; The software is just a Python script that must be copied into place.
  199. (delete 'configure)
  200. (delete 'build))))
  201. (inputs
  202. `(("python" ,python)))
  203. (synopsis "Console client for the Transmission BitTorrent daemon")
  204. (description "Tremc is a console client, with a curses interface, for the
  205. Transmission BitTorrent daemon.")
  206. (home-page "https://github.com/tremc/tremc")
  207. (license l:gpl3+)))
  208. (define-public transmission-remote-cli
  209. (package
  210. (name "transmission-remote-cli")
  211. (version "1.7.1")
  212. (source (origin
  213. (method git-fetch)
  214. (uri (git-reference
  215. (url "https://github.com/fagga/transmission-remote-cli.git")
  216. (commit (string-append "v" version))))
  217. (file-name (git-file-name name version))
  218. (sha256
  219. (base32
  220. "09w9f8vrm61lapin8fmq4rgahr95y3c6wss10g0fgd0kl16f895v"))))
  221. (build-system python-build-system)
  222. (arguments
  223. `(#:python ,python-2 ; only supports Python 2
  224. #:tests? #f ; no test suite
  225. #:phases (modify-phases %standard-phases
  226. ;; The software is just a Python script that must be
  227. ;; copied into place.
  228. (delete 'build)
  229. (replace 'install
  230. (lambda* (#:key outputs #:allow-other-keys)
  231. (let* ((out (assoc-ref outputs "out"))
  232. (bin (string-append out "/bin"))
  233. (man (string-append out "/share/man/man1"))
  234. ;; FIXME install zsh completions
  235. (completions (string-append out "/etc/bash_completion.d")))
  236. (install-file "transmission-remote-cli" bin)
  237. (install-file "transmission-remote-cli.1" man)
  238. (install-file
  239. (string-append
  240. "completion/bash/"
  241. "transmission-remote-cli-bash-completion.sh")
  242. completions)))))))
  243. (synopsis "Console client for the Transmission BitTorrent daemon")
  244. (description "Transmission-remote-cli is a console client, with a curses
  245. interface, for the Transmission BitTorrent daemon. This package is no longer
  246. maintained upstream.")
  247. (home-page "https://github.com/fagga/transmission-remote-cli")
  248. (license l:gpl3+)
  249. (properties `((superseded . ,tremc)))))
  250. (define-public aria2
  251. (package
  252. (name "aria2")
  253. (version "1.34.0")
  254. (source (origin
  255. (method url-fetch)
  256. (uri (string-append "https://github.com/tatsuhiro-t/aria2/"
  257. "releases/download/release-" version "/"
  258. name "-" version ".tar.xz"))
  259. (patches (search-patches "aria2-CVE-2019-3500.patch"))
  260. (sha256
  261. (base32
  262. "18vpgr430vxlwbcc3598rr1srfmwypls6wp1m4wf21hncc1ahi1s"))))
  263. (build-system gnu-build-system)
  264. (arguments
  265. `(#:configure-flags (list "--enable-libaria2"
  266. (string-append "--with-bashcompletiondir="
  267. %output "/etc/bash_completion.d/"))
  268. #:phases
  269. (modify-phases %standard-phases
  270. (add-after 'unpack 'delete-socket-tests
  271. (lambda _
  272. (substitute* "test/LpdMessageDispatcherTest.cc"
  273. (("CPPUNIT_TEST_SUITE_REGISTRATION\\(LpdMessageDispatcherTest\\);" text)
  274. (string-append "// " text)))
  275. (substitute* "test/LpdMessageReceiverTest.cc"
  276. (("CPPUNIT_TEST_SUITE_REGISTRATION\\(LpdMessageReceiverTest\\);" text)
  277. (string-append "// " text)))
  278. #t)))))
  279. (native-inputs
  280. `(("cppunit" ,cppunit) ; for the tests
  281. ("pkg-config" ,pkg-config)))
  282. (inputs
  283. `(("c-ares" ,c-ares)
  284. ("gnutls" ,gnutls)
  285. ("gmp" ,gmp)
  286. ("libssh2" ,libssh2)
  287. ("libxml2" ,libxml2)
  288. ("nettle" ,nettle)
  289. ("sqlite" ,sqlite)
  290. ("zlib" ,zlib)))
  291. (home-page "https://aria2.github.io/")
  292. (synopsis "Utility for parallel downloading files")
  293. (description
  294. "Aria2 is a lightweight, multi-protocol & multi-source command-line
  295. download utility. It supports HTTP/HTTPS, FTP, SFTP, BitTorrent and Metalink.
  296. Aria2 can be manipulated via built-in JSON-RPC and XML-RPC interfaces.")
  297. (license l:gpl2+)))
  298. (define-public uget
  299. (package
  300. (name "uget")
  301. (version "2.0.8")
  302. (source (origin
  303. (method url-fetch)
  304. (uri (string-append "mirror://sourceforge/urlget/"
  305. "uget%20%28stable%29/" version "/uget-"
  306. version ".tar.gz"))
  307. (sha256
  308. (base32
  309. "0919cf7lfk1djdl003cahqjvafdliv7v2l8r5wg95n4isqggdk75"))))
  310. (build-system gnu-build-system)
  311. (inputs
  312. `(("curl" ,curl)
  313. ("gtk+" ,gtk+)
  314. ("glib" ,glib)
  315. ("gnutls" ,gnutls)
  316. ("gstreamer" ,gstreamer)
  317. ("libgcrypt" ,libgcrypt)
  318. ("libnotify" ,libnotify)
  319. ("openssl" ,openssl)))
  320. (native-inputs
  321. `(("intltool" ,intltool)
  322. ("pkg-config" ,pkg-config)))
  323. (home-page "http://ugetdm.com/")
  324. (synopsis "Universal download manager with GTK+ interface")
  325. (description
  326. "uGet is portable download manager with GTK+ interface supporting
  327. HTTP, HTTPS, BitTorrent and Metalink, supporting multi-connection
  328. downloads, download scheduling, download rate limiting.")
  329. (license l:lgpl2.1+)))
  330. (define-public mktorrent
  331. (package
  332. (name "mktorrent")
  333. (version "1.1")
  334. (source (origin
  335. (method git-fetch)
  336. (uri (git-reference
  337. (url "https://github.com/Rudde/mktorrent.git")
  338. (commit (string-append "v" version))))
  339. (file-name (git-file-name name version))
  340. (sha256
  341. (base32
  342. "17pdc5mandl739f8q26n5is8ga56s83aqcrwhlnnplbxwx2inidr"))))
  343. (build-system gnu-build-system)
  344. (arguments
  345. `(#:phases (modify-phases %standard-phases
  346. (delete 'configure)) ; no configure script
  347. #:make-flags (list "CC=gcc"
  348. (string-append "PREFIX=" (assoc-ref %outputs "out"))
  349. "NO_HASH_CHECK=1"
  350. "USE_LARGE_FILES=1"
  351. "USE_LONG_OPTIONS=1"
  352. "USE_PTHREADS=1")
  353. #:tests? #f)) ; no tests
  354. (home-page "https://github.com/Rudde/mktorrent")
  355. (synopsis "Utility to create BitTorrent metainfo files")
  356. (description
  357. "mktorrent is a simple command-line utility to create BitTorrent
  358. @dfn{metainfo} files, often known simply as @dfn{torrents}, from both single
  359. files and whole directories. It can add multiple trackers and web seed URLs,
  360. and set the @code{private} flag to disallow advertisement through the
  361. distributed hash table (@dfn{DHT}) and Peer Exchange. Hashing is multi-threaded
  362. and will take advantage of multiple processor cores where possible.")
  363. (license (list l:public-domain ; sha1.*, used to build without OpenSSL
  364. l:gpl2+)))) ; with permission to link with OpenSSL
  365. (define-public libtorrent-rasterbar
  366. (package
  367. (name "libtorrent-rasterbar")
  368. (version "1.1.11")
  369. (source (origin
  370. (method url-fetch)
  371. (uri
  372. (string-append
  373. "https://github.com/arvidn/libtorrent/releases/download/libtorrent_"
  374. (string-join (string-split version #\.) "_")
  375. "/libtorrent-rasterbar-" version ".tar.gz"))
  376. (sha256
  377. (base32
  378. "0isqidr11fnhybr0wvk0qxd97jaikmh8fx9h89b84yd2gyxdw8vw"))))
  379. (build-system gnu-build-system)
  380. (arguments
  381. `(#:configure-flags
  382. (list (string-append "--with-boost-libdir="
  383. (assoc-ref %build-inputs "boost")
  384. "/lib")
  385. "--enable-python-binding"
  386. "--enable-tests"
  387. "CXXFLAGS=-std=c++11") ; Use std::chrono instead of boost
  388. #:make-flags (list
  389. (string-append "LDFLAGS=-Wl,-rpath="
  390. (assoc-ref %outputs "out") "/lib"))
  391. #:phases (modify-phases %standard-phases
  392. (add-after 'unpack 'compile-python-c++11
  393. (lambda _
  394. ;; Make sure the Python bindings are compiled in C++ mode to
  395. ;; avoid undefined references as mentioned in
  396. ;; <https://github.com/qbittorrent/qBittorrent/issues/638>.
  397. ;; XXX: This can be removed for 1.2+.
  398. (substitute* "bindings/python/setup.py"
  399. (("\\+ target_specific\\(\\)\\,")
  400. "+ target_specific() + ['-std=c++11'],"))
  401. #t)))))
  402. (inputs `(("boost" ,boost)
  403. ("openssl" ,openssl)))
  404. (native-inputs `(("python" ,python-2)
  405. ("pkg-config" ,pkg-config)))
  406. (home-page "https://www.libtorrent.org/")
  407. (synopsis "Feature complete BitTorrent implementation")
  408. (description
  409. "libtorrent-rasterbar is a feature complete C++ BitTorrent implementation
  410. focusing on efficiency and scalability. It runs on embedded devices as well as
  411. desktops.")
  412. (license l:bsd-2)))
  413. (define-public qbittorrent
  414. (package
  415. (name "qbittorrent")
  416. (version "4.1.5")
  417. (source
  418. (origin
  419. (method git-fetch)
  420. (uri (git-reference
  421. (url "https://github.com/qbittorrent/qBittorrent.git")
  422. (commit (string-append "release-" version))))
  423. (file-name (git-file-name name version))
  424. (sha256
  425. (base32 "09zcygaxfv9g6av0vsvlyzv4v65wvj766xyfx31yz5ig3xan6ak1"))))
  426. (build-system gnu-build-system)
  427. (arguments
  428. `(#:configure-flags
  429. (list (string-append "--with-boost-libdir="
  430. (assoc-ref %build-inputs "boost")
  431. "/lib")
  432. "--enable-debug"
  433. "QMAKE_LRELEASE=lrelease")))
  434. (native-inputs
  435. `(("pkg-config" ,pkg-config)
  436. ("qttools" ,qttools)))
  437. (inputs
  438. `(("boost" ,boost)
  439. ("libtorrent-rasterbar" ,libtorrent-rasterbar)
  440. ("openssl" ,openssl)
  441. ("python" ,python-wrapper)
  442. ("qtbase" ,qtbase)
  443. ("qtsvg" ,qtsvg)
  444. ("zlib" ,zlib)))
  445. (home-page "https://www.qbittorrent.org/")
  446. (synopsis "Graphical BitTorrent client")
  447. (description
  448. "qBittorrent is a BitTorrent client programmed in C++/Qt that uses
  449. libtorrent (sometimes called libtorrent-rasterbar) by Arvid Norberg.
  450. It aims to be a good alternative to all other BitTorrent clients out there.
  451. qBittorrent is fast, stable and provides unicode support as well as many
  452. features.")
  453. (license l:gpl2+)))
  454. (define-public deluge
  455. (package
  456. (name "deluge")
  457. (version "1.3.15")
  458. (source
  459. (origin
  460. (method url-fetch)
  461. (uri (string-append
  462. "http://download.deluge-torrent.org/source/deluge-"
  463. version ".tar.xz"))
  464. (sha256
  465. (base32
  466. "0b7rri4x0wrcj7rjghrnw1kfrsd5i7i6aq85dsg5dg1w1qa0ar59"))))
  467. (build-system python-build-system)
  468. (inputs
  469. `(("libtorrent" ,libtorrent-rasterbar)
  470. ("python2-chardet" ,python2-chardet)
  471. ("python2-pygtk" ,python2-pygtk)
  472. ("python2-pyopenssl" ,python2-pyopenssl)
  473. ("python2-pyxdg" ,python2-pyxdg)
  474. ("python2-service-identity" ,python2-service-identity)
  475. ("python2-twisted" ,python2-twisted)))
  476. (native-inputs
  477. `(("intltool" ,intltool)))
  478. (arguments
  479. `(#:python ,python-2))
  480. (home-page "https://www.deluge-torrent.org/")
  481. (synopsis "Fully-featured cross-platform ​BitTorrent client")
  482. (description
  483. "Deluge contains the common features to BitTorrent clients such as
  484. Protocol Encryption, DHT, Local Peer Discovery (LSD), Peer Exchange
  485. (PEX), UPnP, NAT-PMP, Proxy support, Web seeds, global and per-torrent
  486. speed limits. Deluge heavily utilises the ​libtorrent library. It is
  487. designed to run as both a normal standalone desktop application and as a
  488. ​client-server.")
  489. (license l:gpl3+)))