guix: qt-build-system, qt-utils: Unify wrapping of qt-programs.
[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 ;;; Copyright © 2020 Hartmut Goebel <h.goebel@crazy-compilers.com>
14 ;;;
15 ;;; This file is part of GNU Guix.
16 ;;;
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.
21 ;;;
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.
26 ;;;
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/>.
29
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))
68
69 (define-public transmission
70 (package
71 (name "transmission")
72 (version "3.00")
73 (source (origin
74 (method url-fetch)
75 (uri (string-append "https://github.com/transmission/transmission"
76 "/releases/download/" version "/transmission-"
77 version ".tar.xz"))
78 (sha256
79 (base32
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
85 (arguments
86 '(#:configure-flags
87 (list (string-append "--localedir="
88 (assoc-ref %outputs "gui")
89 "/share/locale"))
90 #:glib-or-gtk-wrap-excluded-outputs '("out")
91 #:phases
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
96 ;; depend on GTK+.
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"))
102
103 (for-each
104 (lambda (dir)
105 (rename-file (string-append out "/share/" dir)
106 (string-append gui "/share/" dir)))
107 '("appdata" "applications" "icons" "pixmaps"))
108
109 (mkdir-p (string-append gui "/share/man/man1"))
110 (rename-file
111 (string-append out "/share/man/man1/transmission-gtk.1")
112 (string-append gui "/share/man/man1/transmission-gtk.1"))
113 #t))))))
114 (inputs
115 `(("libevent" ,libevent)
116 ("curl" ,curl)
117 ("openssl" ,openssl)
118 ("zlib" ,zlib)
119 ("gtk+" ,gtk+)))
120 (native-inputs
121 `(("intltool" ,intltool)
122 ("pkg-config" ,pkg-config)))
123 (home-page "https://transmissionbt.com/")
124 (synopsis "Fast and easy BitTorrent client")
125 (description
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.")
130
131 ;; COPYING reads:
132 ;;
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.
137 ;;
138 ;; A few files files carry an MIT/X11 license header.
139 (license (list l:gpl2 l:gpl3))))
140
141 (define-public libtorrent
142 (package
143 (name "libtorrent")
144 (version "0.13.8")
145 (source (origin
146 (method url-fetch)
147 (uri (string-append
148 "http://rtorrent.net/downloads/libtorrent-"
149 version ".tar.gz"))
150 (sha256
151 (base32
152 "10z9i1rc41cmmi7nx8k7k1agsx6afv09g9cl7g9zr35fyhl5l4gd"))))
153 (build-system gnu-build-system)
154 (inputs `(("openssl" ,openssl)
155 ("zlib" ,zlib)))
156 (native-inputs `(("pkg-config" ,pkg-config)
157 ("cppunit" ,cppunit)))
158 (synopsis "BitTorrent library of rtorrent")
159 (description
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")
164 (license l:gpl2+)))
165
166 (define-public rtorrent
167 (package
168 (name "rtorrent")
169 (version "0.9.8")
170 (source (origin
171 (method url-fetch)
172 (uri (string-append
173 "http://rtorrent.net/downloads/rtorrent-"
174 version ".tar.gz"))
175 (sha256
176 (base32
177 "1bs2fnf4q7mlhkhzp3i1v052v9xn8qa7g845pk9ia8hlpw207pwy"))))
178 (build-system gnu-build-system)
179 (inputs `(("libtorrent" ,libtorrent)
180 ("ncurses" ,ncurses)
181 ("curl" ,curl)
182 ("cyrus-sasl" ,cyrus-sasl)
183 ("openssl" ,openssl)
184 ("zlib" ,zlib)))
185 (native-inputs `(("pkg-config" ,pkg-config)
186 ("cppunit" ,cppunit)))
187 (synopsis "BitTorrent client with ncurses interface")
188 (description
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
191 XML-RPC over SCGI.")
192 (home-page "https://github.com/rakshasa/rtorrent")
193 (license l:gpl2+)))
194
195 (define-public tremc
196 (package
197 (name "tremc")
198 (version "0.9.2")
199 (source
200 (origin
201 (method git-fetch)
202 (uri (git-reference
203 (url "https://github.com/tremc/tremc")
204 (commit version)))
205 (file-name (git-file-name name version))
206 (sha256
207 (base32
208 "1fqspp2ckafplahgba54xmx0sjidx1pdzyjaqjhz0ivh98dkx2n5"))))
209 (build-system gnu-build-system)
210 (arguments
211 `(#:tests? #f ; no test suite
212 #:make-flags
213 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
214 #:phases
215 (modify-phases %standard-phases
216 ;; The software is just a Python script that must be copied into place.
217 (delete 'configure)
218 (delete 'build))))
219 (inputs
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")
225 (license l:gpl3+)))
226
227 (define-public transmission-remote-cli
228 (package
229 (name "transmission-remote-cli")
230 (version "1.7.1")
231 (source (origin
232 (method git-fetch)
233 (uri (git-reference
234 (url "https://github.com/fagga/transmission-remote-cli")
235 (commit (string-append "v" version))))
236 (file-name (git-file-name name version))
237 (sha256
238 (base32
239 "09w9f8vrm61lapin8fmq4rgahr95y3c6wss10g0fgd0kl16f895v"))))
240 (build-system python-build-system)
241 (arguments
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.
247 (delete 'build)
248 (replace 'install
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)
257 (install-file
258 (string-append
259 "completion/bash/"
260 "transmission-remote-cli-bash-completion.sh")
261 completions)))))))
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")
267 (license l:gpl3+)
268 (properties `((superseded . ,tremc)))))
269
270 (define-public aria2
271 (package
272 (name "aria2")
273 (version "1.35.0")
274 (source (origin
275 (method url-fetch)
276 (uri (string-append "https://github.com/aria2/aria2/releases/"
277 "download/release-" version
278 "/aria2-" version ".tar.xz"))
279 (sha256
280 (base32
281 "1zbxc517d97lb96f15xcy4l7b66grxrp3h2ids2jiwkaip87yaqy"))))
282 (build-system gnu-build-system)
283 (arguments
284 `(#:configure-flags (list "--enable-libaria2"
285 (string-append "--with-bashcompletiondir="
286 %output "/etc/bash_completion.d/"))
287 #:phases
288 (modify-phases %standard-phases
289 (add-after 'unpack 'delete-socket-tests
290 (lambda _
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)))
297 #t)))))
298 (native-inputs
299 `(("cppunit" ,cppunit) ; for the tests
300 ("pkg-config" ,pkg-config)))
301 (inputs
302 `(("c-ares" ,c-ares)
303 ("gnutls" ,gnutls)
304 ("gmp" ,gmp)
305 ("libssh2" ,libssh2)
306 ("libxml2" ,libxml2)
307 ("nettle" ,nettle)
308 ("sqlite" ,sqlite)
309 ("zlib" ,zlib)))
310 (home-page "https://aria2.github.io/")
311 (synopsis "Utility for parallel downloading files")
312 (description
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.")
316 (license l:gpl2+)))
317
318 (define-public uget
319 (package
320 (name "uget")
321 (version "2.2.1")
322 (source
323 (origin
324 (method url-fetch)
325 (uri (string-append "mirror://sourceforge/urlget/"
326 "uget%20%28stable%29/" version "/uget-"
327 version ".tar.gz"))
328 (sha256
329 (base32 "0dlrjhnm1pg2vwmp7nl2xv1aia5hyirb3021rl46x859k63zap24"))))
330 (build-system gnu-build-system)
331 (inputs
332 `(("curl" ,curl)
333 ("gtk+" ,gtk+)
334 ("glib" ,glib)
335 ("gnutls" ,gnutls)
336 ("gstreamer" ,gstreamer)
337 ("libgcrypt" ,libgcrypt)
338 ("libnotify" ,libnotify)
339 ("openssl" ,openssl)))
340 (native-inputs
341 `(("intltool" ,intltool)
342 ("pkg-config" ,pkg-config)))
343 (home-page "https://ugetdm.com/")
344 (synopsis "Universal download manager with GTK+ interface")
345 (description
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+)))
350
351 (define-public mktorrent
352 (package
353 (name "mktorrent")
354 (version "1.1")
355 (source (origin
356 (method git-fetch)
357 (uri (git-reference
358 (url "https://github.com/Rudde/mktorrent")
359 (commit (string-append "v" version))))
360 (file-name (git-file-name name version))
361 (sha256
362 (base32
363 "17pdc5mandl739f8q26n5is8ga56s83aqcrwhlnnplbxwx2inidr"))))
364 (build-system gnu-build-system)
365 (arguments
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"))
370 "NO_HASH_CHECK=1"
371 "USE_LARGE_FILES=1"
372 "USE_LONG_OPTIONS=1"
373 "USE_PTHREADS=1")
374 #:tests? #f)) ; no tests
375 (home-page "https://github.com/Rudde/mktorrent")
376 (synopsis "Utility to create BitTorrent metainfo files")
377 (description
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
386
387 (define-public libtorrent-rasterbar
388 (package
389 (name "libtorrent-rasterbar")
390 (version "1.2.8")
391 (source
392 (origin
393 (method url-fetch)
394 (uri
395 (string-append "https://github.com/arvidn/libtorrent/"
396 "releases/download/libtorrent-" version "/"
397 "libtorrent-rasterbar-" version ".tar.gz"))
398 (sha256
399 (base32 "1phn4klzvfzvidv5g566pnrrxj8l0givpy6s4r17d45wznqxc006"))))
400 (build-system gnu-build-system)
401 (arguments
402 `(#:configure-flags
403 (list (string-append "--with-boost-libdir="
404 (assoc-ref %build-inputs "boost")
405 "/lib")
406 "--enable-python-binding"
407 "--enable-tests")
408 #:make-flags (list
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")
417 (description
418 "libtorrent-rasterbar is a feature-complete C++ BitTorrent implementation
419 focusing on efficiency and scalability. It runs on embedded devices as well as
420 desktops.")
421 (license l:bsd-2)))
422
423 (define-public qbittorrent
424 (package
425 (name "qbittorrent")
426 (version "4.2.5")
427 (source
428 (origin
429 (method git-fetch)
430 (uri (git-reference
431 (url "https://github.com/qbittorrent/qBittorrent")
432 (commit (string-append "release-" version))))
433 (file-name (git-file-name name version))
434 (sha256
435 (base32 "1n613ylg6i9gisgk0dbr2kpfasyizrkdjff1r8smd4vri2qrdksn"))))
436 (build-system gnu-build-system)
437 (arguments
438 `(#:configure-flags
439 (list (string-append "--with-boost-libdir="
440 (assoc-ref %build-inputs "boost")
441 "/lib")
442 "--enable-debug"
443 "QMAKE_LRELEASE=lrelease")
444 #:modules ((guix build gnu-build-system)
445 (guix build qt-utils)
446 (guix build utils))
447 #:imported-modules (,@%gnu-build-system-modules
448 (guix build qt-utils))
449 #:phases
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))
455 #t)))))
456 (native-inputs
457 `(("pkg-config" ,pkg-config)
458 ("qttools" ,qttools)))
459 (inputs
460 `(("boost" ,boost)
461 ("libtorrent-rasterbar" ,libtorrent-rasterbar)
462 ("openssl" ,openssl)
463 ("python" ,python-wrapper)
464 ("qtbase" ,qtbase-5)
465 ("qtsvg" ,qtsvg)
466 ("zlib" ,zlib)))
467 (home-page "https://www.qbittorrent.org/")
468 (synopsis "Graphical BitTorrent client")
469 (description
470 "qBittorrent is a BitTorrent client programmed in C++/Qt that uses
471 libtorrent (sometimes called libtorrent-rasterbar) by Arvid Norberg.
472
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
475 features.")
476 (license l:gpl2+)))
477
478 (define-public deluge
479 (package
480 (name "deluge")
481 (version "2.0.3")
482 (source
483 (origin
484 (method url-fetch)
485 (uri (string-append
486 "https://ftp.osuosl.org/pub/deluge/source/"
487 (version-major+minor version) "/deluge-" version ".tar.xz"))
488 (sha256
489 (base32
490 "14d8kn2pvr1qv8mwqrxmj85jycr73vwfqz12hzag0ararbkfhyky"))))
491 (build-system python-build-system)
492 (propagated-inputs
493 `(("gtk+" ,gtk+)
494 ("librsvg" ,librsvg)
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)))
510 (native-inputs
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.
517 (arguments
518 `(#:tests? #f
519 #:phases
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
524 (lambda _
525 (substitute* "deluge/i18n/util.py"
526 (("names='ngettext'") "names=['ngettext']"))
527 #t))
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")))
532 (for-each
533 (lambda (program)
534 (wrap-program program
535 `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))))
536 (map (lambda (name)
537 (string-append out "/bin/" name))
538 '("deluge" "deluge-gtk"))))
539 #t)))))
540 (home-page "https://www.deluge-torrent.org/")
541 (synopsis "Fully-featured cross-platform ​BitTorrent client")
542 (description
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
548 ​client-server.")
549 (license l:gpl3+)))