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