Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / gnu / packages / gnunet.scm
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 Ludovic Courtès <ludo@gnu.org>
5 ;;; Copyright © 2015, 2017, 2019, 2020 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 ng0 <ng0@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 ;;;
13 ;;; This file is part of GNU Guix.
14 ;;;
15 ;;; GNU Guix is free software; you can redistribute it and/or modify it
16 ;;; under the terms of the GNU General Public License as published by
17 ;;; the Free Software Foundation; either version 3 of the License, or (at
18 ;;; your option) any later version.
19 ;;;
20 ;;; GNU Guix is distributed in the hope that it will be useful, but
21 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
22 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 ;;; GNU General Public License for more details.
24 ;;;
25 ;;; You should have received a copy of the GNU General Public License
26 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
27
28 (define-module (gnu packages gnunet)
29 #:use-module (gnu packages)
30 #:use-module (gnu packages file)
31 #:use-module (gnu packages aidc)
32 #:use-module (gnu packages autotools)
33 #:use-module (gnu packages compression)
34 #:use-module (gnu packages curl)
35 #:use-module (gnu packages gettext)
36 #:use-module (gnu packages glib)
37 #:use-module (gnu packages gnome)
38 #:use-module (gnu packages gnupg)
39 #:use-module (gnu packages groff)
40 #:use-module (gnu packages gtk)
41 #:use-module (gnu packages guile)
42 #:use-module (gnu packages gstreamer)
43 #:use-module (gnu packages libidn)
44 #:use-module (gnu packages linux)
45 #:use-module (gnu packages image)
46 #:use-module (gnu packages libunistring)
47 #:use-module (gnu packages maths)
48 #:use-module (gnu packages multiprecision)
49 #:use-module (gnu packages music)
50 #:use-module (gnu packages ncurses)
51 #:use-module (gnu packages nss)
52 #:use-module (gnu packages package-management)
53 #:use-module (gnu packages pkg-config)
54 #:use-module (gnu packages perl)
55 #:use-module (gnu packages pulseaudio)
56 #:use-module (gnu packages python)
57 #:use-module (gnu packages sqlite)
58 #:use-module (gnu packages tls)
59 #:use-module (gnu packages upnp)
60 #:use-module (gnu packages video)
61 #:use-module (gnu packages vim)
62 #:use-module (gnu packages web)
63 #:use-module (gnu packages xiph)
64 #:use-module (gnu packages backup)
65 #:use-module ((guix licenses) #:prefix license:)
66 #:use-module (guix packages)
67 #:use-module (guix download)
68 #:use-module (guix git-download)
69 #:use-module (guix build-system gnu))
70
71 (define-public libextractor
72 (package
73 (name "libextractor")
74 (version "1.9")
75 (source (origin
76 (method url-fetch)
77 (uri (string-append "mirror://gnu/libextractor/libextractor-"
78 version ".tar.gz"))
79 (sha256
80 (base32
81 "1zz2zvikvfibxnk1va3kgzs7djsmiqy7bmk8y01vbsf54ryjb3zh"))
82 (patches (search-patches "libextractor-exiv2.patch"))))
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 ;; * libmagic (file)
90 ;; * librpm (rpm) ; investigate failure
91 ;; * libgif (giflib) ; investigate failure
92 (inputs
93 `(("exiv2" ,exiv2)
94 ("bzip2" ,bzip2)
95 ("flac" ,flac)
96 ("ffmpeg" ,ffmpeg)
97 ("file" ,file) ;libmagic, for the MIME plug-in
98 ("glib" ,glib)
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 ("tidy-html" ,tidy-html)
110 ("libogg" ,libogg)
111 ("libtiff" ,libtiff)
112 ("libvorbis" ,libvorbis)
113 ("zlib" ,zlib)))
114 (native-inputs
115 `(("pkg-config" ,pkg-config)))
116 (outputs '("out"
117 "static")) ; 396 KiB .a files
118 (arguments
119 `(#:configure-flags
120 (list (string-append "--with-ltdl="
121 (assoc-ref %build-inputs "libltdl"))
122 (string-append "--with-tidy="
123 (assoc-ref %build-inputs "tidy-html")))
124 #:parallel-tests? #f
125 #:phases
126 (modify-phases %standard-phases
127 (add-after 'install 'move-static-libraries
128 (lambda* (#:key outputs #:allow-other-keys)
129 ;; Move static libraries to the "static" output.
130 (let* ((out (assoc-ref outputs "out"))
131 (lib (string-append out "/lib"))
132 (static (assoc-ref outputs "static"))
133 (slib (string-append static "/lib")))
134 (mkdir-p slib)
135 (for-each (lambda (file)
136 (install-file file slib)
137 (delete-file file))
138 (find-files lib "\\.a$"))
139 #t))))))
140 (synopsis "Library to extract meta-data from media files")
141 (description
142 "GNU libextractor is a library for extracting metadata from files. It
143 supports a very large number of file formats, including audio files, document
144 files, and archive files. Each file format is implemented as a plugin, so
145 new formats can be added easily. The package also contains a command-line
146 tool to extract metadata from a file and print the results.")
147 (license license:gpl3+)
148 (home-page "https://www.gnu.org/software/libextractor/")))
149
150 (define-public libmicrohttpd
151 (package
152 (name "libmicrohttpd")
153 (version "0.9.70")
154 (source (origin
155 (method url-fetch)
156 (uri (string-append "mirror://gnu/libmicrohttpd/libmicrohttpd-"
157 version ".tar.gz"))
158 (sha256
159 (base32
160 "01vkjy89b1ylmh22dy5yza2r414nfwcfixxh3v29nvzrjv9s7l4h"))))
161 (build-system gnu-build-system)
162 (inputs
163 `(("curl" ,curl)
164 ("gnutls" ,gnutls/dane)
165 ("libgcrypt" ,libgcrypt)
166 ("openssl" ,openssl)
167 ("zlib" ,zlib)))
168 (synopsis "C library implementing an HTTP 1.1 server")
169 (description
170 "GNU libmicrohttpd is a small, embeddable HTTP server implemented as a
171 C library. It makes it easy to run an HTTP server as part of another
172 application. The library is fully HTTP 1.1 compliant. It can listen on
173 multiple ports, supports four different threading models, and supports
174 IPv6. It also features security features such as basic and digest
175 authentication and support for SSL3 and TLS.")
176 (license license:lgpl2.1+)
177 (home-page "https://www.gnu.org/software/libmicrohttpd/")))
178
179 (define-public gnurl
180 (package
181 (name "gnurl")
182 (version "7.67.0")
183 (source (origin
184 (method url-fetch)
185 (uri (string-append "mirror://gnu/gnunet/" name "-" version ".tar.Z"))
186 (sha256
187 (base32
188 "0ssjz2npr2zjvcpfz9qbaj92xc9ayg8wx4hyl132snl94qr2v670"))))
189 (build-system gnu-build-system)
190 (outputs '("out"
191 "doc")) ; 1.8 MiB of man3 pages
192 (inputs `(("gnutls" ,gnutls/dane)
193 ("libidn2" ,libidn2)
194 ("zlib" ,zlib)))
195 (native-inputs
196 `(("libtool" ,libtool)
197 ("perl" ,perl)
198 ("pkg-config" ,pkg-config)
199 ("python" ,python)))
200 (arguments
201 `(#:configure-flags
202 ;; All of these produce errors during configure.
203 (list "--disable-ftp"
204 "--disable-file"
205 "--disable-ldap"
206 "--disable-rtsp"
207 "--disable-dict"
208 "--disable-telnet"
209 "--disable-tftp"
210 "--disable-pop3"
211 "--disable-imap"
212 "--disable-smb"
213 "--disable-smtp"
214 "--disable-gopher"
215 "--without-ssl"
216 "--without-libpsl"
217 "--without-librtmp"
218 "--disable-ntlm-wb")
219 #:phases
220 (modify-phases %standard-phases
221 (add-after 'install 'move-man3-pages
222 (lambda* (#:key outputs #:allow-other-keys)
223 ;; Move section 3 man pages to "doc".
224 (let ((out (assoc-ref outputs "out"))
225 (doc (assoc-ref outputs "doc")))
226 (mkdir-p (string-append doc "/share/man"))
227 (rename-file (string-append out "/share/man/man3")
228 (string-append doc "/share/man/man3"))
229 #t)))
230 ;; We have to patch runtests.pl in tests/ directory
231 (replace 'check
232 (lambda _
233 (substitute* "tests/runtests.pl"
234 (("/bin/sh") (which "sh")))
235
236 ;; Make test output more verbose.
237 (invoke "make" "-C" "tests" "test"))))))
238 (synopsis "Microfork of cURL with support for the HTTP/HTTPS/GnuTLS subset of cURL")
239 (description
240 "Gnurl is a microfork of cURL, a command line tool for transferring data
241 with URL syntax. While cURL supports many crypto backends, libgnurl only
242 supports HTTP, HTTPS and GnuTLS.")
243 (license (license:non-copyleft "file://COPYING"
244 "See COPYING in the distribution."))
245 (properties '((ftp-server . "ftp.gnu.org")
246 (ftp-directory . "/gnunet")))
247 (home-page "https://gnunet.org/gnurl")))
248
249 (define-public gnunet
250 (package
251 (name "gnunet")
252 (version "0.11.8")
253 (source
254 (origin
255 (method url-fetch)
256 (uri (string-append "mirror://gnu/gnunet/gnunet-" version
257 ".tar.gz"))
258 (sha256
259 (base32
260 "1zkmcq75sfr3iyg8rgxp9dbl7fwsvc1a71rc0vgisghcbrx1n7yj"))))
261 (build-system gnu-build-system)
262 (inputs
263 `(("bluez" ,bluez)
264 ("glpk" ,glpk)
265 ("gnurl" ,gnurl)
266 ("gnutls" ,gnutls/dane)
267 ("gstreamer" ,gstreamer)
268 ("jansson" ,jansson)
269 ("libextractor" ,libextractor)
270 ("libidn" ,libidn2)
271 ("libgcrypt" ,libgcrypt)
272 ("libltdl" ,libltdl)
273 ("libmicrohttpd" ,libmicrohttpd)
274 ("libogg" ,libogg)
275 ("libunistring" ,libunistring)
276 ("miniupnpc" ,miniupnpc)
277 ("opus" ,opus)
278 ("pulseaudio" ,pulseaudio)
279 ("sqlite" ,sqlite)
280 ("zbar" ,zbar)
281 ("zlib" ,zlib)))
282 (native-inputs
283 `(("pkg-config" ,pkg-config)
284 ("python" ,python)
285 ("xxd" ,xxd)
286 ("which" ,(@ (gnu packages base) which))))
287 (arguments
288 '(#:parallel-tests? #f ; Parallel tests aren't supported.
289 #:phases
290 (modify-phases %standard-phases
291 (add-after 'configure 'remove-failing-tests
292 ;; These tests fail in Guix's building envrionment.
293 (lambda _
294 (substitute* "src/transport/Makefile"
295 (("test_transport_api_udp_nat\\$\\(EXEEXT\\) \\\\\n") "")
296 (("test_transport_api_manipulation_cfg\\$\\(EXEEXT\\) \\\\\n") ""))
297 (substitute* "src/topology/Makefile"
298 (("^check_PROGRAMS.*") "\n")
299 (("test_gnunet_daemon_topology\\$\\(EXEEXT\\)\n") ""))
300 (substitute* "src/namestore/Makefile"
301 (("\\$\\(am__append_2\\)") ""))
302 (substitute* "src/gns/Makefile"
303 (("\\$\\(am__append_4\\)") ""))
304 (substitute* "contrib/Makefile"
305 (("^check_PROGRAMS.*") "\n"))
306 ;; 'test' from coreutils doesn't behave as the test expects.
307 (substitute* '("src/gns/gnunet-gns-proxy-setup-ca.in"
308 "src/transport/gnunet-transport-certificate-creation.in")
309 (("gnutls-certtool") "certtool"))
310 #t))
311 ;; Swap 'check and 'install phases and add installed binaries to $PATH.
312 (add-before 'check 'set-path-for-check
313 (lambda* (#:key outputs #:allow-other-keys)
314 (let ((out (assoc-ref outputs "out")))
315 (setenv "GNUNET_PREFIX" (string-append out "/lib"))
316 (setenv "PATH" (string-append (getenv "PATH") ":" out "/bin")))
317 #t))
318 (delete 'check)
319 (add-after 'install 'check
320 (assoc-ref %standard-phases 'check)))))
321 (synopsis "Secure, decentralized, peer-to-peer networking framework")
322 (description
323 "GNUnet is a framework for secure peer-to-peer networking. The
324 high-level goal is to provide a strong foundation of free software for a
325 global, distributed network that provides security and privacy. GNUnet in
326 that sense aims to replace the current internet protocol stack. Along with
327 an application for secure publication of files, it has grown to include all
328 kinds of basic applications for the foundation of a GNU internet.")
329 (license license:agpl3+)
330 (home-page "https://gnunet.org/")))
331
332 (define-public guile-gnunet ;GSoC 2015!
333 (let ((commit "d12167ab3c8d7d6caffd9c606e389ef043760602")
334 (revision "1"))
335 (package
336 (name "guile-gnunet")
337 (version (git-version "0.0" revision commit))
338 (source (origin
339 (method git-fetch)
340 (uri (git-reference
341 (url "https://git.savannah.gnu.org/git/guix/gnunet.git/")
342 (commit commit)))
343 (file-name (git-file-name name version))
344 (sha256
345 (base32
346 "0nqc18jh9j30y4l6yh6j35byfg6qalq7yr3frv9rk10qa041c2sv"))))
347 (build-system gnu-build-system)
348 (native-inputs `(("pkg-config" ,pkg-config)
349 ("autoconf" ,autoconf-wrapper)
350 ("automake" ,automake)))
351 (inputs `(("guile" ,guile-2.0)
352 ("gnunet" ,gnunet)))
353 (synopsis "Guile bindings for GNUnet services")
354 (description
355 "This package provides Guile bindings to the client libraries of various
356 GNUnet services, including the @dfn{identity} and @dfn{file sharing}
357 services.")
358 (home-page "https://gnu.org/software/guix")
359 (license license:gpl3+))))
360
361 ;; FIXME: "gnunet-setup" segfaults under certain conditions and "gnunet-gtk"
362 ;; does not seem to be fully functional. This has been reported upstream:
363 ;; http://lists.gnu.org/archive/html/gnunet-developers/2016-02/msg00004.html
364 (define-public gnunet-gtk
365 (package (inherit gnunet)
366 (name "gnunet-gtk")
367 (version "0.11.7")
368 (source (origin
369 (method url-fetch)
370 (uri (string-append "mirror://gnu/gnunet/gnunet-gtk-"
371 version ".tar.gz"))
372 (sha256
373 (base32
374 "061ifhqk6q9kx71z5404fm4d60yj2dihlwwmdqmhkn5nn4bvcwb5"))))
375 (arguments
376 `(#:configure-flags
377 (list "--with-libunique"
378 "--with-qrencode"
379 (string-append "--with-gnunet="
380 (assoc-ref %build-inputs "gnunet")))))
381 (inputs
382 `(("glade3" ,glade3)
383 ("gnunet" ,gnunet)
384 ("gnutls" ,gnutls/dane)
385 ("gtk+" ,gtk+)
386 ("libextractor" ,libextractor)
387 ("libgcrypt" ,libgcrypt)
388 ("libunique" ,libunique)
389 ("qrencode" ,qrencode)))
390 (native-inputs
391 `(("pkg-config" ,pkg-config)
392 ("libglade" ,libglade)))
393 (synopsis "Graphical front-end tools for GNUnet")
394 (properties '((ftp-server . "ftp.gnu.org")
395 (ftp-directory . "/gnunet")))))