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