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