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>
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-build)
59 #:use-module (gnu packages python-crypto)
60 #:use-module (gnu packages python-web)
61 #:use-module (gnu packages python-xyz)
62 #:use-module (gnu packages qt)
63 #:use-module (gnu packages sqlite)
64 #:use-module (gnu packages ssh)
65 #:use-module (gnu packages tls)
66 #:use-module (gnu packages xml))
68 (define-public transmission
74 (uri (string-append "https://github.com/transmission/transmission"
75 "/releases/download/" version "/transmission-"
79 "1wjmn96zrvmk8j1yz2ysmqd7a2x6ilvnwwapcvfzgxs2wwpnai4i"))
80 (patches (search-patches "transmission-honor-localedir.patch"))))
81 (build-system glib-or-gtk-build-system)
82 (outputs '("out" ; library and command-line interface
83 "gui")) ; graphical user interface
86 (list (string-append "--localedir="
87 (assoc-ref %outputs "gui")
89 #:glib-or-gtk-wrap-excluded-outputs '("out")
91 (modify-phases %standard-phases
92 (add-after 'install 'move-gui
93 (lambda* (#:key outputs #:allow-other-keys)
94 ;; Move the GUI to its own output, so that "out" doesn't
96 (let ((out (assoc-ref outputs "out"))
97 (gui (assoc-ref outputs "gui")))
98 (mkdir-p (string-append gui "/bin"))
99 (rename-file (string-append out "/bin/transmission-gtk")
100 (string-append gui "/bin/transmission-gtk"))
104 (rename-file (string-append out "/share/" dir)
105 (string-append gui "/share/" dir)))
106 '("appdata" "applications" "icons" "pixmaps"))
108 (mkdir-p (string-append gui "/share/man/man1"))
110 (string-append out "/share/man/man1/transmission-gtk.1")
111 (string-append gui "/share/man/man1/transmission-gtk.1"))
114 `(("libevent" ,libevent)
120 `(("intltool" ,intltool)
121 ("pkg-config" ,pkg-config)))
122 (home-page "https://transmissionbt.com/")
123 (synopsis "Fast and easy BitTorrent client")
125 "Transmission is a BitTorrent client that comes with graphical,
126 textual, and Web user interfaces. Transmission also has a daemon for
127 unattended operations. It supports local peer discovery, full encryption,
128 DHT, µTP, PEX and Magnet Links.")
132 ;; Transmission can be redistributed and/or modified under the terms of
133 ;; the GNU GPLv2 (http://www.gnu.org/licenses/license-list.html#GPLv2),
134 ;; the GNU GPLv3 (http://www.gnu.org/licenses/license-list.html#GNUGPLv3),
135 ;; or any future license endorsed by Mnemosyne LLC.
137 ;; A few files files carry an MIT/X11 license header.
138 (license (list l:gpl2 l:gpl3))))
140 (define-public libtorrent
147 "http://rtorrent.net/downloads/libtorrent-"
151 "10z9i1rc41cmmi7nx8k7k1agsx6afv09g9cl7g9zr35fyhl5l4gd"))))
152 (build-system gnu-build-system)
153 (inputs `(("openssl" ,openssl)
155 (native-inputs `(("pkg-config" ,pkg-config)
156 ("cppunit" ,cppunit)))
157 (synopsis "BitTorrent library of rtorrent")
159 "LibTorrent is a BitTorrent library used by and developed in parallel
160 with the BitTorrent client rtorrent. It is written in C++ with emphasis on
161 speed and efficiency.")
162 (home-page "https://github.com/rakshasa/libtorrent")
165 (define-public rtorrent
172 "http://rtorrent.net/downloads/rtorrent-"
176 "1bs2fnf4q7mlhkhzp3i1v052v9xn8qa7g845pk9ia8hlpw207pwy"))))
177 (build-system gnu-build-system)
178 (inputs `(("libtorrent" ,libtorrent)
181 ("cyrus-sasl" ,cyrus-sasl)
184 (native-inputs `(("pkg-config" ,pkg-config)
185 ("cppunit" ,cppunit)))
186 (synopsis "BitTorrent client with ncurses interface")
188 "rTorrent is a BitTorrent client with an ncurses interface. It supports
189 full encryption, DHT, PEX, and Magnet Links. It can also be controlled via
191 (home-page "https://github.com/rakshasa/rtorrent")
202 (url "https://github.com/tremc/tremc")
204 (file-name (git-file-name name version))
207 "1fqspp2ckafplahgba54xmx0sjidx1pdzyjaqjhz0ivh98dkx2n5"))))
208 (build-system gnu-build-system)
210 `(#:tests? #f ; no test suite
212 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
214 (modify-phases %standard-phases
215 ;; The software is just a Python script that must be copied into place.
219 `(("python" ,python)))
220 (synopsis "Console client for the Transmission BitTorrent daemon")
221 (description "Tremc is a console client, with a curses interface, for the
222 Transmission BitTorrent daemon.")
223 (home-page "https://github.com/tremc/tremc")
226 (define-public transmission-remote-cli
228 (name "transmission-remote-cli")
233 (url "https://github.com/fagga/transmission-remote-cli")
234 (commit (string-append "v" version))))
235 (file-name (git-file-name name version))
238 "09w9f8vrm61lapin8fmq4rgahr95y3c6wss10g0fgd0kl16f895v"))))
239 (build-system python-build-system)
241 `(#:python ,python-2 ; only supports Python 2
242 #:tests? #f ; no test suite
243 #:phases (modify-phases %standard-phases
244 ;; The software is just a Python script that must be
245 ;; copied into place.
248 (lambda* (#:key outputs #:allow-other-keys)
249 (let* ((out (assoc-ref outputs "out"))
250 (bin (string-append out "/bin"))
251 (man (string-append out "/share/man/man1"))
252 ;; FIXME install zsh completions
253 (completions (string-append out "/etc/bash_completion.d")))
254 (install-file "transmission-remote-cli" bin)
255 (install-file "transmission-remote-cli.1" man)
259 "transmission-remote-cli-bash-completion.sh")
261 (synopsis "Console client for the Transmission BitTorrent daemon")
262 (description "Transmission-remote-cli is a console client, with a curses
263 interface, for the Transmission BitTorrent daemon. This package is no longer
264 maintained upstream.")
265 (home-page "https://github.com/fagga/transmission-remote-cli")
267 (properties `((superseded . ,tremc)))))
275 (uri (string-append "https://github.com/aria2/aria2/releases/"
276 "download/release-" version
277 "/aria2-" version ".tar.xz"))
280 "1zbxc517d97lb96f15xcy4l7b66grxrp3h2ids2jiwkaip87yaqy"))))
281 (build-system gnu-build-system)
283 `(#:configure-flags (list "--enable-libaria2"
284 (string-append "--with-bashcompletiondir="
285 %output "/etc/bash_completion.d/"))
287 (modify-phases %standard-phases
288 (add-after 'unpack 'delete-socket-tests
290 (substitute* "test/LpdMessageDispatcherTest.cc"
291 (("CPPUNIT_TEST_SUITE_REGISTRATION\\(LpdMessageDispatcherTest\\);" text)
292 (string-append "// " text)))
293 (substitute* "test/LpdMessageReceiverTest.cc"
294 (("CPPUNIT_TEST_SUITE_REGISTRATION\\(LpdMessageReceiverTest\\);" text)
295 (string-append "// " text)))
298 `(("cppunit" ,cppunit) ; for the tests
299 ("pkg-config" ,pkg-config)))
309 (home-page "https://aria2.github.io/")
310 (synopsis "Utility for parallel downloading files")
312 "Aria2 is a lightweight, multi-protocol & multi-source command-line
313 download utility. It supports HTTP/HTTPS, FTP, SFTP, BitTorrent and Metalink.
314 Aria2 can be manipulated via built-in JSON-RPC and XML-RPC interfaces.")
324 (uri (string-append "mirror://sourceforge/urlget/"
325 "uget%20%28stable%29/" version "/uget-"
328 (base32 "0dlrjhnm1pg2vwmp7nl2xv1aia5hyirb3021rl46x859k63zap24"))))
329 (build-system gnu-build-system)
335 ("gstreamer" ,gstreamer)
336 ("libgcrypt" ,libgcrypt)
337 ("libnotify" ,libnotify)
338 ("openssl" ,openssl)))
340 `(("intltool" ,intltool)
341 ("pkg-config" ,pkg-config)))
342 (home-page "https://ugetdm.com/")
343 (synopsis "Universal download manager with GTK+ interface")
345 "uGet is portable download manager with GTK+ interface supporting
346 HTTP, HTTPS, BitTorrent and Metalink, supporting multi-connection
347 downloads, download scheduling, download rate limiting.")
348 (license l:lgpl2.1+)))
350 (define-public mktorrent
357 (url "https://github.com/Rudde/mktorrent")
358 (commit (string-append "v" version))))
359 (file-name (git-file-name name version))
362 "17pdc5mandl739f8q26n5is8ga56s83aqcrwhlnnplbxwx2inidr"))))
363 (build-system gnu-build-system)
365 `(#:phases (modify-phases %standard-phases
366 (delete 'configure)) ; no configure script
367 #:make-flags (list (string-append "CC=" ,(cc-for-target))
368 (string-append "PREFIX=" (assoc-ref %outputs "out"))
373 #:tests? #f)) ; no tests
374 (home-page "https://github.com/Rudde/mktorrent")
375 (synopsis "Utility to create BitTorrent metainfo files")
377 "mktorrent is a simple command-line utility to create BitTorrent
378 @dfn{metainfo} files, often known simply as @dfn{torrents}, from both single
379 files and whole directories. It can add multiple trackers and web seed URLs,
380 and set the @code{private} flag to disallow advertisement through the
381 distributed hash table (@dfn{DHT}) and Peer Exchange. Hashing is multi-threaded
382 and will take advantage of multiple processor cores where possible.")
383 (license (list l:public-domain ; sha1.*, used to build without OpenSSL
384 l:gpl2+)))) ; with permission to link with OpenSSL
386 (define-public libtorrent-rasterbar
388 (name "libtorrent-rasterbar")
394 (string-append "https://github.com/arvidn/libtorrent/"
395 "releases/download/libtorrent-" version "/"
396 "libtorrent-rasterbar-" version ".tar.gz"))
398 (base32 "1phn4klzvfzvidv5g566pnrrxj8l0givpy6s4r17d45wznqxc006"))))
399 (build-system gnu-build-system)
402 (list (string-append "--with-boost-libdir="
403 (assoc-ref %build-inputs "boost")
405 "--enable-python-binding"
408 (string-append "LDFLAGS=-Wl,-rpath="
409 (assoc-ref %outputs "out") "/lib"))))
410 (inputs `(("boost" ,boost)
411 ("openssl" ,openssl)))
412 (native-inputs `(("python" ,python-wrapper)
413 ("pkg-config" ,pkg-config)))
414 (home-page "https://www.libtorrent.org/")
415 (synopsis "Feature-complete BitTorrent implementation")
417 "libtorrent-rasterbar is a feature-complete C++ BitTorrent implementation
418 focusing on efficiency and scalability. It runs on embedded devices as well as
422 (define-public qbittorrent
430 (url "https://github.com/qbittorrent/qBittorrent")
431 (commit (string-append "release-" version))))
432 (file-name (git-file-name name version))
434 (base32 "1n613ylg6i9gisgk0dbr2kpfasyizrkdjff1r8smd4vri2qrdksn"))))
435 (build-system gnu-build-system)
438 (list (string-append "--with-boost-libdir="
439 (assoc-ref %build-inputs "boost")
442 "QMAKE_LRELEASE=lrelease")
443 #:modules ((guix build gnu-build-system)
444 (guix build qt-utils)
446 #:imported-modules (,@%gnu-build-system-modules
447 (guix build qt-utils))
449 (modify-phases %standard-phases
450 (add-after 'install 'wrap-qt
451 (lambda* (#:key outputs #:allow-other-keys)
452 (wrap-qt-program (assoc-ref outputs "out") "qbittorrent")
455 `(("pkg-config" ,pkg-config)
456 ("qttools" ,qttools)))
459 ("libtorrent-rasterbar" ,libtorrent-rasterbar)
461 ("python" ,python-wrapper)
465 (home-page "https://www.qbittorrent.org/")
466 (synopsis "Graphical BitTorrent client")
468 "qBittorrent is a BitTorrent client programmed in C++/Qt that uses
469 libtorrent (sometimes called libtorrent-rasterbar) by Arvid Norberg.
471 It aims to be a good alternative to all other BitTorrent clients out there.
472 qBittorrent is fast, stable and provides unicode support as well as many
476 (define-public deluge
484 "https://ftp.osuosl.org/pub/deluge/source/"
485 (version-major+minor version) "/deluge-" version ".tar.xz"))
488 "14d8kn2pvr1qv8mwqrxmj85jycr73vwfqz12hzag0ararbkfhyky"))))
489 (build-system python-build-system)
493 ("libtorrent" ,libtorrent-rasterbar)
494 ("python-pycairo" ,python-pycairo)
495 ("python-chardet" ,python-chardet)
496 ("python-dbus" ,python-dbus)
497 ("python-mako" ,python-mako)
498 ("python-pygobject" ,python-pygobject)
499 ("python-pillow" ,python-pillow)
500 ("python-pyopenssl" ,python-pyopenssl)
501 ("python-pyxdg" ,python-pyxdg)
502 ("python-rencode" ,python-rencode)
503 ("python-service-identity" ,python-service-identity)
504 ("python-setproctitle" ,python-setproctitle)
505 ("python-six" ,python-six)
506 ("python-twisted" ,python-twisted)
507 ("python-zope-interface" ,python-zope-interface)))
509 `(("intltool" ,intltool)
510 ("python-wheel" ,python-wheel)))
511 ;; TODO: Enable tests.
512 ;; After "pytest-twisted" is packaged, HOME is set, and an X server is
513 ;; started, some of the tests still fail. There are likely some tests
514 ;; that require a network connection.
518 (modify-phases %standard-phases
519 ;; Remove this phase when upgrading to version 2.0.4 or beyond, as
520 ;; the issue is fixed upstream.
521 (add-after 'unpack 'fix-gettext-warning
523 (substitute* "deluge/i18n/util.py"
524 (("names='ngettext'") "names=['ngettext']"))
526 (add-after 'install 'wrap
527 (lambda* (#:key outputs #:allow-other-keys)
528 (let ((out (assoc-ref outputs "out"))
529 (gi-typelib-path (getenv "GI_TYPELIB_PATH")))
532 (wrap-program program
533 `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))))
535 (string-append out "/bin/" name))
536 '("deluge" "deluge-gtk"))))
538 (home-page "https://www.deluge-torrent.org/")
539 (synopsis "Fully-featured cross-platform BitTorrent client")
541 "Deluge contains the common features to BitTorrent clients such as
542 Protocol Encryption, DHT, Local Peer Discovery (LSD), Peer Exchange
543 (PEX), UPnP, NAT-PMP, Proxy support, Web seeds, global and per-torrent
544 speed limits. Deluge heavily utilises the libtorrent library. It is
545 designed to run as both a normal standalone desktop application and as a