add license identifier to tweetnacl
[oweals/gnunet.git] / contrib / guix / 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 Ludovic Courtès <ludo@gnu.org>
5 ;;; Copyright © 2015, 2017 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 Nils Gillmann <ng0@n0.is>
9 ;;; Copyright © 2016, 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
10 ;;;
11 ;;; This file is part of GNU Guix.
12 ;;;
13 ;;; GNU Guix is free software; you can redistribute it and/or modify it
14 ;;; under the terms of the GNU General Public License as published by
15 ;;; the Free Software Foundation; either version 3 of the License, or (at
16 ;;; your option) any later version.
17 ;;;
18 ;;; GNU Guix is distributed in the hope that it will be useful, but
19 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 ;;; GNU General Public License for more details.
22 ;;;
23 ;;; You should have received a copy of the GNU General Public License
24 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
25
26 (define-module (gnu packages gnunet)
27   #:use-module (ice-9 popen)
28   #:use-module (ice-9 rdelim)
29   #:use-module (gnu packages)
30   #:use-module (gnu packages file)
31   #:use-module (gnu packages base)
32   #:use-module (gnu packages texinfo)
33   #:use-module (gnu packages aidc)
34   #:use-module (gnu packages autotools)
35   #:use-module (gnu packages compression)
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 gnuzilla)
42   #:use-module (gnu packages groff)
43   #:use-module (gnu packages gtk)
44   #:use-module (gnu packages guile)
45   #:use-module (gnu packages gstreamer)
46   #:use-module (gnu packages imagemagick)
47   #:use-module (gnu packages libidn)
48   #:use-module (gnu packages linux)
49   #:use-module (gnu packages image)
50   #:use-module (gnu packages libunistring)
51   #:use-module (gnu packages maths)
52   #:use-module (gnu packages multiprecision)
53   #:use-module (gnu packages music)
54   #:use-module (gnu packages ncurses)
55   #:use-module (gnu packages package-management)
56   #:use-module (gnu packages pkg-config)
57   #:use-module (gnu packages perl)
58   #:use-module (gnu packages pulseaudio)
59   #:use-module (gnu packages python)
60   #:use-module (gnu packages qt)
61   #:use-module (gnu packages databases)
62   #:use-module (gnu packages tls)
63   #:use-module (gnu packages video)
64   #:use-module (gnu packages web)
65   #:use-module (gnu packages xiph)
66   #:use-module (gnu packages xml)
67   #:use-module (gnu packages xorg)
68   #:use-module (gnu packages backup)
69   #:use-module ((guix licenses) #:prefix license:)
70   #:use-module ((guix build utils) #:prefix build-utils:)
71   #:use-module (guix packages)
72   #:use-module (guix download)
73   #:use-module (guix utils)
74   #:use-module (guix gexp)
75   #:use-module (guix git-download)
76   #:use-module (guix build-system gnu))
77
78
79 (define-public libextractor
80   (package
81    (name "libextractor")
82    (version "1.7")
83    (source (origin
84             (method url-fetch)
85             (uri (string-append "mirror://gnu/libextractor/libextractor-"
86                                 version ".tar.gz"))
87             (sha256
88              (base32
89               "13wf6vj7mkv6gw8h183cnk7m24ir0gyf198pyb2148ng4klgv9p0"))))
90    (build-system gnu-build-system)
91    ;; WARNING: Checks require /dev/shm to be in the build chroot, especially
92    ;; not to be a symbolic link to /run/shm.
93    ;; FIXME:
94    ;; The following dependencies are all optional, but should be
95    ;; available for maximum coverage:
96    ;; * libmagic (file)
97    ;; * librpm (rpm)    ; investigate failure
98    ;; * libgif (giflib) ; investigate failure
99    (inputs
100     `(("exiv2" ,exiv2)
101       ("bzip2" ,bzip2)
102       ("flac" ,flac)
103       ("ffmpeg" ,ffmpeg-3.4)
104       ("file" ,file)                           ;libmagic, for the MIME plug-in
105       ("glib" ,glib)
106       ("gstreamer" ,gstreamer)
107       ("gst-plugins-base" ,gst-plugins-base)
108       ("gtk+" ,gtk+)
109       ("libarchive" ,libarchive)
110       ("libgsf" ,libgsf)
111       ("libjpeg" ,libjpeg)
112       ("libltdl" ,libltdl)
113       ("libmpeg2" ,libmpeg2)
114       ("libmp4v2" ,libmp4v2)
115       ("libsmf" ,libsmf)
116       ("tidy-html" ,tidy-html)
117       ("libogg" ,libogg)
118       ("libtiff" ,libtiff)
119       ("libvorbis" ,libvorbis)
120       ("zlib" ,zlib)))
121    (native-inputs
122     `(("pkg-config" ,pkg-config)))
123    (outputs '("out"
124               "static")) ; 396 KiB .a files
125    (arguments
126     `(#:configure-flags
127       (list (string-append "--with-ltdl="
128                            (assoc-ref %build-inputs "libltdl"))
129             (string-append "--with-tidy="
130                            (assoc-ref %build-inputs "tidy-html")))
131       #:parallel-tests? #f
132       #:phases
133       (modify-phases %standard-phases
134         (add-after 'install 'move-static-libraries
135           (lambda* (#:key outputs #:allow-other-keys)
136             ;; Move static libraries to the "static" output.
137             (let* ((out    (assoc-ref outputs "out"))
138                    (lib    (string-append out "/lib"))
139                    (static (assoc-ref outputs "static"))
140                    (slib   (string-append static "/lib")))
141               (mkdir-p slib)
142               (for-each (lambda (file)
143                           (install-file file slib)
144                           (delete-file file))
145                         (find-files lib "\\.a$"))
146               #t))))))
147    (synopsis "Library to extract meta-data from media files")
148    (description
149     "GNU libextractor is a library for extracting metadata from files.  It
150 supports a very large number of file formats, including audio files, document
151 files, and archive files.  Each file format is implemented as a plugin, so
152 new formats can be added easily.  The package also contains a command-line
153 tool to extract metadata from a file and print the results.")
154    (license license:gpl3+)
155    (home-page "https://www.gnu.org/software/libextractor/")))
156
157 (define-public libmicrohttpd
158   (package
159    (name "libmicrohttpd")
160    (version "0.9.59")
161    (source (origin
162             (method url-fetch)
163             (uri (string-append "mirror://gnu/libmicrohttpd/libmicrohttpd-"
164                                 version ".tar.gz"))
165             (sha256
166              (base32
167               "0g4jgnv43yddr9yxrqg11632rip0lg5c53gmy5wy3c0i1dywv74v"))))
168    (build-system gnu-build-system)
169    (inputs
170     `(("curl" ,curl)
171       ("gnutls" ,gnutls/dane)
172       ("libgcrypt" ,libgcrypt)
173       ("openssl" ,openssl)
174       ("zlib" ,zlib)))
175    (arguments
176     `(#:parallel-tests? #f
177       #:phases (modify-phases %standard-phases
178                  (add-before 'check 'add-missing-LDFLAGS
179                    (lambda _
180                      ;; The two test_upgrade* programs depend on GnuTLS
181                      ;; directly but lack -lgnutls; add it.
182                      (substitute* "src/microhttpd/Makefile"
183                        (("^test_upgrade(.*)LDFLAGS = (.*)$" _ first rest)
184                         (string-append "test_upgrade" first
185                                        "LDFLAGS = -lgnutls " rest)))
186                      #t)))))
187    (synopsis "C library implementing an HTTP 1.1 server")
188    (description
189     "GNU libmicrohttpd is a small, embeddable HTTP server implemented as a
190 C library.  It makes it easy to run an HTTP server as part of another
191 application.  The library is fully HTTP 1.1 compliant.  It can listen on
192 multiple ports, supports four different threading models, and supports
193 IPv6.  It also features security features such as basic and digest
194 authentication and support for SSL3 and TLS.")
195    (license license:lgpl2.1+)
196    (home-page "https://www.gnu.org/software/libmicrohttpd/")))
197
198 (define-public zbar
199   (package
200    (name "zbar")
201    (version "0.22")
202    (source (origin
203             (method url-fetch)
204             (uri (string-append "https://www.linuxtv.org/downloads/zbar/zbar-"
205                                 version ".tar.bz2"))
206             (sha256
207              (base32
208               "1dsffj42gbasfq4sfhgirmi3lfgdygfspwzr00wbva0pf96fka8v"))))
209    (build-system gnu-build-system)
210    (outputs '("out" "gtk" "qt"))
211    (native-inputs
212     `(;;("coreutils" ,coreutils)
213       ("dbus" ,dbus)
214       ("glib:bin", glib "bin")
215       ("pkg-config" ,pkg-config)
216       ;; for testing
217       ("perl" ,perl)
218       ("python2" ,python-2.7)
219       ))
220    (inputs
221     `(("gtk+-2" ,gtk+-2)
222       ("imagemagick" ,imagemagick)
223       ("libjpeg" ,libjpeg)
224       ("libxv" ,libxv)
225       ;;("python2-pygtk" ,python2-pygtk)
226       ("qtbase" ,qtbase)
227       ("qt11extras" ,qtx11extras)
228       ("v4l-utils" ,v4l-utils)
229       ("xmlto" ,xmlto)))
230    (arguments
231     `(#:configure-flags
232       (list "--without-python2"
233             "--without-java"
234             (string-append
235              "--with-dbusconfdir=" (assoc-ref %outputs "out") "/etc")
236             "CXXFLAGS=-std=gnu++11" ;; for qt related
237             ;; Add the other outputs lib directories to the RUNPATH.
238             ;; (string-append "LDFLAGS="
239             ;;             "-Wl,-rpath=" (assoc-ref %outputs "gtk") "/lib"
240             ;;             " "
241             ;;             "-Wl,-rpath=" (assoc-ref %outputs "qt") "/lib"
242             ;;             )
243             )
244       #:tests? #f
245       #:validate-runpath? #f
246       #:phases
247       (modify-phases %standard-phases
248         (add-before 'configure 'create-missing-file
249           ;; Create a file missing in the distribution archive,
250           ;; see https://github.com/mchehab/zbar/issues/35
251           (lambda _
252             (with-output-to-file "examples/sha1sum"
253               (lambda _
254                 (display "
255 a56811d078ea5cfac9be5deb4b6796177763e152  zbarimg codabar.png
256 cc53bf34878f769fc3611020c11e572f2853bd2a  zbarimg code-128.png
257 7537d593ea42393a43bc0eda0a896c0e31017dd8  zbarimg code-39.png
258 f8f55b828eb7d0400f300be021d29293bd4a3191  zbarimg code-93.png
259 aebbdbed0b32d7fd72f1245e3fb384822d492062  zbarimg databar.png
260 9e245874d3229a575eabfdba1c668369c55960e3  zbarimg databar-exp.png
261 53429fc04dfcf674349e2db6cfbaf73e301fc3dc  zbarimg ean-13.png
262 4095418b74efbb026dd730543558fefdda46f5b9  zbarimg ean-8.png
263 5501245dbba21c153f690787fc97ab50c973b846  zbarimg i2-5.png
264 b350ca7efad7a50c5ac082d5c683a8e8d8d380a7  zbarimg qr-code.png
265 84c0ce7072e2227073dc8bd1e5f4518d8f42ae3d  zbarimg sqcode1-generated.png
266 84c0ce7072e2227073dc8bd1e5f4518d8f42ae3d  zbarimg sqcode1-scanned.png
267 5ab2b518e2c9d827cedc5825d2e3c9646d43713a  zbarimg -Sean2.enable ean-2.png
268 668fef8cb9caac34df8cb8564c2cde62e4af5e65  zbarimg -Sean5.enable ean-5.png
269 b567e550216fe24f7652f683146365a9fe7ee867  zbarimg -Sisbn10.enable ean-13.png
270 d0f37aa076d42c270f7231c5490beea5605e2ba0  zbarimg -Sisbn13.enable ean-13.png
271 3f041225df3b8364b5fd0daf9cf402e8a4731f9b  zbarimg -Supca.enable code-upc-a.png
272 b350ca7efad7a50c5ac082d5c683a8e8d8d380a7  zbarimg -Stest-inverted qr-code-inverted.png\n")))))
273         (replace 'check
274           ;; Run test-suite under a dbus session.
275           (lambda _
276             ;; Don't fail on missing  '/etc/machine-id'.
277             (setenv "DBUS_FATAL_WARNINGS" "0")
278             (invoke "dbus-launch" "make" "check")))
279         (add-after 'install 'split
280           (lambda* (#:key inputs outputs #:allow-other-keys)
281             ;; Split the binaries to the various outputs.
282             (let* ((out (assoc-ref outputs "out"))
283                    (gtk (assoc-ref outputs "gtk"))
284                    (qt  (assoc-ref outputs "qt"))
285                    (mv (lambda (dest-out dir pattern)
286                          (mkdir-p (string-append dest-out dir))
287                          (for-each
288                           (lambda (file)
289                             (rename-file
290                              file
291                              (string-append dest-out dir "/" (basename file))))
292                           (find-files (string-append out dir) pattern)))))
293               (mv qt  "/bin" "zbarcam-qt")
294               (mv gtk "/bin" "zbarcam-gtk")
295               (mv qt  "/lib" "libzbarqt\\..*")
296               (mv gtk "/lib" "libzbargtk\\..*")
297               (mv qt  "/lib/pkgconfig" "zbar-qt\\.pc" )
298               (mv gtk "/lib/pkgconfig" "zbar-gtk\\.pc" )
299               (mv qt  "/include/zbar" "QZBar.*\\.h")
300               (mv gtk "/include/zbar" "zbargtk\\.h"))
301             #t)))))
302    (synopsis "Read bar-codes from various sources")
303    (description "ZBar is a software suite for reading bar codes from
304 various sources, such as video streams, image files and raw intensity
305 sensors. It supports EAN-13/UPC-A, UPC-E, EAN-8, Code 128, Code 39,
306 Interleaved 2 of 5 and QR Code. Included with the library are basic
307 applications for decoding captured bar code images and using a video
308 device (eg, webcam) as a bar code scanner. For application developers,
309 language bindings are included for C, C++ and Perl as well as
310 GUI widgets for Qt and GTK")
311    (license license:lgpl2.1+)
312    (home-page "http://zbar.sourceforge.net/")))
313
314 (define-public gnurl
315   (package
316    (name "gnurl")
317    (version "7.61.0")
318    (source (origin
319             (method url-fetch)
320             (uri (string-append "mirror://gnu/gnunet/" name "-" version ".tar.Z"))
321             (sha256
322              (base32
323               "1h03zkd9mp4xb5icirl3bfd64r5x8j9ka1hw9qd0n1ql1w0ilz23"))))
324    (build-system gnu-build-system)
325    (outputs '("out"
326               "doc"))                             ; 1.5 MiB of man3 pages
327    (inputs `(("gnutls" ,gnutls/dane)
328              ("libidn" ,libidn)
329              ("zlib" ,zlib)))
330    (native-inputs
331     `(("libtool" ,libtool)
332       ("groff" ,groff)
333       ("perl" ,perl)
334       ("pkg-config" ,pkg-config)
335       ("python" ,python-2)))
336    (arguments
337     `(#:configure-flags (list "--enable-benchmark")
338       #:test-target "test"
339       #:parallel-tests? #f
340       #:phases
341       ;; We have to patch runtests.pl in tests/ directory
342       (modify-phases %standard-phases
343         (add-after 'install 'move-man3-pages
344           (lambda* (#:key outputs #:allow-other-keys)
345             ;; Move section 3 man pages to "doc".
346             (let ((out (assoc-ref outputs "out"))
347                   (doc (assoc-ref outputs "doc")))
348               (mkdir-p (string-append doc "/share/man"))
349               (rename-file (string-append out "/share/man/man3")
350                            (string-append doc "/share/man/man3"))
351               #t)))
352         (replace 'check
353           (lambda _
354             (substitute* "tests/runtests.pl"
355               (("/bin/sh") (which "sh")))
356
357             ;; Make test output more verbose.
358             (invoke "make" "-C" "tests" "test"))))))
359    (synopsis "Microfork of cURL with support for the HTTP/HTTPS/GnuTLS subset of cURL")
360    (description
361     "Gnurl is a microfork of cURL, a command line tool for transferring data
362 with URL syntax.  While cURL supports many crypto backends, libgnurl only
363 supports HTTP, HTTPS and GnuTLS.")
364    (license (license:non-copyleft "file://COPYING"
365                                   "See COPYING in the distribution."))
366    (home-page "https://gnunet.org/gnurl")))
367
368
369 (define (repeat f n)
370   (if (= n 1)
371       f
372       (lambda (x) (f ((repeat f (- n 1)) x)))))
373
374 (define %source-dir ((repeat dirname 5) (current-filename)))
375   
376 (define (git-output . args)
377   "Execute 'git ARGS ...' command and return its output without trailing
378 newspace."
379   (build-utils:with-directory-excursion %source-dir
380     (let* ((port   (apply open-pipe* OPEN_READ "git" args))
381            (output (read-string port)))
382       (close-port port)
383       (string-trim-right output #\newline))))
384
385 (define (current-git-version)
386   (git-output "describe" "--tags"))
387
388 (define (git-sources)
389   (local-file %source-dir
390               #:recursive? #t
391               #:select? (git-predicate %source-dir)))
392
393 (define-public gnunet
394   (package
395    (name "gnunet")
396    (version (current-git-version))
397    (source (git-sources))
398    (build-system gnu-build-system)
399    (inputs
400     `(("glpk" ,glpk)
401       ("gnurl" ,gnurl)
402       ("gstreamer" ,gstreamer)
403       ("gst-plugins-base" ,gst-plugins-base)
404       ("gnutls" ,gnutls/dane)
405       ("libextractor" ,libextractor)
406       ("libgcrypt" ,libgcrypt)
407       ("libidn" ,libidn)
408       ("libmicrohttpd" ,libmicrohttpd) ; hostlist, pt, contrib, and more
409       ("libltdl" ,libltdl)
410       ("libunistring" ,libunistring) ; fs and more
411       ("openssl" ,openssl) ; transport, certificate creation, contribs
412       ("opus" ,opus) ; gnunet-conversation
413       ("pulseaudio" ,pulseaudio) ; conversation
414       ("sqlite" ,sqlite) ; sqlite bindings, *store
415       ("postgresql" ,postgresql)
416       ("zlib" ,zlib)
417       ("perl" ,perl) ; doxygen and more
418       ("jansson" ,jansson) ; identity, taler (external), gnunet-json, gns
419       ("nss" ,nss) ; gns
420       ("gmp" ,gmp) ; util
421       ("bluez" ,bluez) ; gnunet-transport
422       ("glib" ,glib)
423       ("libogg" ,libogg) ; gnunet-conversation
424       ("zbar" ,zbar) ; gnunet-qr
425       ("python-2" ,python-2))) ; tests
426    (native-inputs
427     `(("pkg-config" ,pkg-config)
428       ("autoconf" ,autoconf)
429       ("automake" ,automake)
430       ("gnu-gettext" ,gnu-gettext)
431       ("which" ,which)
432       ("texinfo" ,texinfo-5) ; Debian stable: 5.2
433       ("libtool" ,libtool)))
434    (arguments
435     '(#:configure-flags
436       (list (string-append "--with-nssdir=" %output "/lib"))
437       #:parallel-tests? #f
438       ;; test_gnunet_service_arm fails; reported upstream
439       #:tests? #f
440       #:phases
441       (modify-phases %standard-phases
442         (add-after 'unpack 'patch-bin-sh
443           (lambda _
444             (for-each (lambda (f) (chmod f #o755))
445                       (find-files "po" ""))
446             #t))
447         ;; swap check and install phases and set paths to installed binaries
448         (add-before 'check 'set-path-for-check
449           (lambda* (#:key outputs #:allow-other-keys)
450            (let ((out (assoc-ref outputs "out")))
451              (setenv "GNUNET_PREFIX" (string-append out "/lib"))
452              (setenv "PATH" (string-append (getenv "PATH") ":" out "/bin")))
453            #t))
454         (add-after 'install 'check
455           (assoc-ref %standard-phases 'check))
456         (delete 'check))))
457    (synopsis "Secure, decentralized, peer-to-peer networking framework")
458    (description
459      "GNUnet is a framework for secure peer-to-peer networking.  The
460 high-level goal is to provide a strong foundation of free software for a
461 global, distributed network that provides security and privacy.  GNUnet in
462 that sense aims to replace the current internet protocol stack.  Along with
463 an application for secure publication of files, it has grown to include all
464 kinds of basic applications for the foundation of a GNU internet.")
465    (license license:gpl3+)
466    (home-page "https://gnunet.org/")))
467
468 (define-public guile-gnunet                       ;GSoC 2015!
469   (let ((commit "383eac2aab175d8d9ea5315c2f1c8a5055c76a52"))
470     (package
471       (name "guile-gnunet")
472       (version (string-append "0.0." (string-take commit 7)))
473       (source (origin
474                 (method git-fetch)
475                 (uri (git-reference
476                       (url "https://git.savannah.gnu.org/git/guix/gnunet.git/")
477                       (commit commit)))
478                 (file-name (string-append name "-" version "-checkout"))
479                 (sha256
480                  (base32
481                   "0k6mn28isjlxrnvbnblab3nh2xqx1b7san8k98kc35ap9lq0iz8w"))))
482       (build-system gnu-build-system)
483       (native-inputs `(("pkg-config" ,pkg-config)
484                        ("autoconf" ,autoconf-wrapper)
485                        ("automake" ,automake)))
486       (inputs `(("guile" ,guile-2.0)
487                 ("gnunet" ,gnunet)))
488       (synopsis "Guile bindings for GNUnet services")
489       (description
490        "This package provides Guile bindings to the client libraries of various
491 GNUnet services, including the @dfn{identity} and @dfn{file sharing}
492 services.")
493       (home-page "https://gnu.org/software/guix")
494       (license license:gpl3+))))
495
496 ;; FIXME: "gnunet-setup" segfaults under certain conditions and "gnunet-gtk"
497 ;; does not seem to be fully functional.  This has been reported upstream:
498 ;; http://lists.gnu.org/archive/html/gnunet-developers/2016-02/msg00004.html
499 (define-public gnunet-gtk
500   (package (inherit gnunet)
501     (name "gnunet-gtk")
502     (version (package-version gnunet))
503     (source (origin
504               (method url-fetch)
505               (uri (string-append "mirror://gnu/gnunet/gnunet-gtk-"
506                                   version ".tar.gz"))
507               (sha256
508                (base32
509                 "1p38k1s6a2fmcfc9a7cf1zrdycm9h06kqdyand4s3k500nj6mb4g"))))
510     (arguments
511      `(#:configure-flags
512        (list "--with-libunique"
513              "--with-qrencode"
514              (string-append "--with-gnunet="
515                             (assoc-ref %build-inputs "gnunet")))))
516     (inputs
517      `(("gnunet" ,gnunet)
518        ("libgcrypt" ,libgcrypt)
519        ("gtk+" ,gtk+)
520        ("libextractor" ,libextractor)
521        ("glade3" ,glade3)
522        ("qrencode" ,qrencode)
523        ("libunique" ,libunique)))
524     (native-inputs
525      `(("pkg-config" ,pkg-config)
526        ("libglade" ,libglade)))
527     (synopsis "Graphical front-end tools for GNUnet")))