bittorrent.scm 24 KB

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