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 "3c3090717610ea787fdd3562901329254a6af0d6")
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 "0g0x1r833jkssfd2sndy37509dqf9f8myjvg7mnadwc1irp393bl"))))
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-give-me-the-noise"))))
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"
235 (install-file "gnunet-c-tutorial.pdf" doc)
236 (install-file "gnunet-c-tutorial.info" doc)
237 (copy-recursively "gnunet-c-tutorial"
239 "/gnunet-c-tutorial")))
241 (synopsis "GNUnet documentation")
243 "Gnunet-doc builds the documentation of GNUnet.")
244 (home-page "https://gnunet.org")
245 (license (package-license gnunet))))
247 (define-public gnunetgpg
252 `(("postgresql" ,postgresql)
253 ,@(package-inputs gnunetg)))
254 (synopsis "gnunet, variant with postgres")))
256 (define-public gnunetgf
261 `(("postgresql" ,postgresql)
263 ,@(package-inputs gnunetg)))
266 (list (string-append "--with-nssdir=" %output "/lib")
267 "--enable-gcc-hardening"
268 "--enable-linker-hardening"
272 "--enable-experimental"
273 "--enable-logging=verbose"
275 #:parallel-tests? #f ; parallel building is not supported.
276 ;;#:tests? #f ; fail: test_gnunet_statistics.py
278 ;; swap check and install phases and set paths to installed bin
279 (modify-phases %standard-phases
280 (add-after 'unpack 'patch-bin-sh
282 (substitute* "bootstrap"
283 (("contrib/pogen.sh") "sh contrib/pogen.sh"))
284 (for-each (lambda (f) (chmod f #o755))
285 (find-files "po" ""))
287 (add-after 'patch-bin-sh 'bootstrap
289 (zero? (system* "sh" "bootstrap"))))
291 (synopsis "gnunet, full git build without tests")))
293 ;; A package to run the test suite.
294 (define-public gnunetgft
300 (list (string-append "--with-nssdir=" %output "/lib")
301 "--enable-gcc-hardening"
302 "--enable-linker-hardening"
304 ;;"--enable-poisoning"
305 ;;"--enable-sanitizer"
306 "--enable-experimental"
307 "--enable-logging=verbose"
309 ;; #:parallel-tests? #f ; parallel building seems to fail
310 ;;#:tests? #f ; fail: test_gnunet_statistics.py
312 ;; swap check and install phases and set paths to installed bin
313 (modify-phases %standard-phases
314 (add-after 'unpack 'patch-bin-sh
316 (substitute* "bootstrap"
317 (("contrib/pogen.sh") "sh contrib/pogen.sh"))
318 (for-each (lambda (f) (chmod f #o755))
319 (find-files "po" ""))
321 (add-after 'patch-bin-sh 'bootstrap
323 (zero? (system* "sh" "bootstrap"))))
325 ;; XXX: https://gnunet.org/bugs/view.php?id=4619
326 (add-after 'install 'set-path-for-check
327 (lambda* (#:key outputs #:allow-other-keys)
328 (let* ((out (assoc-ref outputs "out"))
329 (bin (string-append out "/bin"))
330 (lib (string-append out "/lib")))
331 (setenv "GNUNET_PREFIX" lib)
332 (setenv "PATH" (string-append (getenv "PATH") ":" bin))
333 (zero? (system* "make" "check"))))))))
334 (synopsis "gnunet, full git with tests enabled with parallel tests")))
336 ;; ... and one package to test the package with "parallel-tests? #f"
337 (define-public gnunetgftn
343 (list (string-append "--with-nssdir=" %output "/lib")
344 "--enable-gcc-hardening"
345 "--enable-linker-hardening"
349 "--enable-experimental"
350 "--enable-logging=verbose"
351 "CFLAGS=-ggdb"); -O0")
352 #:parallel-tests? #f ; parallel building seems to fail
353 ;;#:tests? #f ; fail: test_gnunet_statistics.py
355 ;; swap check and install phases and set paths to installed bin
356 (modify-phases %standard-phases
357 (add-after 'unpack 'patch-bin-sh
359 (substitute* "bootstrap"
360 (("contrib/pogen.sh") "sh contrib/pogen.sh"))
361 (for-each (lambda (f) (chmod f #o755))
362 (find-files "po" ""))
364 (add-after 'patch-bin-sh 'bootstrap
366 (zero? (system* "sh" "bootstrap"))))
368 ;; XXX: https://gnunet.org/bugs/view.php?id=4619
369 (add-after 'install 'set-path-for-check
370 (lambda* (#:key outputs #:allow-other-keys)
371 (let* ((out (assoc-ref outputs "out"))
372 (bin (string-append out "/bin"))
373 (lib (string-append out "/lib")))
374 (setenv "GNUNET_PREFIX" lib)
375 (setenv "PATH" (string-append (getenv "PATH") ":" bin))
376 (zero? (system* "make" "check"))))))))))
378 (define-public gnunet-gtkg
379 (let* ((commit "087f8e166ee6d1fc59a6bd5d05f656528761ede7")
384 (version (package-version gnunetgf))
389 (url "https://gnunet.org/git/gnunet-gtk.git")
391 (file-name (string-append name "-" version "-checkout"))
394 "1k03d8l0yz4fpliy5bg5s7qkpidzd6ryr4cd63wgmd227p32i87q"))))
397 (list "--with-libunique"
399 (string-append "--with-gnunet="
400 (assoc-ref %build-inputs "gnunetgf")))
402 (modify-phases %standard-phases
403 (add-before 'configure 'bootstrap
405 (zero? (system* "autoreconf" "-vfi")))))))
407 `(("gnunetgf" ,gnunetgf)
408 ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
410 ("libgcrypt" ,libgcrypt)
412 ("libextractor" ,libextractor)
414 ("qrencode" ,qrencode)
415 ("libunique" ,libunique)))
417 `(("pkg-config" ,pkg-config)
418 ("libglade" ,libglade)
419 ("autoconf" ,autoconf)
420 ("gnu-gettext" ,gnu-gettext)
422 ("automake" ,automake)
423 ("libtool" ,libtool)))
424 (synopsis "Graphical front-end tools for GNUnet")
425 (home-page "https://gnunet.org"))))
427 ;; fuse, pointing to the tests disabled version of gnunet-git
428 (define-public gnunet-fuse-git
429 (let* ((commit "3503aeff6db6b39b85e13f9483d46d49ce9cec55")
434 (name "gnunet-fuse-git")
435 (version (package-version gnunetgf))
436 ;;(version (package-version gnunet))
441 (url "https://gnunet.org/git/gnunet-fuse.git")
443 (file-name (string-append name "-" version "-checkout"))
446 "0sxzppanw2nrjqv1vnyj2jx3ja6gqrg0ibkl5n1fr265cqk5hgc5"))))
449 (list "--with-qrencode"
450 (string-append "--with-gnunet="
451 (assoc-ref %build-inputs "gnunetgf"))) ;"gnunet")))
453 (modify-phases %standard-phases
454 (add-after 'unpack 'fix-gnunet-include-path
456 (substitute* "configure.ac"
457 (("gnunet/gnunet_util_lib.h")
458 "${lookin}/include/gnunet/gnunet_util_lib.h"))
460 (add-before 'configure 'bootstrap
462 (zero? (system* "autoreconf" "-vfi")))))))
464 `(("gnunetgf" ,gnunetgf)))
465 ;;`(("gnunet" ,gnunet)))
467 `(("pkg-config" ,pkg-config)
469 ("autoconf" ,autoconf)
470 ("gnu-gettext" ,gnu-gettext)
471 ("automake" ,automake)
472 ("libtool" ,libtool)))
473 (synopsis "FUSE for GNUnet")
474 (home-page "https://gnunet.org"))))