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 ;;; Copyright © 2020 Hartmut Goebel <h.goebel@crazy-compilers.com>
15 ;;; This file is part of GNU Guix.
17 ;;; GNU Guix is free software; you can redistribute it and/or modify it
18 ;;; under the terms of the GNU General Public License as published by
19 ;;; the Free Software Foundation; either version 3 of the License, or (at
20 ;;; your option) any later version.
22 ;;; GNU Guix is distributed in the hope that it will be useful, but
23 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
24 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 ;;; GNU General Public License for more details.
27 ;;; You should have received a copy of the GNU General Public License
28 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
30 (define-module (gnu packages bittorrent)
31 #:use-module (guix packages)
32 #:use-module (guix download)
33 #:use-module (guix git-download)
34 #:use-module (guix build-system gnu)
35 #:use-module (guix build-system python)
36 #:use-module (guix build-system glib-or-gtk)
37 #:use-module ((guix licenses) #:prefix l:)
38 #:use-module (guix utils)
39 #:use-module (gnu packages)
40 #:use-module (gnu packages adns)
41 #:use-module (gnu packages boost)
42 #:use-module (gnu packages check)
43 #:use-module (gnu packages compression)
44 #:use-module (gnu packages crypto)
45 #:use-module (gnu packages curl)
46 #:use-module (gnu packages cyrus-sasl)
47 #:use-module (gnu packages freedesktop)
48 #:use-module (gnu packages glib)
49 #:use-module (gnu packages gnome)
50 #:use-module (gnu packages gnupg)
51 #:use-module (gnu packages gstreamer)
52 #:use-module (gnu packages gtk)
53 #:use-module (gnu packages libevent)
54 #:use-module (gnu packages multiprecision)
55 #:use-module (gnu packages nettle)
56 #:use-module (gnu packages ncurses)
57 #:use-module (gnu packages pkg-config)
58 #:use-module (gnu packages python)
59 #:use-module (gnu packages python-build)
60 #:use-module (gnu packages python-crypto)
61 #:use-module (gnu packages python-web)
62 #:use-module (gnu packages python-xyz)
63 #:use-module (gnu packages qt)
64 #:use-module (gnu packages sqlite)
65 #:use-module (gnu packages ssh)
66 #:use-module (gnu packages tls)
67 #:use-module (gnu packages xml))
69 (define-public transmission
75 (uri (string-append "https://github.com/transmission/transmission"
76 "/releases/download/" version "/transmission-"
80 "1wjmn96zrvmk8j1yz2ysmqd7a2x6ilvnwwapcvfzgxs2wwpnai4i"))
81 (patches (search-patches "transmission-honor-localedir.patch"))))
82 (build-system glib-or-gtk-build-system)
83 (outputs '("out" ; library and command-line interface
84 "gui")) ; graphical user interface
87 (list (string-append "--localedir="
88 (assoc-ref %outputs "gui")
90 #:glib-or-gtk-wrap-excluded-outputs '("out")
92 (modify-phases %standard-phases
93 (add-after 'install 'move-gui
94 (lambda* (#:key outputs #:allow-other-keys)
95 ;; Move the GUI to its own output, so that "out" doesn't
97 (let ((out (assoc-ref outputs "out"))
98 (gui (assoc-ref outputs "gui")))
99 (mkdir-p (string-append gui "/bin"))
100 (rename-file (string-append out "/bin/transmission-gtk")
101 (string-append gui "/bin/transmission-gtk"))
105 (rename-file (string-append out "/share/" dir)
106 (string-append gui "/share/" dir)))
107 '("appdata" "applications" "icons" "pixmaps"))
109 (mkdir-p (string-append gui "/share/man/man1"))
111 (string-append out "/share/man/man1/transmission-gtk.1")
112 (string-append gui "/share/man/man1/transmission-gtk.1"))
115 `(("libevent" ,libevent)
121 `(("intltool" ,intltool)
122 ("pkg-config" ,pkg-config)))
123 (home-page "https://transmissionbt.com/")
124 (synopsis "Fast and easy BitTorrent client")
126 "Transmission is a BitTorrent client that comes with graphical,
127 textual, and Web user interfaces. Transmission also has a daemon for
128 unattended operations. It supports local peer discovery, full encryption,
129 DHT, µTP, PEX and Magnet Links.")
133 ;; Transmission can be redistributed and/or modified under the terms of
134 ;; the GNU GPLv2 (http://www.gnu.org/licenses/license-list.html#GPLv2),
135 ;; the GNU GPLv3 (http://www.gnu.org/licenses/license-list.html#GNUGPLv3),
136 ;; or any future license endorsed by Mnemosyne LLC.
138 ;; A few files files carry an MIT/X11 license header.
139 (license (list l:gpl2 l:gpl3))))
141 (define-public libtorrent
148 "http://rtorrent.net/downloads/libtorrent-"
152 "10z9i1rc41cmmi7nx8k7k1agsx6afv09g9cl7g9zr35fyhl5l4gd"))))
153 (build-system gnu-build-system)
154 (inputs `(("openssl" ,openssl)
156 (native-inputs `(("pkg-config" ,pkg-config)
157 ("cppunit" ,cppunit)))
158 (synopsis "BitTorrent library of rtorrent")
160 "LibTorrent is a BitTorrent library used by and developed in parallel
161 with the BitTorrent client rtorrent. It is written in C++ with emphasis on
162 speed and efficiency.")
163 (home-page "https://github.com/rakshasa/libtorrent")
166 (define-public rtorrent
173 "http://rtorrent.net/downloads/rtorrent-"
177 "1bs2fnf4q7mlhkhzp3i1v052v9xn8qa7g845pk9ia8hlpw207pwy"))))
178 (build-system gnu-build-system)
179 (inputs `(("libtorrent" ,libtorrent)
182 ("cyrus-sasl" ,cyrus-sasl)
185 (native-inputs `(("pkg-config" ,pkg-config)
186 ("cppunit" ,cppunit)))
187 (synopsis "BitTorrent client with ncurses interface")
189 "rTorrent is a BitTorrent client with an ncurses interface. It supports
190 full encryption, DHT, PEX, and Magnet Links. It can also be controlled via
192 (home-page "https://github.com/rakshasa/rtorrent")
203 (url "https://github.com/tremc/tremc")
205 (file-name (git-file-name name version))
208 "1fqspp2ckafplahgba54xmx0sjidx1pdzyjaqjhz0ivh98dkx2n5"))))
209 (build-system gnu-build-system)
211 `(#:tests? #f ; no test suite
213 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
215 (modify-phases %standard-phases
216 ;; The software is just a Python script that must be copied into place.
220 `(("python" ,python)))
221 (synopsis "Console client for the Transmission BitTorrent daemon")
222 (description "Tremc is a console client, with a curses interface, for the
223 Transmission BitTorrent daemon.")
224 (home-page "https://github.com/tremc/tremc")
227 (define-public transmission-remote-cli
229 (name "transmission-remote-cli")
234 (url "https://github.com/fagga/transmission-remote-cli")
235 (commit (string-append "v" version))))
236 (file-name (git-file-name name version))
239 "09w9f8vrm61lapin8fmq4rgahr95y3c6wss10g0fgd0kl16f895v"))))
240 (build-system python-build-system)
242 `(#:python ,python-2 ; only supports Python 2
243 #:tests? #f ; no test suite
244 #:phases (modify-phases %standard-phases
245 ;; The software is just a Python script that must be
246 ;; copied into place.
249 (lambda* (#:key outputs #:allow-other-keys)
250 (let* ((out (assoc-ref outputs "out"))
251 (bin (string-append out "/bin"))
252 (man (string-append out "/share/man/man1"))
253 ;; FIXME install zsh completions
254 (completions (string-append out "/etc/bash_completion.d")))
255 (install-file "transmission-remote-cli" bin)
256 (install-file "transmission-remote-cli.1" man)
260 "transmission-remote-cli-bash-completion.sh")
262 (synopsis "Console client for the Transmission BitTorrent daemon")
263 (description "Transmission-remote-cli is a console client, with a curses
264 interface, for the Transmission BitTorrent daemon. This package is no longer
265 maintained upstream.")
266 (home-page "https://github.com/fagga/transmission-remote-cli")
268 (properties `((superseded . ,tremc)))))
276 (uri (string-append "https://github.com/aria2/aria2/releases/"
277 "download/release-" version
278 "/aria2-" version ".tar.xz"))
281 "1zbxc517d97lb96f15xcy4l7b66grxrp3h2ids2jiwkaip87yaqy"))))
282 (build-system gnu-build-system)
284 `(#:configure-flags (list "--enable-libaria2"
285 (string-append "--with-bashcompletiondir="
286 %output "/etc/bash_completion.d/"))
288 (modify-phases %standard-phases
289 (add-after 'unpack 'delete-socket-tests
291 (substitute* "test/LpdMessageDispatcherTest.cc"
292 (("CPPUNIT_TEST_SUITE_REGISTRATION\\(LpdMessageDispatcherTest\\);" text)
293 (string-append "// " text)))
294 (substitute* "test/LpdMessageReceiverTest.cc"
295 (("CPPUNIT_TEST_SUITE_REGISTRATION\\(LpdMessageReceiverTest\\);" text)
296 (string-append "// " text)))
299 `(("cppunit" ,cppunit) ; for the tests
300 ("pkg-config" ,pkg-config)))
310 (home-page "https://aria2.github.io/")
311 (synopsis "Utility for parallel downloading files")
313 "Aria2 is a lightweight, multi-protocol & multi-source command-line
314 download utility. It supports HTTP/HTTPS, FTP, SFTP, BitTorrent and Metalink.
315 Aria2 can be manipulated via built-in JSON-RPC and XML-RPC interfaces.")
325 (uri (string-append "mirror://sourceforge/urlget/"
326 "uget%20%28stable%29/" version "/uget-"
329 (base32 "0dlrjhnm1pg2vwmp7nl2xv1aia5hyirb3021rl46x859k63zap24"))))
330 (build-system gnu-build-system)
336 ("gstreamer" ,gstreamer)
337 ("libgcrypt" ,libgcrypt)
338 ("libnotify" ,libnotify)
339 ("openssl" ,openssl)))
341 `(("intltool" ,intltool)
342 ("pkg-config" ,pkg-config)))
343 (home-page "https://ugetdm.com/")
344 (synopsis "Universal download manager with GTK+ interface")
346 "uGet is portable download manager with GTK+ interface supporting
347 HTTP, HTTPS, BitTorrent and Metalink, supporting multi-connection
348 downloads, download scheduling, download rate limiting.")
349 (license l:lgpl2.1+)))
351 (define-public mktorrent
358 (url "https://github.com/Rudde/mktorrent")
359 (commit (string-append "v" version))))
360 (file-name (git-file-name name version))
363 "17pdc5mandl739f8q26n5is8ga56s83aqcrwhlnnplbxwx2inidr"))))
364 (build-system gnu-build-system)
366 `(#:phases (modify-phases %standard-phases
367 (delete 'configure)) ; no configure script
368 #:make-flags (list (string-append "CC=" ,(cc-for-target))
369 (string-append "PREFIX=" (assoc-ref %outputs "out"))
374 #:tests? #f)) ; no tests
375 (home-page "https://github.com/Rudde/mktorrent")
376 (synopsis "Utility to create BitTorrent metainfo files")
378 "mktorrent is a simple command-line utility to create BitTorrent
379 @dfn{metainfo} files, often known simply as @dfn{torrents}, from both single
380 files and whole directories. It can add multiple trackers and web seed URLs,
381 and set the @code{private} flag to disallow advertisement through the
382 distributed hash table (@dfn{DHT}) and Peer Exchange. Hashing is multi-threaded
383 and will take advantage of multiple processor cores where possible.")
384 (license (list l:public-domain ; sha1.*, used to build without OpenSSL
385 l:gpl2+)))) ; with permission to link with OpenSSL
387 (define-public libtorrent-rasterbar
389 (name "libtorrent-rasterbar")
395 (string-append "https://github.com/arvidn/libtorrent/"
396 "releases/download/libtorrent-" version "/"
397 "libtorrent-rasterbar-" version ".tar.gz"))
399 (base32 "1phn4klzvfzvidv5g566pnrrxj8l0givpy6s4r17d45wznqxc006"))))
400 (build-system gnu-build-system)
403 (list (string-append "--with-boost-libdir="
404 (assoc-ref %build-inputs "boost")
406 "--enable-python-binding"
409 (string-append "LDFLAGS=-Wl,-rpath="
410 (assoc-ref %outputs "out") "/lib"))))
411 (inputs `(("boost" ,boost)
412 ("openssl" ,openssl)))
413 (native-inputs `(("python" ,python-wrapper)
414 ("pkg-config" ,pkg-config)))
415 (home-page "https://www.libtorrent.org/")
416 (synopsis "Feature-complete BitTorrent implementation")
418 "libtorrent-rasterbar is a feature-complete C++ BitTorrent implementation
419 focusing on efficiency and scalability. It runs on embedded devices as well as
423 (define-public qbittorrent
431 (url "https://github.com/qbittorrent/qBittorrent")
432 (commit (string-append "release-" version))))
433 (file-name (git-file-name name version))
435 (base32 "1n613ylg6i9gisgk0dbr2kpfasyizrkdjff1r8smd4vri2qrdksn"))))
436 (build-system gnu-build-system)
439 (list (string-append "--with-boost-libdir="
440 (assoc-ref %build-inputs "boost")
443 "QMAKE_LRELEASE=lrelease")
444 #:modules ((guix build gnu-build-system)
445 (guix build qt-utils)
447 #:imported-modules (,@%gnu-build-system-modules
448 (guix build qt-utils))
450 (modify-phases %standard-phases
451 (add-after 'install 'wrap-qt
452 (lambda* (#:key outputs inputs #:allow-other-keys)
453 (let ((out (assoc-ref outputs "out")))
454 (wrap-qt-program "qbittorrent" #:output out #:inputs inputs))
457 `(("pkg-config" ,pkg-config)
458 ("qttools" ,qttools)))
461 ("libtorrent-rasterbar" ,libtorrent-rasterbar)
463 ("python" ,python-wrapper)
467 (home-page "https://www.qbittorrent.org/")
468 (synopsis "Graphical BitTorrent client")
470 "qBittorrent is a BitTorrent client programmed in C++/Qt that uses
471 libtorrent (sometimes called libtorrent-rasterbar) by Arvid Norberg.
473 It aims to be a good alternative to all other BitTorrent clients out there.
474 qBittorrent is fast, stable and provides unicode support as well as many
478 (define-public deluge
486 "https://ftp.osuosl.org/pub/deluge/source/"
487 (version-major+minor version) "/deluge-" version ".tar.xz"))
490 "14d8kn2pvr1qv8mwqrxmj85jycr73vwfqz12hzag0ararbkfhyky"))))
491 (build-system python-build-system)
495 ("libtorrent" ,libtorrent-rasterbar)
496 ("python-pycairo" ,python-pycairo)
497 ("python-chardet" ,python-chardet)
498 ("python-dbus" ,python-dbus)
499 ("python-mako" ,python-mako)
500 ("python-pygobject" ,python-pygobject)
501 ("python-pillow" ,python-pillow)
502 ("python-pyopenssl" ,python-pyopenssl)
503 ("python-pyxdg" ,python-pyxdg)
504 ("python-rencode" ,python-rencode)
505 ("python-service-identity" ,python-service-identity)
506 ("python-setproctitle" ,python-setproctitle)
507 ("python-six" ,python-six)
508 ("python-twisted" ,python-twisted)
509 ("python-zope-interface" ,python-zope-interface)))
511 `(("intltool" ,intltool)
512 ("python-wheel" ,python-wheel)))
513 ;; TODO: Enable tests.
514 ;; After "pytest-twisted" is packaged, HOME is set, and an X server is
515 ;; started, some of the tests still fail. There are likely some tests
516 ;; that require a network connection.
520 (modify-phases %standard-phases
521 ;; Remove this phase when upgrading to version 2.0.4 or beyond, as
522 ;; the issue is fixed upstream.
523 (add-after 'unpack 'fix-gettext-warning
525 (substitute* "deluge/i18n/util.py"
526 (("names='ngettext'") "names=['ngettext']"))
528 (add-after 'install 'wrap
529 (lambda* (#:key outputs #:allow-other-keys)
530 (let ((out (assoc-ref outputs "out"))
531 (gi-typelib-path (getenv "GI_TYPELIB_PATH")))
534 (wrap-program program
535 `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))))
537 (string-append out "/bin/" name))
538 '("deluge" "deluge-gtk"))))
540 (home-page "https://www.deluge-torrent.org/")
541 (synopsis "Fully-featured cross-platform BitTorrent client")
543 "Deluge contains the common features to BitTorrent clients such as
544 Protocol Encryption, DHT, Local Peer Discovery (LSD), Peer Exchange
545 (PEX), UPnP, NAT-PMP, Proxy support, Web seeds, global and per-torrent
546 speed limits. Deluge heavily utilises the libtorrent library. It is
547 designed to run as both a normal standalone desktop application and as a