gnu: python-deepmerge: Use pyproject-build-system.
[jackhill/guix/guix.git] / gnu / packages / bittorrent.scm
CommitLineData
3963a729 1;;; GNU Guix --- Functional package management for GNU
df66fee7 2;;; Copyright © 2014 Taylan Ulrich Bayirli/Kammer <taylanbayirli@gmail.com>
07366434 3;;; Copyright © 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
9c77cbba 4;;; Copyright © 2016, 2017, 2018, 2019, 2020 Leo Famulari <leo@famulari.name>
12bccb8e 5;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2022 Efraim Flashner <efraim@flashner.co.il>
4b67098d 6;;; Copyright © 2016 Tomáš Čech <sleep_walker@gnu.org>
dbd0b46d 7;;; Copyright © 2016, 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
4e58e9d0 8;;; Copyright © 2017 Jelle Licht <jlicht@fsfe.org>
f8fbe376 9;;; Copyright © 2018 Fis Trivial <ybbs.daans@hotmail.com>
39da44c2 10;;; Copyright © 2018 Nam Nguyen <namn@berkeley.edu>
a24b83d7 11;;; Copyright © 2018, 2021 Ricardo Wurmus <rekado@elephly.net>
c15a2cd9 12;;; Copyright © 2019, 2020 Brett Gilio <brettg@gnu.org>
7e24e1e5 13;;; Copyright © 2020 Hartmut Goebel <h.goebel@crazy-compilers.com>
9cb35c02 14;;; Copyright © 2021 Justin Veilleux <terramorpha@cock.li>
b432cd11 15;;; Copyright © 2021 Marius Bakke <marius@gnu.org>
711f0e68 16;;; Copyright © 2021 Josselin Poiret <josselin.poiret@protonmail.ch>
1b13c71a 17;;; Copyright © 2022 Brice Waegeneire <brice@waegenei.re>
8a05fb01 18;;; Copyright © 2022 Jacob Hart <hartja1@yahoo.com>
598b683e 19;;; Copyright © 2022 Simon Streit <simon@netpanic.org>
3963a729
LC
20;;;
21;;; This file is part of GNU Guix.
22;;;
23;;; GNU Guix is free software; you can redistribute it and/or modify it
24;;; under the terms of the GNU General Public License as published by
25;;; the Free Software Foundation; either version 3 of the License, or (at
26;;; your option) any later version.
27;;;
28;;; GNU Guix is distributed in the hope that it will be useful, but
29;;; WITHOUT ANY WARRANTY; without even the implied warranty of
30;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31;;; GNU General Public License for more details.
32;;;
33;;; You should have received a copy of the GNU General Public License
34;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
35
36(define-module (gnu packages bittorrent)
37 #:use-module (guix packages)
38 #:use-module (guix download)
e906f4e1 39 #:use-module (guix git-download)
b432cd11 40 #:use-module (guix build-system cmake)
3963a729 41 #:use-module (guix build-system gnu)
feb767b2 42 #:use-module (guix build-system python)
4cdec09a 43 #:use-module (guix build-system glib-or-gtk)
b5b73a82 44 #:use-module ((guix licenses) #:prefix l:)
dc64e7a1 45 #:use-module (guix gexp)
01d5eec9 46 #:use-module (guix utils)
3c569804 47 #:use-module (gnu packages)
f66842dc 48 #:use-module (gnu packages adns)
9cb35c02 49 #:use-module (gnu packages autotools)
bb5f8a3b 50 #:use-module (gnu packages bash)
4e58e9d0 51 #:use-module (gnu packages boost)
f66842dc 52 #:use-module (gnu packages check)
b432cd11 53 #:use-module (gnu packages cmake)
f66842dc 54 #:use-module (gnu packages compression)
4b67098d 55 #:use-module (gnu packages crypto)
3963a729 56 #:use-module (gnu packages curl)
f66842dc 57 #:use-module (gnu packages cyrus-sasl)
c2be790f 58 #:use-module (gnu packages freedesktop)
9cb35c02 59 #:use-module (gnu packages gettext)
3963a729 60 #:use-module (gnu packages glib)
4b67098d
61 #:use-module (gnu packages gnome)
62 #:use-module (gnu packages gnupg)
63 #:use-module (gnu packages gstreamer)
df66fee7 64 #:use-module (gnu packages gtk)
f66842dc 65 #:use-module (gnu packages libevent)
f66842dc
EF
66 #:use-module (gnu packages multiprecision)
67 #:use-module (gnu packages nettle)
2d8dc79c 68 #:use-module (gnu packages ncurses)
f66842dc 69 #:use-module (gnu packages pkg-config)
feb767b2 70 #:use-module (gnu packages python)
dbcd2050 71 #:use-module (gnu packages python-build)
c2be790f 72 #:use-module (gnu packages python-crypto)
01d5eec9 73 #:use-module (gnu packages python-web)
44d10b1f 74 #:use-module (gnu packages python-xyz)
f8fbe376 75 #:use-module (gnu packages qt)
cd0322a3 76 #:use-module (gnu packages sqlite)
f66842dc
EF
77 #:use-module (gnu packages ssh)
78 #:use-module (gnu packages tls)
79 #:use-module (gnu packages xml))
3963a729
LC
80
81(define-public transmission
82 (package
83 (name "transmission")
7233b19f 84 (version "3.00")
3963a729
LC
85 (source (origin
86 (method url-fetch)
7233b19f
LF
87 (uri (string-append "https://github.com/transmission/transmission"
88 "/releases/download/" version "/transmission-"
89 version ".tar.xz"))
3963a729
LC
90 (sha256
91 (base32
1d634451
SS
92 "1wjmn96zrvmk8j1yz2ysmqd7a2x6ilvnwwapcvfzgxs2wwpnai4i"))
93 (patches (search-patches "transmission-honor-localedir.patch"))))
4cdec09a 94 (build-system glib-or-gtk-build-system)
3963a729
LC
95 (outputs '("out" ; library and command-line interface
96 "gui")) ; graphical user interface
97 (arguments
1d634451
SS
98 '(#:configure-flags
99 (list (string-append "--localedir="
100 (assoc-ref %outputs "gui")
101 "/share/locale"))
c16341bb
MO
102 ;; Some tests segfault when using libevent 2.12 without internet
103 ;; connection. This has been reported mainstream but not fixed yet:
104 ;; https://github.com/transmission/transmission/issues/1437.
105 #:tests? #f
1d634451 106 #:glib-or-gtk-wrap-excluded-outputs '("out")
dc1d3cde
KK
107 #:phases
108 (modify-phases %standard-phases
7f85e7ce
VC
109 ;; Avoid embedding kernel version for reproducible build
110 (add-after 'unpack 'remove-kernel-version
111 (lambda _
112 (substitute* "third-party/miniupnpc/updateminiupnpcstrings.sh"
113 (("OS_VERSION=`uname -r`") "OS_VERSION=Guix"))))
dc1d3cde
KK
114 (add-after 'install 'move-gui
115 (lambda* (#:key outputs #:allow-other-keys)
116 ;; Move the GUI to its own output, so that "out" doesn't
117 ;; depend on GTK+.
118 (let ((out (assoc-ref outputs "out"))
119 (gui (assoc-ref outputs "gui")))
120 (mkdir-p (string-append gui "/bin"))
121 (rename-file (string-append out "/bin/transmission-gtk")
7233b19f 122 (string-append gui "/bin/transmission-gtk"))
07366434 123
bf155ce3
PN
124 (for-each
125 (lambda (dir)
126 (rename-file (string-append out "/share/" dir)
127 (string-append gui "/share/" dir)))
1d634451 128 '("appdata" "applications" "icons" "pixmaps"))
0305bc91
SS
129
130 (mkdir-p (string-append gui "/share/man/man1"))
131 (rename-file
132 (string-append out "/share/man/man1/transmission-gtk.1")
133 (string-append gui "/share/man/man1/transmission-gtk.1"))
134 #t))))))
3963a729 135 (inputs
598b683e 136 (list libevent curl openssl zlib gtk+ libappindicator))
3963a729 137 (native-inputs
8394619b 138 (list intltool pkg-config))
c4cfa9c6 139 (home-page "https://transmissionbt.com/")
3963a729
LC
140 (synopsis "Fast and easy BitTorrent client")
141 (description
142 "Transmission is a BitTorrent client that comes with graphical,
143textual, and Web user interfaces. Transmission also has a daemon for
e881752c 144unattended operations. It supports local peer discovery, full encryption,
3963a729
LC
145DHT, µTP, PEX and Magnet Links.")
146
147 ;; COPYING reads:
148 ;;
149 ;; Transmission can be redistributed and/or modified under the terms of
150 ;; the GNU GPLv2 (http://www.gnu.org/licenses/license-list.html#GPLv2),
151 ;; the GNU GPLv3 (http://www.gnu.org/licenses/license-list.html#GNUGPLv3),
152 ;; or any future license endorsed by Mnemosyne LLC.
153 ;;
154 ;; A few files files carry an MIT/X11 license header.
559491ea 155 (license (list l:gpl2 l:gpl3))))
df66fee7 156
9cb35c02
JV
157(define-public transmission-remote-gtk
158 (package
159 (name "transmission-remote-gtk")
eceecd8a 160 (version "1.4.2")
9cb35c02
JV
161 (source
162 (origin
163 (method url-fetch)
164 (uri (string-append "https://github.com/transmission-remote-gtk/"
165 "transmission-remote-gtk/releases/download/"
166 version "/transmission-remote-gtk-" version
eceecd8a 167 ".tar.gz"))
9cb35c02 168 (sha256
eceecd8a 169 (base32 "0qz9wi70qc6vgnaymivc3xz6y86c9hglk6wjv3snnqxpxmp9saay"))))
9cb35c02
JV
170 (build-system gnu-build-system)
171 (native-inputs
8394619b 172 (list gnu-gettext pkg-config))
9cb35c02 173 (inputs
8394619b 174 (list appstream-glib curl gtk+ json-glib))
9cb35c02
JV
175 (synopsis "Gtk frontend to the Transmission daemon")
176 (description "transmission-remote-gtk is a GTK client for remote management
177of the Transmission BitTorrent client, using its HTTP RPC protocol.")
178 (home-page "https://github.com/transmission-remote-gtk/transmission-remote-gtk")
179 (license l:gpl2+)))
180
df66fee7
LC
181(define-public libtorrent
182 (package
183 (name "libtorrent")
9e171634 184 (version "0.13.8")
df66fee7
LC
185 (source (origin
186 (method url-fetch)
187 (uri (string-append
29b4c57b 188 "http://rtorrent.net/downloads/libtorrent-"
df66fee7
LC
189 version ".tar.gz"))
190 (sha256
191 (base32
9e171634 192 "10z9i1rc41cmmi7nx8k7k1agsx6afv09g9cl7g9zr35fyhl5l4gd"))))
df66fee7 193 (build-system gnu-build-system)
8394619b
LC
194 (inputs (list openssl zlib))
195 (native-inputs (list pkg-config cppunit))
df66fee7
LC
196 (synopsis "BitTorrent library of rtorrent")
197 (description
198 "LibTorrent is a BitTorrent library used by and developed in parallel
199with the BitTorrent client rtorrent. It is written in C++ with emphasis on
200speed and efficiency.")
9db04bf5 201 (home-page "https://github.com/rakshasa/libtorrent")
df66fee7 202 (license l:gpl2+)))
2d8dc79c
TUBK
203
204(define-public rtorrent
205 (package
206 (name "rtorrent")
0cbec2aa 207 (version "0.9.8")
2d8dc79c
TUBK
208 (source (origin
209 (method url-fetch)
210 (uri (string-append
9fbd458b 211 "http://rtorrent.net/downloads/rtorrent-"
2d8dc79c
TUBK
212 version ".tar.gz"))
213 (sha256
214 (base32
0cbec2aa 215 "1bs2fnf4q7mlhkhzp3i1v052v9xn8qa7g845pk9ia8hlpw207pwy"))))
2d8dc79c 216 (build-system gnu-build-system)
8394619b
LC
217 (inputs (list libtorrent
218 ncurses
219 curl
220 cyrus-sasl
221 openssl
222 zlib))
223 (native-inputs (list pkg-config cppunit))
2d8dc79c
TUBK
224 (synopsis "BitTorrent client with ncurses interface")
225 (description
226 "rTorrent is a BitTorrent client with an ncurses interface. It supports
227full encryption, DHT, PEX, and Magnet Links. It can also be controlled via
228XML-RPC over SCGI.")
9db04bf5 229 (home-page "https://github.com/rakshasa/rtorrent")
2d8dc79c 230 (license l:gpl2+)))
e906f4e1
LF
231
232(define-public tremc
9c77cbba
LF
233 (package
234 (name "tremc")
d05fcc21 235 (version "0.9.3")
9c77cbba
LF
236 (source
237 (origin
238 (method git-fetch)
239 (uri (git-reference
240 (url "https://github.com/tremc/tremc")
241 (commit version)))
242 (file-name (git-file-name name version))
243 (sha256
244 (base32
d05fcc21 245 "11izsgwj435skkgvw96an6ddcm1hk3ff1gji4ksnidlyv6g6npyv"))))
9c77cbba
LF
246 (build-system gnu-build-system)
247 (arguments
248 `(#:tests? #f ; no test suite
249 #:make-flags
250 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
251 #:phases
252 (modify-phases %standard-phases
253 ;; The software is just a Python script that must be copied into place.
254 (delete 'configure)
255 (delete 'build))))
256 (inputs
8394619b 257 (list python))
9c77cbba
LF
258 (synopsis "Console client for the Transmission BitTorrent daemon")
259 (description "Tremc is a console client, with a curses interface, for the
e906f4e1 260Transmission BitTorrent daemon.")
9c77cbba
LF
261 (home-page "https://github.com/tremc/tremc")
262 (license l:gpl3+)))
feb767b2 263
f66842dc
EF
264(define-public aria2
265 (package
266 (name "aria2")
161091f0 267 (version "1.36.0")
f66842dc
EF
268 (source (origin
269 (method url-fetch)
7b6a8e23
EF
270 (uri (string-append "https://github.com/aria2/aria2/releases/"
271 "download/release-" version
272 "/aria2-" version ".tar.xz"))
f66842dc
EF
273 (sha256
274 (base32
161091f0 275 "1987x4ywnnrhhfs9hi2h820c200d7nas9nd35414yh0jiihfglaq"))))
f66842dc
EF
276 (build-system gnu-build-system)
277 (arguments
dc64e7a1
EF
278 (list
279 #:configure-flags
280 #~(list "--enable-libaria2"
281 (string-append "--with-bashcompletiondir="
282 #$output "/etc/bash_completion.d/"))
f66842dc 283 #:phases
dc64e7a1
EF
284 #~(modify-phases %standard-phases
285 (add-after 'unpack 'delete-socket-tests
286 (lambda _
287 (substitute* "test/LpdMessageDispatcherTest.cc"
288 (("CPPUNIT_TEST_SUITE_REGISTRATION\\(LpdMessageDispatcherTest\\);" text)
289 (string-append "// " text)))
290 (substitute* "test/LpdMessageReceiverTest.cc"
291 (("CPPUNIT_TEST_SUITE_REGISTRATION\\(LpdMessageReceiverTest\\);" text)
292 (string-append "// " text))))))))
f66842dc 293 (native-inputs
8394619b
LC
294 (list cppunit ; for the tests
295 pkg-config))
f66842dc 296 (inputs
8394619b
LC
297 (list c-ares
298 gnutls
299 gmp
300 libssh2
301 libxml2
302 nettle
303 sqlite
304 zlib))
5bed95ef 305 (home-page "https://aria2.github.io/")
f66842dc
EF
306 (synopsis "Utility for parallel downloading files")
307 (description
308 "Aria2 is a lightweight, multi-protocol & multi-source command-line
309download utility. It supports HTTP/HTTPS, FTP, SFTP, BitTorrent and Metalink.
310Aria2 can be manipulated via built-in JSON-RPC and XML-RPC interfaces.")
12bccb8e
EF
311 (properties
312 '((release-monitoring-url . "https://github.com/aria2/aria2/releases")))
f66842dc 313 (license l:gpl2+)))
4b67098d 314
4b67098d
315(define-public uget
316 (package
317 (name "uget")
5a3d6ad1 318 (version "2.2.1")
b2d35dd9
NG
319 (source
320 (origin
321 (method url-fetch)
322 (uri (string-append "mirror://sourceforge/urlget/"
323 "uget%20%28stable%29/" version "/uget-"
324 version ".tar.gz"))
325 (sha256
5a3d6ad1 326 (base32 "0dlrjhnm1pg2vwmp7nl2xv1aia5hyirb3021rl46x859k63zap24"))))
4b67098d 327 (build-system gnu-build-system)
a24b83d7
RW
328 (arguments
329 `(#:configure-flags '("CFLAGS=-fcommon")))
4b67098d 330 (inputs
8394619b
LC
331 (list curl
332 gtk+
333 glib
334 gnutls
335 gstreamer
336 libgcrypt
337 libnotify
338 openssl))
4b67098d 339 (native-inputs
8394619b 340 (list intltool pkg-config))
950f1697 341 (home-page "https://ugetdm.com/")
4b67098d
342 (synopsis "Universal download manager with GTK+ interface")
343 (description
344 "uGet is portable download manager with GTK+ interface supporting
345HTTP, HTTPS, BitTorrent and Metalink, supporting multi-connection
346downloads, download scheduling, download rate limiting.")
347 (license l:lgpl2.1+)))
8975d00c
TGR
348
349(define-public mktorrent
350 (package
351 (name "mktorrent")
fd90e396 352 (version "1.1")
8975d00c 353 (source (origin
4342a046
RW
354 (method git-fetch)
355 (uri (git-reference
b0e7b699 356 (url "https://github.com/Rudde/mktorrent")
4342a046
RW
357 (commit (string-append "v" version))))
358 (file-name (git-file-name name version))
8975d00c
TGR
359 (sha256
360 (base32
4342a046 361 "17pdc5mandl739f8q26n5is8ga56s83aqcrwhlnnplbxwx2inidr"))))
8975d00c
TGR
362 (build-system gnu-build-system)
363 (arguments
364 `(#:phases (modify-phases %standard-phases
365 (delete 'configure)) ; no configure script
a6b64691 366 #:make-flags (list (string-append "CC=" ,(cc-for-target))
8975d00c
TGR
367 (string-append "PREFIX=" (assoc-ref %outputs "out"))
368 "NO_HASH_CHECK=1"
369 "USE_LARGE_FILES=1"
370 "USE_LONG_OPTIONS=1"
371 "USE_PTHREADS=1")
372 #:tests? #f)) ; no tests
fd90e396 373 (home-page "https://github.com/Rudde/mktorrent")
8975d00c 374 (synopsis "Utility to create BitTorrent metainfo files")
897bd0b5
TGR
375 (description
376 "mktorrent is a simple command-line utility to create BitTorrent
377@dfn{metainfo} files, often known simply as @dfn{torrents}, from both single
378files and whole directories. It can add multiple trackers and web seed URLs,
379and set the @code{private} flag to disallow advertisement through the
380distributed hash table (@dfn{DHT}) and Peer Exchange. Hashing is multi-threaded
8975d00c
TGR
381and will take advantage of multiple processor cores where possible.")
382 (license (list l:public-domain ; sha1.*, used to build without OpenSSL
383 l:gpl2+)))) ; with permission to link with OpenSSL
4e58e9d0
JL
384
385(define-public libtorrent-rasterbar
386 (package
387 (name "libtorrent-rasterbar")
d6255062 388 (version "1.2.15")
2d25c635
TGR
389 (source
390 (origin
391 (method url-fetch)
392 (uri
393 (string-append "https://github.com/arvidn/libtorrent/"
b432cd11 394 "releases/download/v" version "/"
2d25c635
TGR
395 "libtorrent-rasterbar-" version ".tar.gz"))
396 (sha256
d6255062 397 (base32 "0jr1c876mvwbbbnav8ldcdm1l6z3g404jc5wp8z902jcd0w8dbf8"))))
b432cd11 398 (build-system cmake-build-system)
4e58e9d0 399 (arguments
a59abcb3 400 `(#:configure-flags '("-Dpython-bindings=ON"
b432cd11
MB
401 "-Dbuild_tests=ON")
402 #:phases
403 (modify-phases %standard-phases
d6255062
EF
404 (add-after 'unpack 'extend-test-timeout
405 (lambda _
406 (substitute* "test/test_remove_torrent.cpp"
407 ;; Extend the test timeout from 3 seconds to 10.
408 (("i > 30") "i > 100"))))
b432cd11
MB
409 (replace 'check
410 (lambda* (#:key tests? parallel-tests? #:allow-other-keys)
411 (let ((disabled-tests
412 ;; test_upnp requires a non-localhost IPv4 interface.
413 '("test_upnp")))
414 (when tests?
415 ;; test_ssl relies on bundled TLS certificates with a fixed
416 ;; expiry date. To ensure succesful builds in the future,
417 ;; fake the time to be roughly that of the release.
418 (setenv "FAKETIME_ONLY_CMDS" "test_ssl")
d6255062 419 (invoke "faketime" "2021-12-12"
b432cd11
MB
420 "ctest"
421 "--exclude-regex" (string-join disabled-tests "|")
422 "-j" (if parallel-tests?
423 (number->string (parallel-job-count))
d6255062
EF
424 "1")
425 "--rerun-failed"
426 "--output-on-failure"))))))))
8394619b 427 (inputs (list boost openssl))
4821e3eb
EF
428 (native-inputs
429 (list libfaketime
430 python-wrapper
431 pkg-config))
9270b2fb 432 (home-page "https://www.libtorrent.org/")
a7e3aec0 433 (synopsis "Feature-complete BitTorrent implementation")
4e58e9d0 434 (description
a7e3aec0 435 "libtorrent-rasterbar is a feature-complete C++ BitTorrent implementation
4e58e9d0
JL
436focusing on efficiency and scalability. It runs on embedded devices as well as
437desktops.")
438 (license l:bsd-2)))
439
f8fbe376
FT
440(define-public qbittorrent
441 (package
442 (name "qbittorrent")
8a05fb01 443 (version "4.4.1")
0748a7b2
TGR
444 (source
445 (origin
446 (method git-fetch)
447 (uri (git-reference
b0e7b699 448 (url "https://github.com/qbittorrent/qBittorrent")
0748a7b2
TGR
449 (commit (string-append "release-" version))))
450 (file-name (git-file-name name version))
451 (sha256
8a05fb01 452 (base32 "00whc4p209g2krsggxyq4sna01djbk1rbzkyjbq4qczvya01xn0w"))))
f8fbe376
FT
453 (build-system gnu-build-system)
454 (arguments
455 `(#:configure-flags
456 (list (string-append "--with-boost-libdir="
457 (assoc-ref %build-inputs "boost")
458 "/lib")
459 "--enable-debug"
aaa88937
GLV
460 "QMAKE_LRELEASE=lrelease")
461 #:modules ((guix build gnu-build-system)
462 (guix build qt-utils)
463 (guix build utils))
464 #:imported-modules (,@%gnu-build-system-modules
465 (guix build qt-utils))
466 #:phases
467 (modify-phases %standard-phases
468 (add-after 'install 'wrap-qt
7e24e1e5
HG
469 (lambda* (#:key outputs inputs #:allow-other-keys)
470 (let ((out (assoc-ref outputs "out")))
471 (wrap-qt-program "qbittorrent" #:output out #:inputs inputs))
aaa88937 472 #t)))))
f8fbe376 473 (native-inputs
eef8e2ec 474 (list pkg-config qttools-5))
f8fbe376
FT
475 (inputs
476 `(("boost" ,boost)
477 ("libtorrent-rasterbar" ,libtorrent-rasterbar)
478 ("openssl" ,openssl)
ea236462 479 ("python" ,python-wrapper)
ea0a5107 480 ("qtbase" ,qtbase-5)
1ef04fb2 481 ("qtsvg-5" ,qtsvg-5)
f8fbe376
FT
482 ("zlib" ,zlib)))
483 (home-page "https://www.qbittorrent.org/")
484 (synopsis "Graphical BitTorrent client")
485 (description
486 "qBittorrent is a BitTorrent client programmed in C++/Qt that uses
487libtorrent (sometimes called libtorrent-rasterbar) by Arvid Norberg.
4e58e9d0 488
f8fbe376
FT
489It aims to be a good alternative to all other BitTorrent clients out there.
490qBittorrent is fast, stable and provides unicode support as well as many
491features.")
492 (license l:gpl2+)))
c2be790f
NN
493
494(define-public deluge
495 (package
496 (name "deluge")
1b13c71a 497 (version "2.0.5")
c2be790f
NN
498 (source
499 (origin
500 (method url-fetch)
501 (uri (string-append
01d5eec9
KK
502 "https://ftp.osuosl.org/pub/deluge/source/"
503 (version-major+minor version) "/deluge-" version ".tar.xz"))
c2be790f
NN
504 (sha256
505 (base32
1b13c71a 506 "1n15dzfnz1gvb4cf046yhi404i3gs933qgz0ichna6r1znmh9gf4"))))
c2be790f 507 (build-system python-build-system)
bb5f8a3b 508 (inputs (list bash-minimal))
01d5eec9 509 (propagated-inputs
bb5f8a3b
BW
510 (list gtk+
511 libtorrent-rasterbar
512 python-pycairo
513 python-chardet
514 python-dbus
515 python-mako
516 python-pygobject
517 python-pillow
518 python-pyopenssl
519 python-pyxdg
520 python-rencode
521 python-service-identity
522 python-setproctitle
523 python-six
524 python-twisted
525 python-zope-interface))
c2be790f 526 (native-inputs
711f0e68
JP
527 (list intltool python-wheel
528 (if (string-prefix? "x86_64-" (%current-system))
529 librsvg-bootstrap
530 librsvg-2.40)))
01d5eec9
KK
531 ;; TODO: Enable tests.
532 ;; After "pytest-twisted" is packaged, HOME is set, and an X server is
533 ;; started, some of the tests still fail. There are likely some tests
534 ;; that require a network connection.
c2be790f 535 (arguments
01d5eec9
KK
536 `(#:tests? #f
537 #:phases
538 (modify-phases %standard-phases
01d5eec9 539 (add-after 'install 'wrap
1471219a 540 (lambda* (#:key native-inputs inputs outputs #:allow-other-keys)
01d5eec9 541 (let ((out (assoc-ref outputs "out"))
31577d87
BW
542 ;; "librsvg" input is only needed at build time and it
543 ;; conflit with the "librsvg" propageted by "gtk+", so we
544 ;; make sure there is no reference to it in the wrapper.
1471219a
JP
545 (gi-typelib-path
546 (string-join (filter
547 (lambda (x) (not (string-prefix?
548 (assoc-ref
549 (or native-inputs inputs)
550 "librsvg")
551 x)))
552 (string-split
553 (getenv "GI_TYPELIB_PATH")
554 #\:))
555 ":")))
01d5eec9
KK
556 (for-each
557 (lambda (program)
558 (wrap-program program
559 `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))))
560 (map (lambda (name)
561 (string-append out "/bin/" name))
562 '("deluge" "deluge-gtk"))))
563 #t)))))
c2be790f
NN
564 (home-page "https://www.deluge-torrent.org/")
565 (synopsis "Fully-featured cross-platform ​BitTorrent client")
566 (description
567 "Deluge contains the common features to BitTorrent clients such as
568Protocol Encryption, DHT, Local Peer Discovery (LSD), Peer Exchange
569(PEX), UPnP, NAT-PMP, Proxy support, Web seeds, global and per-torrent
570speed limits. Deluge heavily utilises the ​libtorrent library. It is
571designed to run as both a normal standalone desktop application and as a
572​client-server.")
573 (license l:gpl3+)))