aboutsummaryrefslogtreecommitdiff
path: root/contrib/packages/guix/packages/gnunet/packages/gnunet.scm
blob: 5747143509a3fec890dcec46c6b40dfe596c10fa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
;;; This file is part of GNUnet.
;;; Copyright (C) 2016, 2017 GNUnet e.V.
;;;
;;; GNUnet is free software; you can redistribute it and/or modify
;;; it under the terms of the GNU General Public License as published
;;; by the Free Software Foundation; either version 3, or (at your
;;; option) any later version.
;;;
;;; GNUnet is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
;;; General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNUnet; see the file COPYING.  If not, write to the
;;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
;;; Boston, MA 02110-1301, USA.

(define-module (gnunet packages gnunet)
  #:use-module (guix build-system gnu)
  #:use-module (guix download)
  #:use-module (guix git-download)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix packages)
  #:use-module (gnu packages)
  #:use-module (gnu packages admin)
  #:use-module (gnu packages aidc)
  #:use-module (gnu packages autotools)
  #:use-module (gnu packages bison)
  #:use-module (gnu packages compression)
  #:use-module (gnu packages databases)
  #:use-module (gnu packages gettext)
  #:use-module (gnu packages glib)
  #:use-module (gnu packages gnome)
  #:use-module (gnu packages gnunet)
  #:use-module (gnu packages gnupg)
  #:use-module (gnu packages gnuzilla)
  #:use-module (gnu packages gstreamer)
  #:use-module (gnu packages gtk)
  #:use-module (gnu packages libidn)
  #:use-module (gnu packages libunistring)
  #:use-module (gnu packages linux)
  #:use-module (gnu packages man)
  #:use-module (gnu packages image-viewers)
  #:use-module (gnu packages maths)
  #:use-module (gnu packages multiprecision)
  #:use-module (gnu packages ncurses)
  #:use-module (gnu packages pcre)
  #:use-module (gnu packages perl)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages pulseaudio)
  #:use-module (gnu packages python)
  #:use-module (gnu packages tls)
  #:use-module (gnu packages texinfo)
  #:use-module (gnu packages upnp)
  #:use-module (gnu packages web)
  #:use-module (gnu packages xiph))

;; TODO: Use HEAD without checking sum of it.
;; Explanation for name scheme: UNIXPATH is capped at 108 characters,
;; this causes lots of tests to fail.
(define-public gnunetg
  (let* ((commit "e834a115d6a4f54722b494fcaaa14d1e5f6f36b6")
         (revision "23"))
    (package
      (inherit gnunet)
      (name "gnunetg")
      (version (string-append "0.10.1" "-" revision
                              "." (string-take commit 7)))
      (source
       (origin
         (method git-fetch)
         (uri (git-reference
               (url "https://gnunet.org/git/gnunet.git")
               (commit commit)))
         (file-name (string-append name "-" version "-checkout"))
         (sha256
          (base32
           "0paxbk19jaxbc8vm5w0y5s6lgmc6n0y0c8j1b20qdrlyaq5jxqzr"))))
      (build-system gnu-build-system)
      (inputs
       `(("glpk" ,glpk)
         ("gnurl" ,gnurl)
         ("gstreamer" ,gstreamer)
         ("gst-plugins-base" ,gst-plugins-base)
         ("gnutls" ,gnutls)
         ("libextractor" ,libextractor)
         ("libgcrypt" ,libgcrypt)
         ("libidn" ,libidn)
         ("libmicrohttpd" ,libmicrohttpd)
         ("libltdl" ,libltdl)
         ("libunistring" ,libunistring)
         ("openssl" ,openssl)
         ("opus" ,opus)
         ("pulseaudio" ,pulseaudio)
         ("sqlite" ,sqlite)
         ("zlib" ,zlib)
         ("perl" ,perl)
         ("python" ,python-2) ; tests and gnunet-qr
         ("jansson" ,jansson)
         ("ncurses" ,ncurses)
         ("nss" ,nss)
         ("gmp" ,gmp)
         ("miniupnpc" ,miniupnpc)
         ("bluez" ,bluez) ; for optional bluetooth feature
         ("glib" ,glib)
         ;; ("texlive-minimal" ,texlive-minimal) ; optional.
         ("libogg" ,libogg)))
      (native-inputs
       `(("pkg-config" ,pkg-config)
         ("autoconf" ,autoconf)
         ("automake" ,automake)
         ("gnu-gettext" ,gnu-gettext)
         ("texinfo" ,texinfo)
         ("libtool" ,libtool)))
      (outputs '("out" "debug"))
      (arguments
       `(#:configure-flags
         (list (string-append "--with-nssdir=" %output "/lib")
               "--enable-experimental")
         #:parallel-tests? #f ; parallel building is not functional
         #:tests? #f ; FAIL: test_gnunet_statistics.py
         #:phases
         ;; swap check and install phases and set paths to installed bin
         (modify-phases %standard-phases
           (add-after 'unpack 'patch-bin-sh
             (lambda _
               (substitute* "bootstrap"
                 (("contrib/pogen.sh") "sh contrib/pogen.sh"))
               (for-each (lambda (f) (chmod f #o755))
                         (find-files "po" ""))
             #t))
           (add-after 'patch-bin-sh 'bootstrap
             (lambda _
               (zero? (system* "sh" "bootstrap"))))
           ;; DISABLED until failing testcases are fixed.
           ;; this test fails in our environment, disable it:
           ;; XXX: specify which ones fail.
           ;; (add-after 'patch-bin-sh 'disable-test_quota_compliance_tcp_asymmetric
           ;;   (lambda _
           ;;     (substitute* '("src/transport/Makefile.am")
           ;;       (("test_quota_compliance_tcp_asymmetric") ""))))
           ;;       (("test_quota_compliance_http_asymmetric") "")
           ;;       (("test_quota_compliance_https_asymmetric") "")
           ;;       (("test_quota_compliance_unix") "")
           ;;       (("test_quota_compliance_unix_asymmetric") ""))))
           ;; check is between build and install, fix this to:
           ;; build - install - check, else the test suite fails.
           (delete 'check)))))))
           ;; (add-after 'install 'set-path-for-check
           ;;   (lambda* (#:key outputs #:allow-other-keys)
           ;;     (let* ((out (assoc-ref outputs "out"))
           ;;            (bin (string-append out "/bin"))
           ;;            (lib (string-append out "/lib")))
           ;;       (setenv "GNUNET_PREFIX" lib)
           ;;       (setenv "PATH" (string-append (getenv "PATH") ":" bin))
           ;;       ;; XXX: https://gnunet.org/bugs/view.php?id=4619#c11061
           ;;       ;; Enable core dump before the tests.
           ;;       ;; XXX: HOW??? ulimit -c unlimited
           ;;       (zero? (system* "make" "check"))))))))

(define-public gnunetgpg
  (package
    (inherit gnunetg)
    (name "gnunetgpg")
    (inputs
     `(("postgresql" ,postgresql)
       ,@(package-inputs gnunetg)))
    (synopsis "gnunet, variant with postgres")))

(define-public gnunetgf
  (package
    (inherit gnunetg)
    (name "gnunetgf")
    (inputs
     `(("postgresql" ,postgresql)
       ("mysql" ,mysql)
       ,@(package-inputs gnunetg)))
    (arguments
     `(#:configure-flags
       (list (string-append "--with-nssdir=" %output "/lib")
             "--enable-gcc-hardening"
             "--enable-linker-hardening"

             "--enable-poisoning"
             "--enable-sanitizer"
             "--enable-experimental"
             "--enable-logging=verbose"
             "CFLAGS=-ggdb -O0")
       #:parallel-tests? #f ; parallel building is not supported.
       ;;#:tests? #f ; fail: test_gnunet_statistics.py
       #:phases
       ;; swap check and install phases and set paths to installed bin
       (modify-phases %standard-phases
         (add-after 'unpack 'patch-bin-sh
           (lambda _
             (substitute* "bootstrap"
               (("contrib/pogen.sh") "sh contrib/pogen.sh"))
             (for-each (lambda (f) (chmod f #o755))
                       (find-files "po" ""))
             #t))
         (add-after 'patch-bin-sh 'bootstrap
           (lambda _
             (zero? (system* "sh" "bootstrap"))))
         (delete 'check))))
    (synopsis "gnunet, full git build without tests")))

;; A package to run the test suite.
(define-public gnunetgft
  (package
    (inherit gnunetg)
    (name "gnunetgft")
    (arguments
     `(#:configure-flags
       (list (string-append "--with-nssdir=" %output "/lib")
             "--enable-gcc-hardening"
             "--enable-linker-hardening"

             ;;"--enable-poisoning"
             ;;"--enable-sanitizer"
             "--enable-experimental"
             "--enable-logging=verbose"
             "CFLAGS=-ggdb -O0")
       ;; #:parallel-tests? #f ; parallel building seems to fail
       ;;#:tests? #f ; fail: test_gnunet_statistics.py
       #:phases
       ;; swap check and install phases and set paths to installed bin
       (modify-phases %standard-phases
         (add-after 'unpack 'patch-bin-sh
           (lambda _
             (substitute* "bootstrap"
               (("contrib/pogen.sh") "sh contrib/pogen.sh"))
             (for-each (lambda (f) (chmod f #o755))
                       (find-files "po" ""))
             #t))
         (add-after 'patch-bin-sh 'bootstrap
           (lambda _
             (zero? (system* "sh" "bootstrap"))))
         (delete 'check)
         ;; XXX: https://gnunet.org/bugs/view.php?id=4619
         (add-after 'install 'set-path-for-check
           (lambda* (#:key outputs #:allow-other-keys)
             (let* ((out (assoc-ref outputs "out"))
                    (bin (string-append out "/bin"))
                    (lib (string-append out "/lib")))
               (setenv "GNUNET_PREFIX" lib)
               (setenv "PATH" (string-append (getenv "PATH") ":" bin))
               (zero? (system* "make" "check"))))))))
    (synopsis "gnunet, full git with tests enabled with parallel tests")))

;; ... and one package to test the package with "parallel-tests? #f"
(define-public gnunetgftn
  (package
    (inherit gnunetg)
    (name "gnunetgftn")
    (arguments
     `(#:configure-flags
       (list (string-append "--with-nssdir=" %output "/lib")
             "--enable-gcc-hardening"
             "--enable-linker-hardening"

             "--enable-poisoning"
             "--enable-sanitizer"
             "--enable-experimental"
             "--enable-logging=verbose"
             "CFLAGS=-ggdb"); -O0")
       #:parallel-tests? #f ; parallel building seems to fail
       ;;#:tests? #f ; fail: test_gnunet_statistics.py
       #:phases
       ;; swap check and install phases and set paths to installed bin
       (modify-phases %standard-phases
         (add-after 'unpack 'patch-bin-sh
           (lambda _
             (substitute* "bootstrap"
               (("contrib/pogen.sh") "sh contrib/pogen.sh"))
             (for-each (lambda (f) (chmod f #o755))
                       (find-files "po" ""))
             #t))
         (add-after 'patch-bin-sh 'bootstrap
           (lambda _
             (zero? (system* "sh" "bootstrap"))))
         (delete 'check)
         ;; XXX: https://gnunet.org/bugs/view.php?id=4619
         (add-after 'install 'set-path-for-check
           (lambda* (#:key outputs #:allow-other-keys)
             (let* ((out (assoc-ref outputs "out"))
                    (bin (string-append out "/bin"))
                    (lib (string-append out "/lib")))
               (setenv "GNUNET_PREFIX" lib)
               (setenv "PATH" (string-append (getenv "PATH") ":" bin))
               (zero? (system* "make" "check"))))))))))

(define-public gnunet-gtkg
  (let* ((commit "087f8e166ee6d1fc59a6bd5d05f656528761ede7")
         (revision "5"))
    (package
      (inherit gnunetgf)
      (name "gnunet-gtkg")
      (version (package-version gnunetgf))
      (source
       (origin
         (method git-fetch)
         (uri (git-reference
               (url "https://gnunet.org/git/gnunet-gtk.git")
               (commit commit)))
         (file-name (string-append name "-" version "-checkout"))
         (sha256
          (base32
            "1k03d8l0yz4fpliy5bg5s7qkpidzd6ryr4cd63wgmd227p32i87q"))))
      (arguments
       `(#:configure-flags
         (list "--with-libunique"
               "--with-qrencode"
               (string-append "--with-gnunet="
                              (assoc-ref %build-inputs "gnunetgf")))
         #:phases
         (modify-phases %standard-phases
           (add-before 'configure 'bootstrap
             (lambda _
               (zero? (system* "autoreconf" "-vfi")))))))
      (inputs
       `(("gnunetgf" ,gnunetgf)
         ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
         ("gnutls" ,gnutls)
         ("libgcrypt" ,libgcrypt)
         ("gtk+" ,gtk+)
         ("libextractor" ,libextractor)
         ("glade3" ,glade3)
         ("qrencode" ,qrencode)
         ("libunique" ,libunique)))
      (native-inputs
       `(("pkg-config" ,pkg-config)
         ("libglade" ,libglade)
         ("autoconf" ,autoconf)
         ("gnu-gettext" ,gnu-gettext)
         ("texinfo" ,texinfo)
         ("automake" ,automake)
         ("libtool" ,libtool)))
      (synopsis "Graphical front-end tools for GNUnet")
      (home-page "https://gnunet.org"))))

;; fuse, pointing to the tests disabled version of gnunet-git
(define-public gnunet-fuse-git
  (let* ((commit "3503aeff6db6b39b85e13f9483d46d49ce9cec55")
         (revision "3"))
    (package
      (inherit gnunetg)
      ;;(inherit gnunet)
      (name "gnunet-fuse-git")
      (version (package-version gnunetgf))
      ;;(version (package-version gnunet))
      (source
       (origin
         (method git-fetch)
         (uri (git-reference
               (url "https://gnunet.org/git/gnunet-fuse.git")
               (commit commit)))
         (file-name (string-append name "-" version "-checkout"))
         (sha256
          (base32
           "0sxzppanw2nrjqv1vnyj2jx3ja6gqrg0ibkl5n1fr265cqk5hgc5"))))
      (arguments
       `(#:configure-flags
         (list "--with-qrencode"
               (string-append "--with-gnunet="
                              (assoc-ref %build-inputs "gnunetgf"))) ;"gnunet")))
         #:phases
         (modify-phases %standard-phases
           (add-after 'unpack 'fix-gnunet-include-path
             (lambda _
               (substitute* "configure.ac"
                 (("gnunet/gnunet_util_lib.h")
                  "${lookin}/include/gnunet/gnunet_util_lib.h"))
               #t))
           (add-before 'configure 'bootstrap
             (lambda _
               (zero? (system* "autoreconf" "-vfi")))))))
      (inputs
       `(("gnunetgf" ,gnunetgf)))
       ;;`(("gnunet" ,gnunet)))
      (native-inputs
       `(("pkg-config" ,pkg-config)
         ("fuse" ,fuse)
         ("autoconf" ,autoconf)
         ("gnu-gettext" ,gnu-gettext)
         ("automake" ,automake)
         ("libtool" ,libtool)))
      (synopsis "FUSE for GNUnet")
      (home-page "https://gnunet.org"))))