gnunet.scm 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2013, 2014, 2015 Andreas Enge <andreas@enge.fr>
  3. ;;; Copyright © 2014 Sree Harsha Totakura <sreeharsha@totakura.in>
  4. ;;; Copyright © 2015, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
  5. ;;; Copyright © 2015, 2017, 2019, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
  6. ;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
  7. ;;; Copyright © 2016 Mark H Weaver <mhw@netris.org>
  8. ;;; Copyright © 2016, 2017, 2018, 2019, 2020 Nikita <nikita@n0.is>
  9. ;;; Copyright © 2016, 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
  10. ;;; Copyright © 2018 Alex Vong <alexvong1995@gmail.com>
  11. ;;; Copyright © 2019 Brett Gilio <brettg@gnu.org>
  12. ;;; Copyright © 2020 Tanguy Le Carrour <tanguy@bioneland.org>
  13. ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
  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. (define-module (gnu packages gnunet)
  30. #:use-module (gnu packages)
  31. #:use-module (gnu packages file)
  32. #:use-module (gnu packages aidc)
  33. #:use-module (gnu packages autotools)
  34. #:use-module (gnu packages compression)
  35. #:use-module (gnu packages crypto)
  36. #:use-module (gnu packages curl)
  37. #:use-module (gnu packages gettext)
  38. #:use-module (gnu packages glib)
  39. #:use-module (gnu packages gnome)
  40. #:use-module (gnu packages gnupg)
  41. #:use-module (gnu packages groff)
  42. #:use-module (gnu packages gtk)
  43. #:use-module (gnu packages guile)
  44. #:use-module (gnu packages gstreamer)
  45. #:use-module (gnu packages libidn)
  46. #:use-module (gnu packages linux)
  47. #:use-module (gnu packages image)
  48. #:use-module (gnu packages libunistring)
  49. #:use-module (gnu packages maths)
  50. #:use-module (gnu packages multiprecision)
  51. #:use-module (gnu packages music)
  52. #:use-module (gnu packages ncurses)
  53. #:use-module (gnu packages nss)
  54. #:use-module (gnu packages package-management)
  55. #:use-module (gnu packages pkg-config)
  56. #:use-module (gnu packages perl)
  57. #:use-module (gnu packages pulseaudio)
  58. #:use-module (gnu packages python)
  59. #:use-module (gnu packages sqlite)
  60. #:use-module (gnu packages tls)
  61. #:use-module (gnu packages upnp)
  62. #:use-module (gnu packages video)
  63. #:use-module (gnu packages vim)
  64. #:use-module (gnu packages web)
  65. #:use-module (gnu packages xiph)
  66. #:use-module (gnu packages backup)
  67. #:use-module ((guix licenses) #:prefix license:)
  68. #:use-module (guix packages)
  69. #:use-module (guix download)
  70. #:use-module (guix git-download)
  71. #:use-module (guix build-system gnu))
  72. (define-public libextractor
  73. (package
  74. (name "libextractor")
  75. (version "1.11")
  76. (source (origin
  77. (method url-fetch)
  78. (uri (string-append "mirror://gnu/libextractor/libextractor-"
  79. version ".tar.gz"))
  80. (sha256
  81. (base32
  82. "13xxv11mif3m0mpk7i43mljhhaqrj52kznm1qi3qb8s6hymk7xhn"))))
  83. (build-system gnu-build-system)
  84. ;; WARNING: Checks require /dev/shm to be in the build chroot, especially
  85. ;; not to be a symbolic link to /run/shm.
  86. ;; FIXME:
  87. ;; The following dependencies are all optional, but should be
  88. ;; available for maximum coverage:
  89. ;; * librpm (rpm) ; investigate failure
  90. ;; * libtidy-html (tidy-html) ; investigate failure
  91. (inputs
  92. `(("exiv2" ,exiv2)
  93. ("bzip2" ,bzip2)
  94. ("flac" ,flac)
  95. ("ffmpeg" ,ffmpeg)
  96. ("file" ,file) ;libmagic, for the MIME plug-in
  97. ("glib" ,glib)
  98. ("giflib" ,giflib)
  99. ("gstreamer" ,gstreamer)
  100. ("gst-plugins-base" ,gst-plugins-base)
  101. ("gtk+" ,gtk+)
  102. ("libarchive" ,libarchive)
  103. ("libgsf" ,libgsf)
  104. ("libjpeg" ,libjpeg-turbo)
  105. ("libltdl" ,libltdl)
  106. ("libmpeg2" ,libmpeg2)
  107. ("libmp4v2" ,libmp4v2)
  108. ("libsmf" ,libsmf)
  109. ("libogg" ,libogg)
  110. ("libtiff" ,libtiff)
  111. ("libvorbis" ,libvorbis)
  112. ("zlib" ,zlib)))
  113. (native-inputs
  114. `(("pkg-config" ,pkg-config)))
  115. (outputs '("out"
  116. "static")) ; 420 KiB .a files
  117. (arguments
  118. `(#:configure-flags
  119. (list (string-append "--with-ltdl="
  120. (assoc-ref %build-inputs "libltdl")))
  121. #:parallel-tests? #f
  122. #:phases
  123. (modify-phases %standard-phases
  124. (add-after 'configure 'fix-exiv2-tests
  125. ;; exiv2>=0.27.3 rounds geolocation
  126. ;; https://github.com/Exiv2/exiv2/pull/1107/commits/db1be4ae8e1077949fcb6a960e93069d6a41b395#diff-f3f55183ccbe956c720c86e61f708d9f
  127. (lambda _
  128. (substitute* "src/plugins/test_exiv2.c"
  129. (("17.585\\\\\" ") "18\\\"")
  130. (("21.713\\\\\" ") "22\\\""))
  131. #t))
  132. (add-after 'install 'move-static-libraries
  133. (lambda* (#:key outputs #:allow-other-keys)
  134. ;; Move static libraries to the "static" output.
  135. (let* ((out (assoc-ref outputs "out"))
  136. (lib (string-append out "/lib"))
  137. (static (assoc-ref outputs "static"))
  138. (slib (string-append static "/lib")))
  139. (mkdir-p slib)
  140. (for-each (lambda (file)
  141. (install-file file slib)
  142. (delete-file file))
  143. (find-files lib "\\.a$"))
  144. #t))))))
  145. (synopsis "Library to extract meta-data from media files")
  146. (description
  147. "GNU libextractor is a library for extracting metadata from files. It
  148. supports a very large number of file formats, including audio files, document
  149. files, and archive files. Each file format is implemented as a plugin, so
  150. new formats can be added easily. The package also contains a command-line
  151. tool to extract metadata from a file and print the results.")
  152. (license license:gpl3+)
  153. (home-page "https://www.gnu.org/software/libextractor/")))
  154. (define-public libmicrohttpd
  155. (package
  156. (name "libmicrohttpd")
  157. (version "0.9.73")
  158. (source (origin
  159. (method url-fetch)
  160. (uri (string-append "mirror://gnu/libmicrohttpd/libmicrohttpd-"
  161. version ".tar.gz"))
  162. (sha256
  163. (base32
  164. "0bh39irwzkv48fkw43skfgkk8ka3793bx1lm21sgw6zxi0djyyx3"))
  165. (patches (search-patches "libmicrohttpd-0.9.73-test-ssl3.patch"))))
  166. (build-system gnu-build-system)
  167. (inputs
  168. `(("curl" ,curl)
  169. ("gnutls" ,gnutls/dane)
  170. ("libgcrypt" ,libgcrypt)
  171. ("openssl" ,openssl)
  172. ("zlib" ,zlib)))
  173. (synopsis "C library implementing an HTTP 1.1 server")
  174. (description
  175. "GNU libmicrohttpd is a small, embeddable HTTP server implemented as a
  176. C library. It makes it easy to run an HTTP server as part of another
  177. application. The library is fully HTTP 1.1 compliant. It can listen on
  178. multiple ports, supports four different threading models, and supports
  179. IPv6. It also features security features such as basic and digest
  180. authentication and support for SSL3 and TLS.")
  181. (license license:lgpl2.1+)
  182. (home-page "https://www.gnu.org/software/libmicrohttpd/")))
  183. (define-public gnurl
  184. (package
  185. (name "gnurl")
  186. (version "7.70.0")
  187. (source (origin
  188. (method url-fetch)
  189. (uri (string-append "mirror://gnu/gnunet/gnurl-" version ".tar.gz"))
  190. (sha256
  191. (base32
  192. "0px9la8v4bj1dzxb95fx3yxk0rcjqjrxpj733ga27cza45wwzkqa"))))
  193. (build-system gnu-build-system)
  194. (outputs '("out"
  195. "doc")) ; 1.8 MiB of man3 pages
  196. (inputs `(("gnutls" ,gnutls/dane)
  197. ("libidn2" ,libidn2)
  198. ("zlib" ,zlib)))
  199. (native-inputs
  200. `(("libtool" ,libtool)
  201. ("perl" ,perl)
  202. ("pkg-config" ,pkg-config)
  203. ("python" ,python)))
  204. (arguments
  205. `(#:configure-flags
  206. ;; All of these produce errors during configure.
  207. (list "--disable-ftp"
  208. "--disable-file"
  209. "--disable-ldap"
  210. "--disable-rtsp"
  211. "--disable-dict"
  212. "--disable-telnet"
  213. "--disable-tftp"
  214. "--disable-pop3"
  215. "--disable-imap"
  216. "--disable-smb"
  217. "--disable-smtp"
  218. "--disable-gopher"
  219. "--without-ssl"
  220. "--without-libpsl"
  221. "--without-librtmp"
  222. "--disable-ntlm-wb")
  223. #:phases
  224. (modify-phases %standard-phases
  225. (add-after 'install 'move-man3-pages
  226. (lambda* (#:key outputs #:allow-other-keys)
  227. ;; Move section 3 man pages to "doc".
  228. (let ((out (assoc-ref outputs "out"))
  229. (doc (assoc-ref outputs "doc")))
  230. (mkdir-p (string-append doc "/share/man"))
  231. (rename-file (string-append out "/share/man/man3")
  232. (string-append doc "/share/man/man3"))
  233. #t)))
  234. ;; We have to patch runtests.pl in tests/ directory
  235. (replace 'check
  236. (lambda _
  237. (substitute* "tests/runtests.pl"
  238. (("/bin/sh") (which "sh")))
  239. ;; Make test output more verbose.
  240. (invoke "make" "-C" "tests" "test"))))))
  241. (synopsis "Microfork of cURL with support for the HTTP/HTTPS/GnuTLS subset of cURL")
  242. (description
  243. "Gnurl is a microfork of cURL, a command line tool for transferring data
  244. with URL syntax. While cURL supports many crypto backends, libgnurl only
  245. supports HTTP, HTTPS and GnuTLS.")
  246. (license (license:non-copyleft "file://COPYING"
  247. "See COPYING in the distribution."))
  248. (properties '((ftp-server . "ftp.gnu.org")
  249. (ftp-directory . "/gnunet")))
  250. (home-page "https://gnunet.org/en/gnurl.html")))
  251. (define-public gnunet
  252. (package
  253. (name "gnunet")
  254. (version "0.13.1")
  255. (source
  256. (origin
  257. (method url-fetch)
  258. (uri (string-append "mirror://gnu/gnunet/gnunet-" version
  259. ".tar.gz"))
  260. (sha256
  261. (base32
  262. "15jnca5zxng7r6m3qzq9lr73xxq0v6mvcp0lny3zrlkz5s2nmmq3"))))
  263. (build-system gnu-build-system)
  264. (inputs
  265. `(("bluez" ,bluez)
  266. ("glpk" ,glpk)
  267. ("gnurl" ,gnurl)
  268. ("gnutls" ,gnutls/dane)
  269. ("gstreamer" ,gstreamer)
  270. ("jansson" ,jansson)
  271. ("libextractor" ,libextractor)
  272. ("libidn" ,libidn2)
  273. ("libgcrypt" ,libgcrypt)
  274. ("libjpeg" ,libjpeg-turbo)
  275. ("libltdl" ,libltdl)
  276. ("libmicrohttpd" ,libmicrohttpd)
  277. ("libogg" ,libogg)
  278. ("libsodium" ,libsodium)
  279. ("libunistring" ,libunistring)
  280. ("miniupnpc" ,miniupnpc)
  281. ("opus" ,opus)
  282. ("pulseaudio" ,pulseaudio)
  283. ("sqlite" ,sqlite)
  284. ("zbar" ,zbar)
  285. ("zlib" ,zlib)))
  286. (native-inputs
  287. `(("curl" ,curl)
  288. ("pkg-config" ,pkg-config)
  289. ("python" ,python)
  290. ("xxd" ,xxd)
  291. ("which" ,(@ (gnu packages base) which))))
  292. (arguments
  293. '(#:parallel-tests? #f ; Parallel tests aren't supported.
  294. #:phases
  295. (modify-phases %standard-phases
  296. (add-after 'configure 'remove-failing-tests
  297. ;; These tests fail in Guix's building environment.
  298. (lambda _
  299. (substitute* "src/transport/Makefile"
  300. (("\\$\\(am__EXEEXT_15\\)") "") ; test_transport_api_https
  301. (("test_transport_api_manipulation_cfg\\$\\(EXEEXT\\) \\\\\n") "")
  302. (("test_transport_api_udp_nat\\$\\(EXEEXT\\) \\\\\n") "")
  303. (("test_transport_blacklisting_multiple_plugins\\$\\(EXEEXT\\) \\\\\n") ""))
  304. (substitute* "src/testbed/Makefile"
  305. (("test_testbed_api_2peers_1controller\\$\\(EXEEXT\\) \\\\\n") "")
  306. (("test_testbed_api_statistics\\$\\(EXEEXT\\) \\\\\n") "")
  307. (("test_testbed_api_test\\$\\(EXEEXT\\) \\\\\n") "")
  308. (("test_testbed_api_test_timeout\\$\\(EXEEXT\\) \\\\\n") "")
  309. (("test_testbed_api_topology\\$\\(EXEEXT\\) \\\\\n") "")
  310. (("test_testbed_api_topology_clique\\$\\(EXEEXT\\) \\\\\n") ""))
  311. (substitute* "src/topology/Makefile"
  312. (("^check_PROGRAMS.*") "\n")
  313. (("test_gnunet_daemon_topology\\$\\(EXEEXT\\)\n") ""))
  314. (substitute* "src/namestore/Makefile"
  315. (("\\$\\(am__append_2\\)") ""))
  316. (substitute* "src/gns/Makefile"
  317. (("\\$\\(am__append_4\\)") ""))
  318. (substitute* "contrib/Makefile"
  319. (("^check_PROGRAMS.*") "\n"))
  320. ;; 'test' from coreutils doesn't behave as the test expects.
  321. (substitute* '("src/gns/gnunet-gns-proxy-setup-ca.in"
  322. "src/transport/gnunet-transport-certificate-creation.in")
  323. (("gnutls-certtool") "certtool"))
  324. #t))
  325. (add-before 'check 'set-env-var-for-tests
  326. (lambda _
  327. (setenv "LANG" "en_US.UTF-8")))
  328. ;; Swap 'check and 'install phases and add installed binaries to $PATH.
  329. (add-before 'check 'set-path-for-check
  330. (lambda* (#:key outputs #:allow-other-keys)
  331. (let ((out (assoc-ref outputs "out")))
  332. (setenv "GNUNET_PREFIX" (string-append out "/lib"))
  333. (setenv "PATH" (string-append (getenv "PATH") ":" out "/bin")))
  334. #t))
  335. (delete 'check)
  336. (add-after 'install 'check
  337. (assoc-ref %standard-phases 'check)))))
  338. (synopsis "Secure, decentralized, peer-to-peer networking framework")
  339. (description
  340. "GNUnet is a framework for secure peer-to-peer networking. The
  341. high-level goal is to provide a strong foundation of free software for a
  342. global, distributed network that provides security and privacy. GNUnet in
  343. that sense aims to replace the current internet protocol stack. Along with
  344. an application for secure publication of files, it has grown to include all
  345. kinds of basic applications for the foundation of a GNU internet.")
  346. (license license:agpl3+)
  347. (home-page "https://gnunet.org/")))
  348. (define-public guile-gnunet ;GSoC 2015!
  349. (let ((commit "d12167ab3c8d7d6caffd9c606e389ef043760602")
  350. (revision "1"))
  351. (package
  352. (name "guile-gnunet")
  353. (version (git-version "0.0" revision commit))
  354. (source (origin
  355. (method git-fetch)
  356. (uri (git-reference
  357. (url "https://git.savannah.gnu.org/git/guix/gnunet.git/")
  358. (commit commit)))
  359. (file-name (git-file-name name version))
  360. (sha256
  361. (base32
  362. "0nqc18jh9j30y4l6yh6j35byfg6qalq7yr3frv9rk10qa041c2sv"))))
  363. (build-system gnu-build-system)
  364. (native-inputs `(("pkg-config" ,pkg-config)
  365. ("autoconf" ,autoconf)
  366. ("automake" ,automake)))
  367. (inputs `(("guile" ,guile-2.0)
  368. ("gnunet" ,gnunet)))
  369. (synopsis "Guile bindings for GNUnet services")
  370. (description
  371. "This package provides Guile bindings to the client libraries of various
  372. GNUnet services, including the @dfn{identity} and @dfn{file sharing}
  373. services.")
  374. (home-page "https://gnu.org/software/guix")
  375. (license license:gpl3+))))
  376. ;; FIXME: "gnunet-setup" segfaults under certain conditions and "gnunet-gtk"
  377. ;; does not seem to be fully functional. This has been reported upstream:
  378. ;; http://lists.gnu.org/archive/html/gnunet-developers/2016-02/msg00004.html
  379. (define-public gnunet-gtk
  380. (package (inherit gnunet)
  381. (name "gnunet-gtk")
  382. (version "0.13.1")
  383. (source (origin
  384. (method url-fetch)
  385. (uri (string-append "mirror://gnu/gnunet/gnunet-gtk-"
  386. version ".tar.gz"))
  387. (sha256
  388. (base32
  389. "1zdzgq16h77w6ybwg3lqjsjr965np6iqvncqvkbj07glqd4wss0j"))))
  390. (arguments
  391. `(#:configure-flags
  392. (list "--with-libunique"
  393. "--with-qrencode"
  394. (string-append "--with-gnunet="
  395. (assoc-ref %build-inputs "gnunet")))))
  396. (inputs
  397. `(("glade3" ,glade3)
  398. ("gnunet" ,gnunet)
  399. ("gnutls" ,gnutls/dane)
  400. ("gtk+" ,gtk+)
  401. ("libextractor" ,libextractor)
  402. ("libgcrypt" ,libgcrypt)
  403. ("libunique" ,libunique)
  404. ("qrencode" ,qrencode)))
  405. (native-inputs
  406. `(("pkg-config" ,pkg-config)
  407. ("libglade" ,libglade)))
  408. (synopsis "Graphical front-end tools for GNUnet")
  409. (properties '((ftp-server . "ftp.gnu.org")
  410. (ftp-directory . "/gnunet")))))