1 ;;; This file is part of GNUnet.
2 ;;; Copyright (C) 2016, 2017 GNUnet e.V.
4 ;;; GNUnet is free software; you can redistribute it and/or modify
5 ;;; it under the terms of the GNU General Public License as published
6 ;;; by the Free Software Foundation; either version 3, or (at your
7 ;;; option) any later version.
9 ;;; GNUnet is distributed in the hope that it will be useful, but
10 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
11 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 ;;; General Public License for more details.
14 ;;; You should have received a copy of the GNU General Public License
15 ;;; along with GNUnet; see the file COPYING. If not, write to the
16 ;;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 ;;; Boston, MA 02110-1301, USA.
19 (define-module (gnunet packages gnunet)
20 #:use-module (guix build-system gnu)
21 #:use-module (guix download)
22 #:use-module (guix git-download)
23 #:use-module ((guix licenses) #:prefix license:)
24 #:use-module (guix packages)
25 #:use-module (gnu packages)
26 #:use-module (gnu packages admin)
27 #:use-module (gnu packages aidc)
28 #:use-module (gnu packages autotools)
29 #:use-module (gnu packages base)
30 #:use-module (gnu packages bison)
31 #:use-module (gnu packages compression)
32 #:use-module (gnu packages databases)
33 #:use-module (gnu packages gettext)
34 #:use-module (gnu packages glib)
35 #:use-module (gnu packages gnome)
36 #:use-module (gnu packages gnunet)
37 #:use-module (gnu packages gnupg)
38 #:use-module (gnu packages gnuzilla)
39 #:use-module (gnu packages gstreamer)
40 #:use-module (gnu packages gtk)
41 #:use-module (gnu packages libidn)
42 #:use-module (gnu packages libunistring)
43 #:use-module (gnu packages linux)
44 #:use-module (gnu packages man)
45 #:use-module (gnu packages image-viewers)
46 #:use-module (gnu packages maths)
47 #:use-module (gnu packages multiprecision)
48 #:use-module (gnu packages ncurses)
49 #:use-module (gnu packages pcre)
50 #:use-module (gnu packages perl)
51 #:use-module (gnu packages pkg-config)
52 #:use-module (gnu packages pulseaudio)
53 #:use-module (gnu packages python)
54 #:use-module (gnu packages tls)
55 #:use-module (gnu packages texinfo)
56 #:use-module (gnu packages tex)
57 #:use-module (gnu packages upnp)
58 #:use-module (gnu packages web)
59 #:use-module (gnu packages xiph))
61 ;; TODO: Use HEAD without checking sum of it.
62 ;; Explanation for name scheme: UNIXPATH is capped at 108 characters,
63 ;; this causes lots of tests to fail.
64 ;; FIXME: make this file MUCH shorter.
65 (define-public gnunetg
66 (let* ((commit "3c3090717610ea787fdd3562901329254a6af0d6")
71 (version (string-append "0.10.1" "-" revision
72 "." (string-take commit 7)))
77 (url "https://gnunet.org/git/gnunet.git")
79 (file-name (string-append name "-" version "-checkout"))
82 "0g0x1r833jkssfd2sndy37509dqf9f8myjvg7mnadwc1irp393bl"))))
83 (build-system gnu-build-system)
87 ("gstreamer" ,gstreamer)
88 ("gst-plugins-base" ,gst-plugins-base)
90 ("libextractor" ,libextractor)
91 ("libgcrypt" ,libgcrypt)
93 ("libmicrohttpd" ,libmicrohttpd)
95 ("libunistring" ,libunistring)
98 ("pulseaudio" ,pulseaudio)
102 ("python" ,python-2) ; tests and gnunet-qr
107 ("miniupnpc" ,miniupnpc)
108 ("bluez" ,bluez) ; for optional bluetooth feature
110 ;; ("texlive-minimal" ,texlive-minimal) ; optional.
113 `(("pkg-config" ,pkg-config)
114 ("autoconf" ,autoconf)
115 ("automake" ,automake)
116 ("gnu-gettext" ,gnu-gettext)
119 ("libtool" ,libtool)))
120 (outputs '("out" "debug"))
123 (list (string-append "--with-nssdir=" %output "/lib")
124 "--enable-experimental")
125 #:parallel-tests? #f ; parallel building is not functional
126 #:tests? #f ; FAIL: test_gnunet_statistics.py
128 ;; swap check and install phases and set paths to installed bin
129 (modify-phases %standard-phases
130 (add-after 'unpack 'patch-bin-sh
132 (substitute* "bootstrap"
133 (("contrib/pogen.sh") "sh contrib/pogen.sh"))
134 (for-each (lambda (f) (chmod f #o755))
135 (find-files "po" ""))
137 (add-after 'patch-bin-sh 'bootstrap
139 (zero? (system* "sh" "bootstrap"))))
140 ;; DISABLED until failing testcases are fixed.
141 ;; this test fails in our environment, disable it:
142 ;; XXX: specify which ones fail.
143 ;; (add-after 'patch-bin-sh 'disable-test_quota_compliance_tcp_asymmetric
145 ;; (substitute* '("src/transport/Makefile.am")
146 ;; (("test_quota_compliance_tcp_asymmetric") ""))))
147 ;; (("test_quota_compliance_http_asymmetric") "")
148 ;; (("test_quota_compliance_https_asymmetric") "")
149 ;; (("test_quota_compliance_unix") "")
150 ;; (("test_quota_compliance_unix_asymmetric") ""))))
151 ;; check is between build and install, fix this to:
152 ;; build - install - check, else the test suite fails.
153 (delete 'check)))))))
154 ;; (add-after 'install 'set-path-for-check
155 ;; (lambda* (#:key outputs #:allow-other-keys)
156 ;; (let* ((out (assoc-ref outputs "out"))
157 ;; (bin (string-append out "/bin"))
158 ;; (lib (string-append out "/lib")))
159 ;; (setenv "GNUNET_PREFIX" lib)
160 ;; (setenv "PATH" (string-append (getenv "PATH") ":" bin))
161 ;; ;; XXX: https://gnunet.org/bugs/view.php?id=4619#c11061
162 ;; ;; Enable core dump before the tests.
163 ;; ;; XXX: HOW??? ulimit -c unlimited
164 ;; (zero? (system* "make" "check"))))))))
166 (define-public gnunet-doc
169 (version (package-version gnunetg))
170 (source (package-source gnunetg))
171 (build-system gnu-build-system)
172 ;; FIXME: Introduce DOCS_ONLY option for configure script.
173 ;; This should prevent the checks for all required software.
177 ("gstreamer" ,gstreamer)
178 ("gst-plugins-base" ,gst-plugins-base)
180 ("libextractor" ,libextractor)
181 ("libgcrypt" ,libgcrypt)
183 ("libmicrohttpd" ,libmicrohttpd)
185 ("libunistring" ,libunistring)
188 ("pulseaudio" ,pulseaudio)
192 ("python" ,python-2) ; tests and gnunet-qr
197 ("miniupnpc" ,miniupnpc)
198 ("bluez" ,bluez) ; for optional bluetooth feature
200 ("texlive" ,texlive) ;TODO: Use a minimal subset.
203 `(("pkg-config" ,pkg-config)
204 ("autoconf" ,autoconf)
206 ("automake" ,automake)
207 ("gnu-gettext" ,gnu-gettext)
209 ("libtool" ,libtool)))
211 `(#:tests? #f ;Don't run tests
213 (modify-phases %standard-phases
214 (add-after 'unpack 'patch-bin-sh
216 (substitute* "bootstrap"
217 (("contrib/pogen.sh") "sh contrib/pogen.sh"))
218 (for-each (lambda (f) (chmod f #o755))
219 (find-files "po" ""))
221 (add-after 'patch-bin-sh 'bootstrap
223 (zero? (system* "sh" "bootstrap"))))
227 (zero? (system* "make" "doc-all-give-me-the-noise"))))
229 (lambda* (#:key outputs #:allow-other-keys)
230 (let* ((out (assoc-ref outputs "out"))
231 (doc (string-append out "/share/doc/gnunet")))
233 (mkdir-p (string-append doc "/gnunet"))
234 (install-file "gnunet.pdf" doc)
235 (install-file "gnunet.info" doc)
236 (copy-recursively "gnunet"
239 (install-file "gnunet-c-tutorial.pdf" doc)
240 (install-file "gnunet-c-tutorial.info" doc)
241 (copy-recursively "gnunet-c-tutorial"
243 "/gnunet-c-tutorial")))
245 (synopsis "GNUnet documentation")
247 "Gnunet-doc builds the documentation of GNUnet.")
248 (home-page "https://gnunet.org")
249 (license (package-license gnunet))))
251 (define-public gnunetgpg
256 `(("postgresql" ,postgresql)
257 ,@(package-inputs gnunetg)))
258 (synopsis "gnunet, variant with postgres")))
260 (define-public gnunetgf
265 `(("postgresql" ,postgresql)
267 ,@(package-inputs gnunetg)))
270 (list (string-append "--with-nssdir=" %output "/lib")
271 "--enable-gcc-hardening"
272 "--enable-linker-hardening"
276 "--enable-experimental"
277 "--enable-logging=verbose"
279 #:parallel-tests? #f ; parallel building is not supported.
280 ;;#:tests? #f ; fail: test_gnunet_statistics.py
282 ;; swap check and install phases and set paths to installed bin
283 (modify-phases %standard-phases
284 (add-after 'unpack 'patch-bin-sh
286 (substitute* "bootstrap"
287 (("contrib/pogen.sh") "sh contrib/pogen.sh"))
288 (for-each (lambda (f) (chmod f #o755))
289 (find-files "po" ""))
291 (add-after 'patch-bin-sh 'bootstrap
293 (zero? (system* "sh" "bootstrap"))))
295 (synopsis "gnunet, full git build without tests")))
297 ;; A package to run the test suite.
298 (define-public gnunetgft
304 (list (string-append "--with-nssdir=" %output "/lib")
305 "--enable-gcc-hardening"
306 "--enable-linker-hardening"
308 ;;"--enable-poisoning"
309 ;;"--enable-sanitizer"
310 "--enable-experimental"
311 "--enable-logging=verbose"
313 ;; #:parallel-tests? #f ; parallel building seems to fail
314 ;;#:tests? #f ; fail: test_gnunet_statistics.py
316 ;; swap check and install phases and set paths to installed bin
317 (modify-phases %standard-phases
318 (add-after 'unpack 'patch-bin-sh
320 (substitute* "bootstrap"
321 (("contrib/pogen.sh") "sh contrib/pogen.sh"))
322 (for-each (lambda (f) (chmod f #o755))
323 (find-files "po" ""))
325 (add-after 'patch-bin-sh 'bootstrap
327 (zero? (system* "sh" "bootstrap"))))
329 ;; XXX: https://gnunet.org/bugs/view.php?id=4619
330 (add-after 'install 'set-path-for-check
331 (lambda* (#:key outputs #:allow-other-keys)
332 (let* ((out (assoc-ref outputs "out"))
333 (bin (string-append out "/bin"))
334 (lib (string-append out "/lib")))
335 (setenv "GNUNET_PREFIX" lib)
336 (setenv "PATH" (string-append (getenv "PATH") ":" bin))
337 (zero? (system* "make" "check"))))))))
338 (synopsis "gnunet, full git with tests enabled with parallel tests")))
340 (define-public gnunetg-test
343 (name "gnunetg-test")
346 (list (string-append "--with-nssdir=" %output "/lib")
347 "--enable-gcc-hardening"
348 "--enable-linker-hardening"
350 ;;"--enable-poisoning"
351 ;;"--enable-sanitizer"
352 "--enable-logging=verbose"
354 ;; #:parallel-tests? #f ; parallel building seems to fail
355 ;;#:tests? #f ; fail: test_gnunet_statistics.py
357 ;; swap check and install phases and set paths to installed bin
358 (modify-phases %standard-phases
359 (add-after 'unpack 'patch-bin-sh
361 (substitute* "bootstrap"
362 (("contrib/pogen.sh") "sh contrib/pogen.sh"))
363 (for-each (lambda (f) (chmod f #o755))
364 (find-files "po" ""))
366 (add-after 'patch-bin-sh 'bootstrap
368 (zero? (system* "sh" "bootstrap"))))
370 ;; XXX: https://gnunet.org/bugs/view.php?id=4619
371 (add-after 'install 'set-path-for-check
372 (lambda* (#:key outputs #:allow-other-keys)
373 (let* ((out (assoc-ref outputs "out"))
374 (bin (string-append out "/bin"))
375 (lib (string-append out "/lib")))
376 (setenv "GNUNET_PREFIX" lib)
377 (setenv "PATH" (string-append (getenv "PATH") ":" bin))
378 (zero? (system* "make" "check"))))))))
379 (synopsis "gnunet, full git with tests enabled without experimental")))
381 ;; ... and one package to test the package with "parallel-tests? #f"
382 (define-public gnunetgftn
388 (list (string-append "--with-nssdir=" %output "/lib")
389 "--enable-gcc-hardening"
390 "--enable-linker-hardening"
394 "--enable-experimental"
395 "--enable-logging=verbose"
396 "CFLAGS=-ggdb"); -O0")
397 #:parallel-tests? #f ; parallel building seems to fail
398 ;;#:tests? #f ; fail: test_gnunet_statistics.py
400 ;; swap check and install phases and set paths to installed bin
401 (modify-phases %standard-phases
402 (add-after 'unpack 'patch-bin-sh
404 (substitute* "bootstrap"
405 (("contrib/pogen.sh") "sh contrib/pogen.sh"))
406 (for-each (lambda (f) (chmod f #o755))
407 (find-files "po" ""))
409 (add-after 'patch-bin-sh 'bootstrap
411 (zero? (system* "sh" "bootstrap"))))
413 ;; XXX: https://gnunet.org/bugs/view.php?id=4619
414 (add-after 'install 'set-path-for-check
415 (lambda* (#:key outputs #:allow-other-keys)
416 (let* ((out (assoc-ref outputs "out"))
417 (bin (string-append out "/bin"))
418 (lib (string-append out "/lib")))
419 (setenv "GNUNET_PREFIX" lib)
420 (setenv "PATH" (string-append (getenv "PATH") ":" bin))
421 (zero? (system* "make" "check"))))))))))
423 (define-public gnunet-gtkg
424 (let* ((commit "087f8e166ee6d1fc59a6bd5d05f656528761ede7")
429 (version (package-version gnunetgf))
434 (url "https://gnunet.org/git/gnunet-gtk.git")
436 (file-name (string-append name "-" version "-checkout"))
439 "1k03d8l0yz4fpliy5bg5s7qkpidzd6ryr4cd63wgmd227p32i87q"))))
442 (list "--with-libunique"
444 (string-append "--with-gnunet="
445 (assoc-ref %build-inputs "gnunetgf")))
447 (modify-phases %standard-phases
448 (add-before 'configure 'bootstrap
450 (zero? (system* "autoreconf" "-vfi")))))))
452 `(("gnunetgf" ,gnunetgf)
453 ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
455 ("libgcrypt" ,libgcrypt)
457 ("libextractor" ,libextractor)
459 ("qrencode" ,qrencode)
460 ("libunique" ,libunique)))
462 `(("pkg-config" ,pkg-config)
463 ("libglade" ,libglade)
464 ("autoconf" ,autoconf)
465 ("gnu-gettext" ,gnu-gettext)
467 ("automake" ,automake)
468 ("libtool" ,libtool)))
469 (synopsis "Graphical front-end tools for GNUnet")
470 (home-page "https://gnunet.org"))))
472 ;; fuse, pointing to the tests disabled version of gnunet-git
473 (define-public gnunet-fuse-git
474 (let* ((commit "3503aeff6db6b39b85e13f9483d46d49ce9cec55")
479 (name "gnunet-fuse-git")
480 (version (package-version gnunetgf))
481 ;;(version (package-version gnunet))
486 (url "https://gnunet.org/git/gnunet-fuse.git")
488 (file-name (string-append name "-" version "-checkout"))
491 "0sxzppanw2nrjqv1vnyj2jx3ja6gqrg0ibkl5n1fr265cqk5hgc5"))))
494 (list "--with-qrencode"
495 (string-append "--with-gnunet="
496 (assoc-ref %build-inputs "gnunetgf"))) ;"gnunet")))
498 (modify-phases %standard-phases
499 (add-after 'unpack 'fix-gnunet-include-path
501 (substitute* "configure.ac"
502 (("gnunet/gnunet_util_lib.h")
503 "${lookin}/include/gnunet/gnunet_util_lib.h"))
505 (add-before 'configure 'bootstrap
507 (zero? (system* "autoreconf" "-vfi")))))))
509 `(("gnunetgf" ,gnunetgf)))
510 ;;`(("gnunet" ,gnunet)))
512 `(("pkg-config" ,pkg-config)
514 ("autoconf" ,autoconf)
515 ("gnu-gettext" ,gnu-gettext)
516 ("automake" ,automake)
517 ("libtool" ,libtool)))
518 (synopsis "FUSE for GNUnet")
519 (home-page "https://gnunet.org"))))