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>
14 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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))
67 (define-public transmission
73 (uri (string-append "https://github.com/transmission/transmission"
74 "/releases/download/" version "/transmission-"
78 "1wjmn96zrvmk8j1yz2ysmqd7a2x6ilvnwwapcvfzgxs2wwpnai4i"))))
79 (build-system glib-or-gtk-build-system)
80 (outputs '("out" ; library and command-line interface
81 "gui")) ; graphical user interface
83 '(#:glib-or-gtk-wrap-excluded-outputs '("out")
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
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"))
96 ;; Move the '.desktop' and icon files as well.
97 (mkdir (string-append gui "/share"))
100 (rename-file (string-append out "/share/" dir)
101 (string-append gui "/share/" dir)))
102 '("applications" "icons" "pixmaps")))
105 `(("libevent" ,libevent)
111 `(("intltool" ,intltool)
112 ("pkg-config" ,pkg-config)))
113 (home-page "https://transmissionbt.com/")
114 (synopsis "Fast and easy BitTorrent client")
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.")
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.
128 ;; A few files files carry an MIT/X11 license header.
129 (license (list l:gpl2 l:gpl3))))
131 (define-public libtorrent
138 "http://rtorrent.net/downloads/libtorrent-"
142 "10z9i1rc41cmmi7nx8k7k1agsx6afv09g9cl7g9zr35fyhl5l4gd"))))
143 (build-system gnu-build-system)
144 (inputs `(("openssl" ,openssl)
146 (native-inputs `(("pkg-config" ,pkg-config)
147 ("cppunit" ,cppunit)))
148 (synopsis "BitTorrent library of rtorrent")
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")
156 (define-public rtorrent
163 "http://rtorrent.net/downloads/rtorrent-"
167 "1bs2fnf4q7mlhkhzp3i1v052v9xn8qa7g845pk9ia8hlpw207pwy"))))
168 (build-system gnu-build-system)
169 (inputs `(("libtorrent" ,libtorrent)
172 ("cyrus-sasl" ,cyrus-sasl)
175 (native-inputs `(("pkg-config" ,pkg-config)
176 ("cppunit" ,cppunit)))
177 (synopsis "BitTorrent client with ncurses interface")
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
182 (home-page "https://github.com/rakshasa/rtorrent")
193 (url "https://github.com/tremc/tremc")
195 (file-name (git-file-name name version))
198 "1fqspp2ckafplahgba54xmx0sjidx1pdzyjaqjhz0ivh98dkx2n5"))))
199 (build-system gnu-build-system)
201 `(#:tests? #f ; no test suite
203 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
205 (modify-phases %standard-phases
206 ;; The software is just a Python script that must be copied into place.
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")
217 (define-public transmission-remote-cli
219 (name "transmission-remote-cli")
224 (url "https://github.com/fagga/transmission-remote-cli")
225 (commit (string-append "v" version))))
226 (file-name (git-file-name name version))
229 "09w9f8vrm61lapin8fmq4rgahr95y3c6wss10g0fgd0kl16f895v"))))
230 (build-system python-build-system)
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.
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)
250 "transmission-remote-cli-bash-completion.sh")
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")
258 (properties `((superseded . ,tremc)))))
266 (uri (string-append "https://github.com/aria2/aria2/releases/"
267 "download/release-" version
268 "/aria2-" version ".tar.xz"))
271 "1zbxc517d97lb96f15xcy4l7b66grxrp3h2ids2jiwkaip87yaqy"))))
272 (build-system gnu-build-system)
274 `(#:configure-flags (list "--enable-libaria2"
275 (string-append "--with-bashcompletiondir="
276 %output "/etc/bash_completion.d/"))
278 (modify-phases %standard-phases
279 (add-after 'unpack 'delete-socket-tests
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)))
289 `(("cppunit" ,cppunit) ; for the tests
290 ("pkg-config" ,pkg-config)))
300 (home-page "https://aria2.github.io/")
301 (synopsis "Utility for parallel downloading files")
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.")
315 (uri (string-append "mirror://sourceforge/urlget/"
316 "uget%20%28stable%29/" version "/uget-"
319 (base32 "0rg2mr2cndxvnjib8zm5dp7y2hgbvnqkz2j2jmg0xlzfh9d34b2m"))))
320 (build-system gnu-build-system)
326 ("gstreamer" ,gstreamer)
327 ("libgcrypt" ,libgcrypt)
328 ("libnotify" ,libnotify)
329 ("openssl" ,openssl)))
331 `(("intltool" ,intltool)
332 ("pkg-config" ,pkg-config)))
333 (home-page "https://ugetdm.com/")
334 (synopsis "Universal download manager with GTK+ interface")
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+)))
341 (define-public mktorrent
348 (url "https://github.com/Rudde/mktorrent")
349 (commit (string-append "v" version))))
350 (file-name (git-file-name name version))
353 "17pdc5mandl739f8q26n5is8ga56s83aqcrwhlnnplbxwx2inidr"))))
354 (build-system gnu-build-system)
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"))
364 #:tests? #f)) ; no tests
365 (home-page "https://github.com/Rudde/mktorrent")
366 (synopsis "Utility to create BitTorrent metainfo files")
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
377 (define-public libtorrent-rasterbar
379 (name "libtorrent-rasterbar")
385 (string-append "https://github.com/arvidn/libtorrent/"
386 "releases/download/libtorrent-" version "/"
387 "libtorrent-rasterbar-" version ".tar.gz"))
389 (base32 "1phn4klzvfzvidv5g566pnrrxj8l0givpy6s4r17d45wznqxc006"))))
390 (build-system gnu-build-system)
393 (list (string-append "--with-boost-libdir="
394 (assoc-ref %build-inputs "boost")
396 "--enable-python-binding"
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")
408 "libtorrent-rasterbar is a feature-complete C++ BitTorrent implementation
409 focusing on efficiency and scalability. It runs on embedded devices as well as
413 (define-public qbittorrent
421 (url "https://github.com/qbittorrent/qBittorrent")
422 (commit (string-append "release-" version))))
423 (file-name (git-file-name name version))
425 (base32 "1n613ylg6i9gisgk0dbr2kpfasyizrkdjff1r8smd4vri2qrdksn"))))
426 (build-system gnu-build-system)
429 (list (string-append "--with-boost-libdir="
430 (assoc-ref %build-inputs "boost")
433 "QMAKE_LRELEASE=lrelease")
434 #:modules ((guix build gnu-build-system)
435 (guix build qt-utils)
437 #:imported-modules (,@%gnu-build-system-modules
438 (guix build qt-utils))
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")
446 `(("pkg-config" ,pkg-config)
447 ("qttools" ,qttools)))
450 ("libtorrent-rasterbar" ,libtorrent-rasterbar)
452 ("python" ,python-wrapper)
456 (home-page "https://www.qbittorrent.org/")
457 (synopsis "Graphical BitTorrent client")
459 "qBittorrent is a BitTorrent client programmed in C++/Qt that uses
460 libtorrent (sometimes called libtorrent-rasterbar) by Arvid Norberg.
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
467 (define-public deluge
475 "https://ftp.osuosl.org/pub/deluge/source/"
476 (version-major+minor version) "/deluge-" version ".tar.xz"))
479 "14d8kn2pvr1qv8mwqrxmj85jycr73vwfqz12hzag0ararbkfhyky"))))
480 (build-system python-build-system)
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)))
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.
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
514 (substitute* "deluge/i18n/util.py"
515 (("names='ngettext'") "names=['ngettext']"))
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")))
523 (wrap-program program
524 `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))))
526 (string-append out "/bin/" name))
527 '("deluge" "deluge-gtk"))))
529 (home-page "https://www.deluge-torrent.org/")
530 (synopsis "Fully-featured cross-platform BitTorrent client")
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