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 bison)
30 #:use-module (gnu packages compression)
31 #:use-module (gnu packages databases)
32 #:use-module (gnu packages gettext)
33 #:use-module (gnu packages glib)
34 #:use-module (gnu packages gnome)
35 #:use-module (gnu packages gnunet)
36 #:use-module (gnu packages gnupg)
37 #:use-module (gnu packages gnuzilla)
38 #:use-module (gnu packages gstreamer)
39 #:use-module (gnu packages gtk)
40 #:use-module (gnu packages libidn)
41 #:use-module (gnu packages libunistring)
42 #:use-module (gnu packages linux)
43 #:use-module (gnu packages man)
44 #:use-module (gnu packages image-viewers)
45 #:use-module (gnu packages maths)
46 #:use-module (gnu packages multiprecision)
47 #:use-module (gnu packages ncurses)
48 #:use-module (gnu packages pcre)
49 #:use-module (gnu packages perl)
50 #:use-module (gnu packages pkg-config)
51 #:use-module (gnu packages pulseaudio)
52 #:use-module (gnu packages python)
53 #:use-module (gnu packages tls)
54 #:use-module (gnu packages texinfo)
55 #:use-module (gnu packages tex)
56 #:use-module (gnu packages upnp)
57 #:use-module (gnu packages web)
58 #:use-module (gnu packages xiph))
60 ;; TODO: Use HEAD without checking sum of it.
61 ;; Explanation for name scheme: UNIXPATH is capped at 108 characters,
62 ;; this causes lots of tests to fail.
63 (define-public gnunetg
64 (let* ((commit "292cc51b35bcb727fa80b7c95730dae02e41a7d4")
69 (version (string-append "0.10.1" "-" revision
70 "." (string-take commit 7)))
75 (url "https://gnunet.org/git/gnunet.git")
77 (file-name (string-append name "-" version "-checkout"))
80 "0sapap3y7bakmmbj5jijbp60xbmaqiliwcsk9qfgaz571wsccpy3"))))
81 (build-system gnu-build-system)
85 ("gstreamer" ,gstreamer)
86 ("gst-plugins-base" ,gst-plugins-base)
88 ("libextractor" ,libextractor)
89 ("libgcrypt" ,libgcrypt)
91 ("libmicrohttpd" ,libmicrohttpd)
93 ("libunistring" ,libunistring)
96 ("pulseaudio" ,pulseaudio)
100 ("python" ,python-2) ; tests and gnunet-qr
105 ("miniupnpc" ,miniupnpc)
106 ("bluez" ,bluez) ; for optional bluetooth feature
108 ;; ("texlive-minimal" ,texlive-minimal) ; optional.
111 `(("pkg-config" ,pkg-config)
112 ("autoconf" ,autoconf)
113 ("automake" ,automake)
114 ("gnu-gettext" ,gnu-gettext)
116 ("libtool" ,libtool)))
117 (outputs '("out" "debug"))
120 (list (string-append "--with-nssdir=" %output "/lib")
121 "--enable-experimental")
122 #:parallel-tests? #f ; parallel building is not functional
123 #:tests? #f ; FAIL: test_gnunet_statistics.py
125 ;; swap check and install phases and set paths to installed bin
126 (modify-phases %standard-phases
127 (add-after 'unpack 'patch-bin-sh
129 (substitute* "bootstrap"
130 (("contrib/pogen.sh") "sh contrib/pogen.sh"))
131 (for-each (lambda (f) (chmod f #o755))
132 (find-files "po" ""))
134 (add-after 'patch-bin-sh 'bootstrap
136 (zero? (system* "sh" "bootstrap"))))
137 ;; DISABLED until failing testcases are fixed.
138 ;; this test fails in our environment, disable it:
139 ;; XXX: specify which ones fail.
140 ;; (add-after 'patch-bin-sh 'disable-test_quota_compliance_tcp_asymmetric
142 ;; (substitute* '("src/transport/Makefile.am")
143 ;; (("test_quota_compliance_tcp_asymmetric") ""))))
144 ;; (("test_quota_compliance_http_asymmetric") "")
145 ;; (("test_quota_compliance_https_asymmetric") "")
146 ;; (("test_quota_compliance_unix") "")
147 ;; (("test_quota_compliance_unix_asymmetric") ""))))
148 ;; check is between build and install, fix this to:
149 ;; build - install - check, else the test suite fails.
150 (delete 'check)))))))
151 ;; (add-after 'install 'set-path-for-check
152 ;; (lambda* (#:key outputs #:allow-other-keys)
153 ;; (let* ((out (assoc-ref outputs "out"))
154 ;; (bin (string-append out "/bin"))
155 ;; (lib (string-append out "/lib")))
156 ;; (setenv "GNUNET_PREFIX" lib)
157 ;; (setenv "PATH" (string-append (getenv "PATH") ":" bin))
158 ;; ;; XXX: https://gnunet.org/bugs/view.php?id=4619#c11061
159 ;; ;; Enable core dump before the tests.
160 ;; ;; XXX: HOW??? ulimit -c unlimited
161 ;; (zero? (system* "make" "check"))))))))
163 (define-public gnunet-doc
166 (version (package-version gnunetg))
167 (source (package-source gnunetg))
168 (build-system gnu-build-system)
169 ;; FIXME: Introduce DOCS_ONLY option for configure script.
170 ;; This should prevent the checks for all required software.
174 ("gstreamer" ,gstreamer)
175 ("gst-plugins-base" ,gst-plugins-base)
177 ("libextractor" ,libextractor)
178 ("libgcrypt" ,libgcrypt)
180 ("libmicrohttpd" ,libmicrohttpd)
182 ("libunistring" ,libunistring)
185 ("pulseaudio" ,pulseaudio)
189 ("python" ,python-2) ; tests and gnunet-qr
194 ("miniupnpc" ,miniupnpc)
195 ("bluez" ,bluez) ; for optional bluetooth feature
197 ("texlive" ,texlive) ;TODO: Use a minimal subset.
200 `(("pkg-config" ,pkg-config)
201 ("autoconf" ,autoconf)
202 ("automake" ,automake)
203 ("gnu-gettext" ,gnu-gettext)
205 ("libtool" ,libtool)))
207 `(#:tests? #f ;Don't run tests
209 (modify-phases %standard-phases
210 (add-after 'unpack 'patch-bin-sh
212 (substitute* "bootstrap"
213 (("contrib/pogen.sh") "sh contrib/pogen.sh"))
214 (for-each (lambda (f) (chmod f #o755))
215 (find-files "po" ""))
217 (add-after 'patch-bin-sh 'bootstrap
219 (zero? (system* "sh" "bootstrap"))))
223 (zero? (system* "make" "doc-all"))))
225 (lambda* (#:key outputs #:allow-other-keys)
226 (let* ((out (assoc-ref outputs "out"))
227 (doc (string-append out "/share/doc/gnunet")))
229 (mkdir-p (string-append doc "/gnunet"))
230 (install-file "gnunet.pdf" doc)
231 (install-file "gnunet.info" doc)
232 (copy-recursively "gnunet"
236 (synopsis "GNUnet documentation")
238 "Gnunet-doc builds the documentation of GNUnet.")
239 (home-page "https://gnunet.org")
240 (license (package-license gnunet))))
242 (define-public gnunetgpg
247 `(("postgresql" ,postgresql)
248 ,@(package-inputs gnunetg)))
249 (synopsis "gnunet, variant with postgres")))
251 (define-public gnunetgf
256 `(("postgresql" ,postgresql)
258 ,@(package-inputs gnunetg)))
261 (list (string-append "--with-nssdir=" %output "/lib")
262 "--enable-gcc-hardening"
263 "--enable-linker-hardening"
267 "--enable-experimental"
268 "--enable-logging=verbose"
270 #:parallel-tests? #f ; parallel building is not supported.
271 ;;#:tests? #f ; fail: test_gnunet_statistics.py
273 ;; swap check and install phases and set paths to installed bin
274 (modify-phases %standard-phases
275 (add-after 'unpack 'patch-bin-sh
277 (substitute* "bootstrap"
278 (("contrib/pogen.sh") "sh contrib/pogen.sh"))
279 (for-each (lambda (f) (chmod f #o755))
280 (find-files "po" ""))
282 (add-after 'patch-bin-sh 'bootstrap
284 (zero? (system* "sh" "bootstrap"))))
286 (synopsis "gnunet, full git build without tests")))
288 ;; A package to run the test suite.
289 (define-public gnunetgft
295 (list (string-append "--with-nssdir=" %output "/lib")
296 "--enable-gcc-hardening"
297 "--enable-linker-hardening"
299 ;;"--enable-poisoning"
300 ;;"--enable-sanitizer"
301 "--enable-experimental"
302 "--enable-logging=verbose"
304 ;; #:parallel-tests? #f ; parallel building seems to fail
305 ;;#:tests? #f ; fail: test_gnunet_statistics.py
307 ;; swap check and install phases and set paths to installed bin
308 (modify-phases %standard-phases
309 (add-after 'unpack 'patch-bin-sh
311 (substitute* "bootstrap"
312 (("contrib/pogen.sh") "sh contrib/pogen.sh"))
313 (for-each (lambda (f) (chmod f #o755))
314 (find-files "po" ""))
316 (add-after 'patch-bin-sh 'bootstrap
318 (zero? (system* "sh" "bootstrap"))))
320 ;; XXX: https://gnunet.org/bugs/view.php?id=4619
321 (add-after 'install 'set-path-for-check
322 (lambda* (#:key outputs #:allow-other-keys)
323 (let* ((out (assoc-ref outputs "out"))
324 (bin (string-append out "/bin"))
325 (lib (string-append out "/lib")))
326 (setenv "GNUNET_PREFIX" lib)
327 (setenv "PATH" (string-append (getenv "PATH") ":" bin))
328 (zero? (system* "make" "check"))))))))
329 (synopsis "gnunet, full git with tests enabled with parallel tests")))
331 ;; ... and one package to test the package with "parallel-tests? #f"
332 (define-public gnunetgftn
338 (list (string-append "--with-nssdir=" %output "/lib")
339 "--enable-gcc-hardening"
340 "--enable-linker-hardening"
344 "--enable-experimental"
345 "--enable-logging=verbose"
346 "CFLAGS=-ggdb"); -O0")
347 #:parallel-tests? #f ; parallel building seems to fail
348 ;;#:tests? #f ; fail: test_gnunet_statistics.py
350 ;; swap check and install phases and set paths to installed bin
351 (modify-phases %standard-phases
352 (add-after 'unpack 'patch-bin-sh
354 (substitute* "bootstrap"
355 (("contrib/pogen.sh") "sh contrib/pogen.sh"))
356 (for-each (lambda (f) (chmod f #o755))
357 (find-files "po" ""))
359 (add-after 'patch-bin-sh 'bootstrap
361 (zero? (system* "sh" "bootstrap"))))
363 ;; XXX: https://gnunet.org/bugs/view.php?id=4619
364 (add-after 'install 'set-path-for-check
365 (lambda* (#:key outputs #:allow-other-keys)
366 (let* ((out (assoc-ref outputs "out"))
367 (bin (string-append out "/bin"))
368 (lib (string-append out "/lib")))
369 (setenv "GNUNET_PREFIX" lib)
370 (setenv "PATH" (string-append (getenv "PATH") ":" bin))
371 (zero? (system* "make" "check"))))))))))
373 (define-public gnunet-gtkg
374 (let* ((commit "087f8e166ee6d1fc59a6bd5d05f656528761ede7")
379 (version (package-version gnunetgf))
384 (url "https://gnunet.org/git/gnunet-gtk.git")
386 (file-name (string-append name "-" version "-checkout"))
389 "1k03d8l0yz4fpliy5bg5s7qkpidzd6ryr4cd63wgmd227p32i87q"))))
392 (list "--with-libunique"
394 (string-append "--with-gnunet="
395 (assoc-ref %build-inputs "gnunetgf")))
397 (modify-phases %standard-phases
398 (add-before 'configure 'bootstrap
400 (zero? (system* "autoreconf" "-vfi")))))))
402 `(("gnunetgf" ,gnunetgf)
403 ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
405 ("libgcrypt" ,libgcrypt)
407 ("libextractor" ,libextractor)
409 ("qrencode" ,qrencode)
410 ("libunique" ,libunique)))
412 `(("pkg-config" ,pkg-config)
413 ("libglade" ,libglade)
414 ("autoconf" ,autoconf)
415 ("gnu-gettext" ,gnu-gettext)
417 ("automake" ,automake)
418 ("libtool" ,libtool)))
419 (synopsis "Graphical front-end tools for GNUnet")
420 (home-page "https://gnunet.org"))))
422 ;; fuse, pointing to the tests disabled version of gnunet-git
423 (define-public gnunet-fuse-git
424 (let* ((commit "3503aeff6db6b39b85e13f9483d46d49ce9cec55")
429 (name "gnunet-fuse-git")
430 (version (package-version gnunetgf))
431 ;;(version (package-version gnunet))
436 (url "https://gnunet.org/git/gnunet-fuse.git")
438 (file-name (string-append name "-" version "-checkout"))
441 "0sxzppanw2nrjqv1vnyj2jx3ja6gqrg0ibkl5n1fr265cqk5hgc5"))))
444 (list "--with-qrencode"
445 (string-append "--with-gnunet="
446 (assoc-ref %build-inputs "gnunetgf"))) ;"gnunet")))
448 (modify-phases %standard-phases
449 (add-after 'unpack 'fix-gnunet-include-path
451 (substitute* "configure.ac"
452 (("gnunet/gnunet_util_lib.h")
453 "${lookin}/include/gnunet/gnunet_util_lib.h"))
455 (add-before 'configure 'bootstrap
457 (zero? (system* "autoreconf" "-vfi")))))))
459 `(("gnunetgf" ,gnunetgf)))
460 ;;`(("gnunet" ,gnunet)))
462 `(("pkg-config" ,pkg-config)
464 ("autoconf" ,autoconf)
465 ("gnu-gettext" ,gnu-gettext)
466 ("automake" ,automake)
467 ("libtool" ,libtool)))
468 (synopsis "FUSE for GNUnet")
469 (home-page "https://gnunet.org"))))