contrib: guix: Bump gnunet package commit.
[oweals/gnunet.git] / contrib / packages / guix / packages / gnunet / packages / gnunet.scm
1 ;;; This file is part of GNUnet.
2 ;;; Copyright (C) 2016, 2017 GNUnet e.V.
3 ;;;
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.
8 ;;;
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.
13 ;;;
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.
18
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))
59
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")
65          (revision "28"))
66     (package
67       (inherit gnunet)
68       (name "gnunetg")
69       (version (string-append "0.10.1" "-" revision
70                               "." (string-take commit 7)))
71       (source
72        (origin
73          (method git-fetch)
74          (uri (git-reference
75                (url "https://gnunet.org/git/gnunet.git")
76                (commit commit)))
77          (file-name (string-append name "-" version "-checkout"))
78          (sha256
79           (base32
80            "0sapap3y7bakmmbj5jijbp60xbmaqiliwcsk9qfgaz571wsccpy3"))))
81       (build-system gnu-build-system)
82       (inputs
83        `(("glpk" ,glpk)
84          ("gnurl" ,gnurl)
85          ("gstreamer" ,gstreamer)
86          ("gst-plugins-base" ,gst-plugins-base)
87          ("gnutls" ,gnutls)
88          ("libextractor" ,libextractor)
89          ("libgcrypt" ,libgcrypt)
90          ("libidn" ,libidn)
91          ("libmicrohttpd" ,libmicrohttpd)
92          ("libltdl" ,libltdl)
93          ("libunistring" ,libunistring)
94          ("openssl" ,openssl)
95          ("opus" ,opus)
96          ("pulseaudio" ,pulseaudio)
97          ("sqlite" ,sqlite)
98          ("zlib" ,zlib)
99          ("perl" ,perl)
100          ("python" ,python-2) ; tests and gnunet-qr
101          ("jansson" ,jansson)
102          ("ncurses" ,ncurses)
103          ("nss" ,nss)
104          ("gmp" ,gmp)
105          ("miniupnpc" ,miniupnpc)
106          ("bluez" ,bluez) ; for optional bluetooth feature
107          ("glib" ,glib)
108          ;; ("texlive-minimal" ,texlive-minimal) ; optional.
109          ("libogg" ,libogg)))
110       (native-inputs
111        `(("pkg-config" ,pkg-config)
112          ("autoconf" ,autoconf)
113          ("automake" ,automake)
114          ("gnu-gettext" ,gnu-gettext)
115          ("texinfo" ,texinfo)
116          ("libtool" ,libtool)))
117       (outputs '("out" "debug"))
118       (arguments
119        `(#:configure-flags
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
124          #:phases
125          ;; swap check and install phases and set paths to installed bin
126          (modify-phases %standard-phases
127            (add-after 'unpack 'patch-bin-sh
128              (lambda _
129                (substitute* "bootstrap"
130                  (("contrib/pogen.sh") "sh contrib/pogen.sh"))
131                (for-each (lambda (f) (chmod f #o755))
132                          (find-files "po" ""))
133              #t))
134            (add-after 'patch-bin-sh 'bootstrap
135              (lambda _
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
141            ;;   (lambda _
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"))))))))
162
163 (define-public gnunet-doc
164   (package
165     (name "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.
171     (inputs
172      `(("glpk" ,glpk)
173        ("gnurl" ,gnurl)
174        ("gstreamer" ,gstreamer)
175        ("gst-plugins-base" ,gst-plugins-base)
176        ("gnutls" ,gnutls)
177        ("libextractor" ,libextractor)
178        ("libgcrypt" ,libgcrypt)
179        ("libidn" ,libidn)
180        ("libmicrohttpd" ,libmicrohttpd)
181        ("libltdl" ,libltdl)
182        ("libunistring" ,libunistring)
183        ("openssl" ,openssl)
184        ("opus" ,opus)
185        ("pulseaudio" ,pulseaudio)
186        ("sqlite" ,sqlite)
187        ("zlib" ,zlib)
188        ("perl" ,perl)
189        ("python" ,python-2) ; tests and gnunet-qr
190        ("jansson" ,jansson)
191        ("ncurses" ,ncurses)
192        ("nss" ,nss)
193        ("gmp" ,gmp)
194        ("miniupnpc" ,miniupnpc)
195        ("bluez" ,bluez) ; for optional bluetooth feature
196        ("glib" ,glib)
197        ("texlive" ,texlive) ;TODO: Use a minimal subset.
198        ("libogg" ,libogg)))
199     (native-inputs
200      `(("pkg-config" ,pkg-config)
201        ("autoconf" ,autoconf)
202        ("automake" ,automake)
203        ("gnu-gettext" ,gnu-gettext)
204        ("texinfo" ,texinfo)
205        ("libtool" ,libtool)))
206     (arguments
207      `(#:tests? #f ;Don't run tests
208        #:phases
209        (modify-phases %standard-phases
210          (add-after 'unpack 'patch-bin-sh
211            (lambda _
212              (substitute* "bootstrap"
213                (("contrib/pogen.sh") "sh contrib/pogen.sh"))
214              (for-each (lambda (f) (chmod f #o755))
215                        (find-files "po" ""))
216              #t))
217          (add-after 'patch-bin-sh 'bootstrap
218            (lambda _
219              (zero? (system* "sh" "bootstrap"))))
220          (replace 'build
221            (lambda _
222              (chdir "doc")
223              (zero? (system* "make" "doc-all"))))
224          (replace 'install
225            (lambda* (#:key outputs #:allow-other-keys)
226              (let* ((out (assoc-ref outputs "out"))
227                     (doc (string-append out "/share/doc/gnunet")))
228                (mkdir-p doc)
229                (mkdir-p (string-append doc "/gnunet"))
230                (install-file "gnunet.pdf" doc)
231                (install-file "gnunet.info" doc)
232                (copy-recursively "gnunet"
233                                  (string-append doc
234                                                 "/gnunet")))
235              #t)))))
236     (synopsis "GNUnet documentation")
237     (description
238      "Gnunet-doc builds the documentation of GNUnet.")
239     (home-page "https://gnunet.org")
240     (license (package-license gnunet))))
241
242 (define-public gnunetgpg
243   (package
244     (inherit gnunetg)
245     (name "gnunetgpg")
246     (inputs
247      `(("postgresql" ,postgresql)
248        ,@(package-inputs gnunetg)))
249     (synopsis "gnunet, variant with postgres")))
250
251 (define-public gnunetgf
252   (package
253     (inherit gnunetg)
254     (name "gnunetgf")
255     (inputs
256      `(("postgresql" ,postgresql)
257        ("mysql" ,mysql)
258        ,@(package-inputs gnunetg)))
259     (arguments
260      `(#:configure-flags
261        (list (string-append "--with-nssdir=" %output "/lib")
262              "--enable-gcc-hardening"
263              "--enable-linker-hardening"
264
265              "--enable-poisoning"
266              "--enable-sanitizer"
267              "--enable-experimental"
268              "--enable-logging=verbose"
269              "CFLAGS=-ggdb -O0")
270        #:parallel-tests? #f ; parallel building is not supported.
271        ;;#:tests? #f ; fail: test_gnunet_statistics.py
272        #:phases
273        ;; swap check and install phases and set paths to installed bin
274        (modify-phases %standard-phases
275          (add-after 'unpack 'patch-bin-sh
276            (lambda _
277              (substitute* "bootstrap"
278                (("contrib/pogen.sh") "sh contrib/pogen.sh"))
279              (for-each (lambda (f) (chmod f #o755))
280                        (find-files "po" ""))
281              #t))
282          (add-after 'patch-bin-sh 'bootstrap
283            (lambda _
284              (zero? (system* "sh" "bootstrap"))))
285          (delete 'check))))
286     (synopsis "gnunet, full git build without tests")))
287
288 ;; A package to run the test suite.
289 (define-public gnunetgft
290   (package
291     (inherit gnunetg)
292     (name "gnunetgft")
293     (arguments
294      `(#:configure-flags
295        (list (string-append "--with-nssdir=" %output "/lib")
296              "--enable-gcc-hardening"
297              "--enable-linker-hardening"
298
299              ;;"--enable-poisoning"
300              ;;"--enable-sanitizer"
301              "--enable-experimental"
302              "--enable-logging=verbose"
303              "CFLAGS=-ggdb -O0")
304        ;; #:parallel-tests? #f ; parallel building seems to fail
305        ;;#:tests? #f ; fail: test_gnunet_statistics.py
306        #:phases
307        ;; swap check and install phases and set paths to installed bin
308        (modify-phases %standard-phases
309          (add-after 'unpack 'patch-bin-sh
310            (lambda _
311              (substitute* "bootstrap"
312                (("contrib/pogen.sh") "sh contrib/pogen.sh"))
313              (for-each (lambda (f) (chmod f #o755))
314                        (find-files "po" ""))
315              #t))
316          (add-after 'patch-bin-sh 'bootstrap
317            (lambda _
318              (zero? (system* "sh" "bootstrap"))))
319          (delete 'check)
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")))
330
331 ;; ... and one package to test the package with "parallel-tests? #f"
332 (define-public gnunetgftn
333   (package
334     (inherit gnunetg)
335     (name "gnunetgftn")
336     (arguments
337      `(#:configure-flags
338        (list (string-append "--with-nssdir=" %output "/lib")
339              "--enable-gcc-hardening"
340              "--enable-linker-hardening"
341
342              "--enable-poisoning"
343              "--enable-sanitizer"
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
349        #:phases
350        ;; swap check and install phases and set paths to installed bin
351        (modify-phases %standard-phases
352          (add-after 'unpack 'patch-bin-sh
353            (lambda _
354              (substitute* "bootstrap"
355                (("contrib/pogen.sh") "sh contrib/pogen.sh"))
356              (for-each (lambda (f) (chmod f #o755))
357                        (find-files "po" ""))
358              #t))
359          (add-after 'patch-bin-sh 'bootstrap
360            (lambda _
361              (zero? (system* "sh" "bootstrap"))))
362          (delete 'check)
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"))))))))))
372
373 (define-public gnunet-gtkg
374   (let* ((commit "087f8e166ee6d1fc59a6bd5d05f656528761ede7")
375          (revision "5"))
376     (package
377       (inherit gnunetgf)
378       (name "gnunet-gtkg")
379       (version (package-version gnunetgf))
380       (source
381        (origin
382          (method git-fetch)
383          (uri (git-reference
384                (url "https://gnunet.org/git/gnunet-gtk.git")
385                (commit commit)))
386          (file-name (string-append name "-" version "-checkout"))
387          (sha256
388           (base32
389             "1k03d8l0yz4fpliy5bg5s7qkpidzd6ryr4cd63wgmd227p32i87q"))))
390       (arguments
391        `(#:configure-flags
392          (list "--with-libunique"
393                "--with-qrencode"
394                (string-append "--with-gnunet="
395                               (assoc-ref %build-inputs "gnunetgf")))
396          #:phases
397          (modify-phases %standard-phases
398            (add-before 'configure 'bootstrap
399              (lambda _
400                (zero? (system* "autoreconf" "-vfi")))))))
401       (inputs
402        `(("gnunetgf" ,gnunetgf)
403          ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
404          ("gnutls" ,gnutls)
405          ("libgcrypt" ,libgcrypt)
406          ("gtk+" ,gtk+)
407          ("libextractor" ,libextractor)
408          ("glade3" ,glade3)
409          ("qrencode" ,qrencode)
410          ("libunique" ,libunique)))
411       (native-inputs
412        `(("pkg-config" ,pkg-config)
413          ("libglade" ,libglade)
414          ("autoconf" ,autoconf)
415          ("gnu-gettext" ,gnu-gettext)
416          ("texinfo" ,texinfo)
417          ("automake" ,automake)
418          ("libtool" ,libtool)))
419       (synopsis "Graphical front-end tools for GNUnet")
420       (home-page "https://gnunet.org"))))
421
422 ;; fuse, pointing to the tests disabled version of gnunet-git
423 (define-public gnunet-fuse-git
424   (let* ((commit "3503aeff6db6b39b85e13f9483d46d49ce9cec55")
425          (revision "3"))
426     (package
427       (inherit gnunetg)
428       ;;(inherit gnunet)
429       (name "gnunet-fuse-git")
430       (version (package-version gnunetgf))
431       ;;(version (package-version gnunet))
432       (source
433        (origin
434          (method git-fetch)
435          (uri (git-reference
436                (url "https://gnunet.org/git/gnunet-fuse.git")
437                (commit commit)))
438          (file-name (string-append name "-" version "-checkout"))
439          (sha256
440           (base32
441            "0sxzppanw2nrjqv1vnyj2jx3ja6gqrg0ibkl5n1fr265cqk5hgc5"))))
442       (arguments
443        `(#:configure-flags
444          (list "--with-qrencode"
445                (string-append "--with-gnunet="
446                               (assoc-ref %build-inputs "gnunetgf"))) ;"gnunet")))
447          #:phases
448          (modify-phases %standard-phases
449            (add-after 'unpack 'fix-gnunet-include-path
450              (lambda _
451                (substitute* "configure.ac"
452                  (("gnunet/gnunet_util_lib.h")
453                   "${lookin}/include/gnunet/gnunet_util_lib.h"))
454                #t))
455            (add-before 'configure 'bootstrap
456              (lambda _
457                (zero? (system* "autoreconf" "-vfi")))))))
458       (inputs
459        `(("gnunetgf" ,gnunetgf)))
460        ;;`(("gnunet" ,gnunet)))
461       (native-inputs
462        `(("pkg-config" ,pkg-config)
463          ("fuse" ,fuse)
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"))))