aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--contrib/packages/guix/README64
-rw-r--r--contrib/packages/guix/gnunet-doc.scm183
-rw-r--r--contrib/packages/guix/guix-env.scm210
-rw-r--r--contrib/packages/guix/packages/gnunet/packages/gnunet.scm519
-rw-r--r--contrib/packages/guix/packages/gnunet/packages/texlive.scm182
-rw-r--r--doc/documentation/chapters/developer.texi15
-rw-r--r--guix-env.scm (renamed from contrib/packages/guix/gnunet.scm)31
-rw-r--r--guix.packages44
-rw-r--r--src/cadet/gnunet-service-cadet_peer.c10
-rw-r--r--src/fs/gnunet-service-fs_cp.c4
-rw-r--r--src/gns/gnunet-gns-proxy.c19
-rw-r--r--src/identity/plugin_rest_identity.c3
-rw-r--r--src/include/gnunet_crypto_lib.h2
-rw-r--r--src/rest/gnunet-rest-server.c49
-rw-r--r--src/rps/test_rps.c74
-rw-r--r--src/util/scheduler.c105
16 files changed, 235 insertions, 1279 deletions
diff --git a/contrib/packages/guix/README b/contrib/packages/guix/README
deleted file mode 100644
index 635c92394..000000000
--- a/contrib/packages/guix/README
+++ /dev/null
@@ -1,64 +0,0 @@
1package definitions for GNU Guix
2---------------------------------
3
4About
5-----
6
7This directory contains various files to work with GNUnet using Guix:
8
9* A folder intended to be used with GUIX_PACKAGE_PATH ("packages")
10* gnunet-doc.scm: A file to ease the building of the docgen script output
11* gnunet.scm: A file to build gnunet with all tests
12* guix-env.scm
13
14The workflow has to be documented and will make its way into the GNUnet
15Documentation eventually. For now, all uses of guix environment, guix package,
16etc apply.
17Example invocation:
18 guix environment --ad-hoc --container --network --fallback -K -l contrib/packages/guix/gnunet.scm
19which is worth improving, but essentially takes you into an container environment
20with gnunet from HEAD, under the condition that it builds. This won't include an editor,
21so you want to run
22 guix environment --ad-hoc emacs --container --network --fallback -K -l contrib/packages/guix/gnunet.scm
23(untested). You get the idea that this folder is a historical mess and should be cleaned up
24and properly documented.
25
26Usage
27-----
28
29Just point Guix towards the root of this source tree.
30Assuming that your gnunet checkout is in $HOME/src/gnunet:
31
32 export GUIX_PACKAGE_PATH=$HOME/src/gnunet/contrib/packages/guix/packages
33
34or (if you are in the root of the gnunet git repository):
35
36 guix package -L contrib/packages/guix/packages -i package-name
37
38The packages in this repository will take precedence over those in the
39official distribution.
40
41
42To make use of the packages in your GuixSD config file:
43
44Be sure to have GUIX_PACKAGE_PATH for your shell exported,
45for Bash this could be achieved like this:
46
47 export GUIX_PACKAGE_PATH="/full/path/to/gnunet/contrib/packages/guix/directory"
48
49In the section of your systems "config.scm", you should find something like this:
50
51 (use-modules (gnu) (gnu system nss))
52
53Now to make use of "gnunetg" as an systemwide installed package we change this
54to:
55
56 (use-modules (gnu) (gnu system nss)
57 (gnunet packages gnunet))
58
59and do the usual thing:
60 - save
61 - guix system build /etc/config.scm
62 - sudo -E guix system reconfigure /etc/config.scm
63
64The "-E" in "sudo -E" is important to keep the environment variables (GUIX_PACKAGE_PATH).
diff --git a/contrib/packages/guix/gnunet-doc.scm b/contrib/packages/guix/gnunet-doc.scm
deleted file mode 100644
index 69dd90e14..000000000
--- a/contrib/packages/guix/gnunet-doc.scm
+++ /dev/null
@@ -1,183 +0,0 @@
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
20(use-modules
21 (ice-9 popen)
22 (ice-9 match)
23 (ice-9 rdelim)
24 (guix packages)
25 (guix build-system gnu)
26 (guix gexp)
27 ((guix build utils) #:select (with-directory-excursion))
28 (guix git-download)
29 (guix utils) ; current-source-directory
30 (gnu packages)
31 (gnu packages aidc)
32 (gnu packages autotools)
33 (gnu packages backup)
34 (gnu packages base)
35 (gnu packages compression)
36 (gnu packages curl)
37 (gnu packages databases)
38 (gnu packages file)
39 (gnu packages gettext)
40 (gnu packages glib)
41 (gnu packages gnome)
42 (gnu packages gnunet)
43 (gnu packages gnupg)
44 (gnu packages gnuzilla)
45 (gnu packages groff)
46 (gnu packages gstreamer)
47 (gnu packages gtk)
48 (gnu packages guile)
49 (gnu packages graphviz)
50 (gnu packages image)
51 (gnu packages image-viewers)
52 (gnu packages libidn)
53 (gnu packages libunistring)
54 (gnu packages linux)
55 (gnu packages maths)
56 (gnu packages multiprecision)
57 (gnu packages perl)
58 (gnu packages pkg-config)
59 (gnu packages pulseaudio)
60 (gnu packages python)
61 (gnu packages tex)
62 (gnu packages texinfo)
63 (gnu packages tex)
64 (gnu packages tls)
65 (gnu packages video)
66 (gnu packages web)
67 (gnu packages xiph)
68 ;;(gnunet packages texlive) ;GNUnet module including texlive-2012 WIP
69 ((guix licenses) #:prefix license:))
70
71(define %source-dir (string-append (current-source-directory)
72 "/../../../"))
73
74(define gnunet-doc
75 (let* ((revision "2")
76 (select? (delay (or (git-predicate
77 (string-append (current-source-directory)
78 "/../../../"))
79 source-file?))))
80 (package
81 (name "gnunet-doc")
82 (version (string-append "0.10.1-" revision "." "dev"))
83 (source
84 (local-file ;;"../../.."
85 ;;%source-dir
86 ;;(string-append (getcwd) "/../../../")
87 (string-append (getcwd)) ;drrty hack and this assumes one static position FIXME!
88 #:recursive? #t))
89 ;;#:select? (git-predicate %source-dir)))
90 ;;#:select? (force select?)))
91 (build-system gnu-build-system)
92 (inputs
93 `(("glpk" ,glpk)
94 ("gnurl" ,gnurl)
95 ("gstreamer" ,gstreamer)
96 ("gst-plugins-base" ,gst-plugins-base)
97 ("gnutls/dane" ,gnutls/dane)
98 ("libextractor" ,libextractor)
99 ("libgcrypt" ,libgcrypt)
100 ("libidn" ,libidn)
101 ("libmicrohttpd" ,libmicrohttpd)
102 ("libltdl" ,libltdl)
103 ("libunistring" ,libunistring)
104 ("openssl" ,openssl)
105 ("opus" ,opus)
106 ("pulseaudio" ,pulseaudio)
107 ("sqlite" ,sqlite)
108 ("postgresql" ,postgresql)
109 ("mysql" ,mysql)
110 ("zlib" ,zlib)
111 ("perl" ,perl)
112 ("python-2" ,python-2) ; tests and gnunet-qr
113 ("jansson" ,jansson)
114 ("nss" ,nss)
115 ("glib" ,glib "bin")
116 ("gmp" ,gmp)
117 ("bluez" ,bluez) ; for optional bluetooth feature
118 ("glib" ,glib)
119 ;;("texlive-minimal" ,texlive-minimal) ; optional.
120 ("texlive" ,texlive) ;TODO: Stabilize Texlive-2012 package
121 ("libogg" ,libogg)))
122 (native-inputs
123 `(("pkg-config" ,pkg-config)
124 ("autoconf" ,autoconf)
125 ("automake" ,automake)
126 ("gnu-gettext" ,gnu-gettext)
127 ("graphviz" ,graphviz) ; dot
128 ("texinfo-5" ,texinfo-5) ; Debian stable
129 ("which" ,which)
130 ("libtool" ,libtool)))
131 (arguments
132 `(#:configure-flags
133 (list "--enable-documentation")
134 #:tests? #f ;Don't run tests
135 #:phases
136 (modify-phases %standard-phases
137 (add-after 'unpack 'autoconf
138 (lambda _
139 (substitute* "bootstrap"
140 (("contrib/pogen.sh") "sh contrib/pogen.sh"))
141 (for-each (lambda (f) (chmod f #o755))
142 (find-files "po" ""))
143 (zero? (system* "sh" "bootstrap"))))
144 (add-after 'build 'run-gendocs
145 (lambda _
146 (chdir "doc/documentation")
147 ;;(zero? (system* "make" "dev-build"))))
148 (zero? (system* "sh" "run-gendocs.sh"))))
149 ;; (zero? (system* "make" "pdf"))
150 ;; (zero? (system* "make" "html"))
151 ;; (zero? (system* "make" "info"))))
152 ;;(zero? (system* "make" "doc-all-give-me-the-noise"))))
153 (replace 'install
154 (lambda _
155 (zero? (system* "make" "doc-gendoc-install")))))))
156 ;;(lambda* (#:key outputs #:allow-other-keys)
157 ;; (let* ((out (assoc-ref outputs "out"))
158 ;; (doc (string-append out "/share/doc/gnunet")))
159 ;; (mkdir-p doc)
160 ;; (copy-recursively "images"
161 ;; (string-append doc
162 ;; "/images"))
163 ;; (mkdir-p (string-append doc "/gnunet"))
164 ;; (install-file "gnunet.pdf" doc)
165 ;; (install-file "gnunet.info" doc)
166 ;; (install-file "gnunet.log" doc) ;TODO: Move to 'dev' output?
167 ;; (copy-recursively "gnunet"
168 ;; (string-append doc
169 ;; "/gnunet"))
170 ;; (install-file "gnunet-c-tutorial.pdf" doc)
171 ;; (install-file "gnunet-c-tutorial.info" doc)
172 ;; (install-file "gnunet-c-tutorial.log" doc) ;TODO: Move to 'dev' output?
173 ;; (copy-recursively "gnunet-c-tutorial"
174 ;; (string-append doc
175 ;; "/gnunet-c-tutorial")))
176 ;; #t)))))
177 (synopsis "Documentation of GNUnet")
178 (description
179 "GNUnet documentation build")
180 (license (list license:fdl1.3+ license:gpl3+))
181 (home-page "https://gnunet.org/"))))
182
183gnunet-doc
diff --git a/contrib/packages/guix/guix-env.scm b/contrib/packages/guix/guix-env.scm
deleted file mode 100644
index 8f45512e1..000000000
--- a/contrib/packages/guix/guix-env.scm
+++ /dev/null
@@ -1,210 +0,0 @@
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;; Guix package for GNUnet development
20;;
21;; INSTALL
22;; -------
23;;
24;; To build and install the package in the user environment, use:
25;;
26;; guix package --install-from-file=guix-env.scm
27;;
28;; BUILD ONLY
29;; ----------
30;;
31;; Precondition for using this file is that you run Guix and have a
32;; development setup for this setup, which involves a version of Guile in
33;; your PATH.
34;;
35;; cd contrib/packages/guix
36;; guix build -f guix-env.scm
37;;
38;; We'd like to provide advanced functions such as guix environment specific
39;; gnunet-git package and usage of gnunet-gtk-git, but this is subject
40;; to tests right now.
41
42(use-modules
43 (ice-9 popen)
44 (ice-9 match)
45 (ice-9 rdelim)
46 (guix packages)
47 (guix build-system gnu)
48 (guix gexp)
49 ((guix build utils) #:select (with-directory-excursion))
50 (guix git-download)
51 (guix utils) ; current-source-directory
52 (gnu packages)
53 (gnu packages aidc)
54 (gnu packages autotools)
55 (gnu packages backup)
56 (gnu packages base)
57 (gnu packages compression)
58 (gnu packages curl)
59 (gnu packages databases)
60 (gnu packages file)
61 (gnu packages gettext)
62 (gnu packages glib)
63 (gnu packages gnome)
64 (gnu packages gnunet)
65 (gnu packages gnupg)
66 (gnu packages gnuzilla)
67 (gnu packages groff)
68 (gnu packages gstreamer)
69 (gnu packages gtk)
70 (gnu packages guile)
71 (gnu packages image)
72 (gnu packages image-viewers)
73 (gnu packages libidn)
74 (gnu packages libunistring)
75 (gnu packages linux)
76 (gnu packages maths)
77 (gnu packages multiprecision)
78 (gnu packages perl)
79 (gnu packages pkg-config)
80 (gnu packages pulseaudio)
81 (gnu packages python)
82 (gnu packages tex)
83 (gnu packages texinfo)
84 (gnu packages tex)
85 (gnu packages tls)
86 (gnu packages video)
87 (gnu packages web)
88 (gnu packages xiph)
89 ((guix licenses) #:prefix license:))
90
91(define %source-dir (string-append (current-source-directory)
92 "/../../../"))
93
94(define gnunet-git
95 (let* ((revision "3")
96 (select? (delay (or (git-predicate
97 (string-append (current-source-directory)
98 "/../../../"))
99 source-file?))))
100 (package
101 (name "gnunet-git")
102 (version (string-append "0.10.1-" revision "." "dev"))
103 (source
104 (local-file ;;"../../.."
105 ;;%source-dir
106 ;;(string-append (getcwd) "/../../../")
107 (string-append (getcwd)) ;drrty hack and this assumes one static position FIXME!
108 #:recursive? #t))
109 ;;#:select? (git-predicate %source-dir)))
110 ;;#:select? (force select?)))
111 (build-system gnu-build-system)
112 (inputs
113 `(("glpk" ,glpk)
114 ("gnurl" ,gnurl)
115 ("gstreamer" ,gstreamer)
116 ("gst-plugins-base" ,gst-plugins-base)
117 ("gnutls" ,gnutls) ;Change to gnutls/dane once it is merged.
118 ("libextractor" ,libextractor)
119 ("libgcrypt" ,libgcrypt)
120 ("libidn" ,libidn)
121 ("libmicrohttpd" ,libmicrohttpd)
122 ("libltdl" ,libltdl)
123 ("libunistring" ,libunistring)
124 ("openssl" ,openssl)
125 ("opus" ,opus)
126 ("pulseaudio" ,pulseaudio)
127 ("sqlite" ,sqlite)
128 ("postgresql" ,postgresql)
129 ("mysql" ,mysql)
130 ("zlib" ,zlib)
131 ("perl" ,perl)
132 ("python-2" ,python-2) ; tests and gnunet-qr
133 ("jansson" ,jansson)
134 ("nss" ,nss)
135 ("glib" ,glib "bin")
136 ("gmp" ,gmp)
137 ("bluez" ,bluez) ; for optional bluetooth feature
138 ("glib" ,glib)
139 ;; There are currently no binary substitutes for texlive on
140 ;; hydra.gnu.org or its mirrors due to its size. Uncomment if you need it.
141 ;;("texlive-minimal" ,texlive-minimal) ; optional.
142 ("texlive" ,texlive)
143 ("libogg" ,libogg)))
144 (native-inputs
145 `(("pkg-config" ,pkg-config)
146 ("autoconf" ,autoconf)
147 ("automake" ,automake)
148 ("gnu-gettext" ,gnu-gettext)
149 ("which" ,which)
150 ("texinfo" ,texinfo-5) ; Debian stable: 5.2
151 ("libtool" ,libtool)))
152 ;; TODO: To make use of out:debug, which carries the symbols,
153 ;; this file needs to fixed.
154 (outputs '("out" "debug"))
155 (arguments
156 `(#:configure-flags
157 (list (string-append "--with-nssdir=" %output "/lib");"/lib/gnunet/nss")
158 "--enable-gcc-hardening"
159 "--enable-linker-hardening"
160
161 "--enable-poisoning"
162 "--enable-sanitizer"
163 "--enable-experimental"
164 "--enable-logging=verbose"
165 "CFLAGS=-ggdb -O0")
166 ;;#:parallel-tests? #f ; parallel building seems to fail
167 ;;#:tests? #f ; fail: test_gnunet_statistics.py
168 #:phases
169 ;; swap check and install phases and set paths to installed bin
170 (modify-phases %standard-phases
171 (add-after 'unpack 'patch-bin-sh
172 (lambda _
173 (substitute* "bootstrap"
174 (("contrib/pogen.sh") "sh contrib/pogen.sh"))
175 (for-each (lambda (f) (chmod f #o755))
176 (find-files "po" ""))
177 #t))
178 (add-after 'patch-bin-sh 'bootstrap
179 (lambda _
180 (zero? (system* "sh" "bootstrap"))))
181 ;; (add-after 'install 'install-lib-nss
182 ;; (lambda* (#:key outputs #:allow-other-keys)
183 ;; (let* ((out (assoc-ref outputs "out"))
184 ;; (lib (string-append out "/lib/nss/")))
185 ;; (mkdir-p lib)
186 ;; (copy-recursively "src/gns/nss/" lib)
187 ;; (install-file "ping" "combobreak"))
188 ;; #t))
189 (delete 'check))))
190 ;; XXX: https://gnunet.org/bugs/view.php?id=4619
191 ;; (add-after 'install 'set-path-for-check
192 ;; (lambda* (#:key outputs #:allow-other-keys)
193 ;; (let* ((out (assoc-ref outputs "out"))
194 ;; (bin (string-append out "/bin"))
195 ;; (lib (string-append out "/lib")))
196 ;; (setenv "GNUNET_PREFIX" lib)
197 ;; (setenv "PATH" (string-append (getenv "PATH") ":" bin))
198 ;; (zero? (system* "make" "check"))))))))
199 (synopsis "Secure, decentralized, peer-to-peer networking framework")
200 (description
201 "GNUnet is a framework for secure peer-to-peer networking. The
202high-level goal is to provide a strong foundation of free software for a
203global, distributed network that provides security and privacy. GNUnet in
204that sense aims to replace the current internet protocol stack. Along with
205an application for secure publication of files, it has grown to include all
206kinds of basic applications for the foundation of a GNU internet.")
207 (license license:gpl3+)
208 (home-page "https://gnunet.org/"))))
209
210gnunet-git
diff --git a/contrib/packages/guix/packages/gnunet/packages/gnunet.scm b/contrib/packages/guix/packages/gnunet/packages/gnunet.scm
deleted file mode 100644
index be529ec1d..000000000
--- a/contrib/packages/guix/packages/gnunet/packages/gnunet.scm
+++ /dev/null
@@ -1,519 +0,0 @@
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 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))
60
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")
67 (revision "32"))
68 (package
69 (inherit gnunet)
70 (name "gnunetg")
71 (version (string-append "0.10.1" "-" revision
72 "." (string-take commit 7)))
73 (source
74 (origin
75 (method git-fetch)
76 (uri (git-reference
77 (url "https://gnunet.org/git/gnunet.git")
78 (commit commit)))
79 (file-name (string-append name "-" version "-checkout"))
80 (sha256
81 (base32
82 "0g0x1r833jkssfd2sndy37509dqf9f8myjvg7mnadwc1irp393bl"))))
83 (build-system gnu-build-system)
84 (inputs
85 `(("glpk" ,glpk)
86 ("gnurl" ,gnurl)
87 ("gstreamer" ,gstreamer)
88 ("gst-plugins-base" ,gst-plugins-base)
89 ("gnutls" ,gnutls)
90 ("libextractor" ,libextractor)
91 ("libgcrypt" ,libgcrypt)
92 ("libidn" ,libidn)
93 ("libmicrohttpd" ,libmicrohttpd)
94 ("libltdl" ,libltdl)
95 ("libunistring" ,libunistring)
96 ("openssl" ,openssl)
97 ("opus" ,opus)
98 ("pulseaudio" ,pulseaudio)
99 ("sqlite" ,sqlite)
100 ("zlib" ,zlib)
101 ("perl" ,perl)
102 ("python" ,python-2) ; tests and gnunet-qr
103 ("jansson" ,jansson)
104 ("ncurses" ,ncurses)
105 ("nss" ,nss)
106 ("gmp" ,gmp)
107 ("miniupnpc" ,miniupnpc)
108 ("bluez" ,bluez) ; for optional bluetooth feature
109 ("glib" ,glib)
110 ;; ("texlive-minimal" ,texlive-minimal) ; optional.
111 ("libogg" ,libogg)))
112 (native-inputs
113 `(("pkg-config" ,pkg-config)
114 ("autoconf" ,autoconf)
115 ("automake" ,automake)
116 ("gnu-gettext" ,gnu-gettext)
117 ("which" ,which)
118 ("texinfo" ,texinfo)
119 ("libtool" ,libtool)))
120 (outputs '("out" "debug"))
121 (arguments
122 `(#:configure-flags
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
127 #:phases
128 ;; swap check and install phases and set paths to installed bin
129 (modify-phases %standard-phases
130 (add-after 'unpack 'patch-bin-sh
131 (lambda _
132 (substitute* "bootstrap"
133 (("contrib/pogen.sh") "sh contrib/pogen.sh"))
134 (for-each (lambda (f) (chmod f #o755))
135 (find-files "po" ""))
136 #t))
137 (add-after 'patch-bin-sh 'bootstrap
138 (lambda _
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
144 ;; (lambda _
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"))))))))
165
166(define-public gnunet-doc
167 (package
168 (name "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.
174 (inputs
175 `(("glpk" ,glpk)
176 ("gnurl" ,gnurl)
177 ("gstreamer" ,gstreamer)
178 ("gst-plugins-base" ,gst-plugins-base)
179 ("gnutls" ,gnutls)
180 ("libextractor" ,libextractor)
181 ("libgcrypt" ,libgcrypt)
182 ("libidn" ,libidn)
183 ("libmicrohttpd" ,libmicrohttpd)
184 ("libltdl" ,libltdl)
185 ("libunistring" ,libunistring)
186 ("openssl" ,openssl)
187 ("opus" ,opus)
188 ("pulseaudio" ,pulseaudio)
189 ("sqlite" ,sqlite)
190 ("zlib" ,zlib)
191 ("perl" ,perl)
192 ("python" ,python-2) ; tests and gnunet-qr
193 ("jansson" ,jansson)
194 ("ncurses" ,ncurses)
195 ("nss" ,nss)
196 ("gmp" ,gmp)
197 ("miniupnpc" ,miniupnpc)
198 ("bluez" ,bluez) ; for optional bluetooth feature
199 ("glib" ,glib)
200 ("texlive" ,texlive) ;TODO: Use a minimal subset.
201 ("libogg" ,libogg)))
202 (native-inputs
203 `(("pkg-config" ,pkg-config)
204 ("autoconf" ,autoconf)
205 ("which" ,which)
206 ("automake" ,automake)
207 ("gnu-gettext" ,gnu-gettext)
208 ("texinfo" ,texinfo)
209 ("libtool" ,libtool)))
210 (arguments
211 `(#:tests? #f ;Don't run tests
212 #:phases
213 (modify-phases %standard-phases
214 (add-after 'unpack 'patch-bin-sh
215 (lambda _
216 (substitute* "bootstrap"
217 (("contrib/pogen.sh") "sh contrib/pogen.sh"))
218 (for-each (lambda (f) (chmod f #o755))
219 (find-files "po" ""))
220 #t))
221 (add-after 'patch-bin-sh 'bootstrap
222 (lambda _
223 (zero? (system* "sh" "bootstrap"))))
224 (replace 'build
225 (lambda _
226 (chdir "doc")
227 (zero? (system* "make" "doc-all-give-me-the-noise"))))
228 (replace 'install
229 (lambda* (#:key outputs #:allow-other-keys)
230 (let* ((out (assoc-ref outputs "out"))
231 (doc (string-append out "/share/doc/gnunet")))
232 (mkdir-p doc)
233 (mkdir-p (string-append doc "/gnunet"))
234 (install-file "gnunet.pdf" doc)
235 (install-file "gnunet.info" doc)
236 (copy-recursively "gnunet"
237 (string-append doc
238 "/gnunet"))
239 (install-file "gnunet-c-tutorial.pdf" doc)
240 (install-file "gnunet-c-tutorial.info" doc)
241 (copy-recursively "gnunet-c-tutorial"
242 (string-append doc
243 "/gnunet-c-tutorial")))
244 #t)))))
245 (synopsis "GNUnet documentation")
246 (description
247 "Gnunet-doc builds the documentation of GNUnet.")
248 (home-page "https://gnunet.org")
249 (license (package-license gnunet))))
250
251(define-public gnunetgpg
252 (package
253 (inherit gnunetg)
254 (name "gnunetgpg")
255 (inputs
256 `(("postgresql" ,postgresql)
257 ,@(package-inputs gnunetg)))
258 (synopsis "gnunet, variant with postgres")))
259
260(define-public gnunetgf
261 (package
262 (inherit gnunetg)
263 (name "gnunetgf")
264 (inputs
265 `(("postgresql" ,postgresql)
266 ("mysql" ,mysql)
267 ,@(package-inputs gnunetg)))
268 (arguments
269 `(#:configure-flags
270 (list (string-append "--with-nssdir=" %output "/lib")
271 "--enable-gcc-hardening"
272 "--enable-linker-hardening"
273
274 "--enable-poisoning"
275 "--enable-sanitizer"
276 "--enable-experimental"
277 "--enable-logging=verbose"
278 "CFLAGS=-ggdb -O0")
279 #:parallel-tests? #f ; parallel building is not supported.
280 ;;#:tests? #f ; fail: test_gnunet_statistics.py
281 #:phases
282 ;; swap check and install phases and set paths to installed bin
283 (modify-phases %standard-phases
284 (add-after 'unpack 'patch-bin-sh
285 (lambda _
286 (substitute* "bootstrap"
287 (("contrib/pogen.sh") "sh contrib/pogen.sh"))
288 (for-each (lambda (f) (chmod f #o755))
289 (find-files "po" ""))
290 #t))
291 (add-after 'patch-bin-sh 'bootstrap
292 (lambda _
293 (zero? (system* "sh" "bootstrap"))))
294 (delete 'check))))
295 (synopsis "gnunet, full git build without tests")))
296
297;; A package to run the test suite.
298(define-public gnunetgft
299 (package
300 (inherit gnunetg)
301 (name "gnunetgft")
302 (arguments
303 `(#:configure-flags
304 (list (string-append "--with-nssdir=" %output "/lib")
305 "--enable-gcc-hardening"
306 "--enable-linker-hardening"
307
308 ;;"--enable-poisoning"
309 ;;"--enable-sanitizer"
310 "--enable-experimental"
311 "--enable-logging=verbose"
312 "CFLAGS=-ggdb -O0")
313 ;; #:parallel-tests? #f ; parallel building seems to fail
314 ;;#:tests? #f ; fail: test_gnunet_statistics.py
315 #:phases
316 ;; swap check and install phases and set paths to installed bin
317 (modify-phases %standard-phases
318 (add-after 'unpack 'patch-bin-sh
319 (lambda _
320 (substitute* "bootstrap"
321 (("contrib/pogen.sh") "sh contrib/pogen.sh"))
322 (for-each (lambda (f) (chmod f #o755))
323 (find-files "po" ""))
324 #t))
325 (add-after 'patch-bin-sh 'bootstrap
326 (lambda _
327 (zero? (system* "sh" "bootstrap"))))
328 (delete 'check)
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")))
339
340(define-public gnunetg-test
341 (package
342 (inherit gnunetg)
343 (name "gnunetg-test")
344 (arguments
345 `(#:configure-flags
346 (list (string-append "--with-nssdir=" %output "/lib")
347 "--enable-gcc-hardening"
348 "--enable-linker-hardening"
349
350 ;;"--enable-poisoning"
351 ;;"--enable-sanitizer"
352 "--enable-logging=verbose"
353 "CFLAGS=-ggdb -O0")
354 ;; #:parallel-tests? #f ; parallel building seems to fail
355 ;;#:tests? #f ; fail: test_gnunet_statistics.py
356 #:phases
357 ;; swap check and install phases and set paths to installed bin
358 (modify-phases %standard-phases
359 (add-after 'unpack 'patch-bin-sh
360 (lambda _
361 (substitute* "bootstrap"
362 (("contrib/pogen.sh") "sh contrib/pogen.sh"))
363 (for-each (lambda (f) (chmod f #o755))
364 (find-files "po" ""))
365 #t))
366 (add-after 'patch-bin-sh 'bootstrap
367 (lambda _
368 (zero? (system* "sh" "bootstrap"))))
369 (delete 'check)
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")))
380
381;; ... and one package to test the package with "parallel-tests? #f"
382(define-public gnunetgftn
383 (package
384 (inherit gnunetg)
385 (name "gnunetgftn")
386 (arguments
387 `(#:configure-flags
388 (list (string-append "--with-nssdir=" %output "/lib")
389 "--enable-gcc-hardening"
390 "--enable-linker-hardening"
391
392 "--enable-poisoning"
393 "--enable-sanitizer"
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
399 #:phases
400 ;; swap check and install phases and set paths to installed bin
401 (modify-phases %standard-phases
402 (add-after 'unpack 'patch-bin-sh
403 (lambda _
404 (substitute* "bootstrap"
405 (("contrib/pogen.sh") "sh contrib/pogen.sh"))
406 (for-each (lambda (f) (chmod f #o755))
407 (find-files "po" ""))
408 #t))
409 (add-after 'patch-bin-sh 'bootstrap
410 (lambda _
411 (zero? (system* "sh" "bootstrap"))))
412 (delete 'check)
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"))))))))))
422
423(define-public gnunet-gtkg
424 (let* ((commit "087f8e166ee6d1fc59a6bd5d05f656528761ede7")
425 (revision "5"))
426 (package
427 (inherit gnunetgf)
428 (name "gnunet-gtkg")
429 (version (package-version gnunetgf))
430 (source
431 (origin
432 (method git-fetch)
433 (uri (git-reference
434 (url "https://gnunet.org/git/gnunet-gtk.git")
435 (commit commit)))
436 (file-name (string-append name "-" version "-checkout"))
437 (sha256
438 (base32
439 "1k03d8l0yz4fpliy5bg5s7qkpidzd6ryr4cd63wgmd227p32i87q"))))
440 (arguments
441 `(#:configure-flags
442 (list "--with-libunique"
443 "--with-qrencode"
444 (string-append "--with-gnunet="
445 (assoc-ref %build-inputs "gnunetgf")))
446 #:phases
447 (modify-phases %standard-phases
448 (add-before 'configure 'bootstrap
449 (lambda _
450 (zero? (system* "autoreconf" "-vfi")))))))
451 (inputs
452 `(("gnunetgf" ,gnunetgf)
453 ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
454 ("gnutls" ,gnutls)
455 ("libgcrypt" ,libgcrypt)
456 ("gtk+" ,gtk+)
457 ("libextractor" ,libextractor)
458 ("glade3" ,glade3)
459 ("qrencode" ,qrencode)
460 ("libunique" ,libunique)))
461 (native-inputs
462 `(("pkg-config" ,pkg-config)
463 ("libglade" ,libglade)
464 ("autoconf" ,autoconf)
465 ("gnu-gettext" ,gnu-gettext)
466 ("texinfo" ,texinfo)
467 ("automake" ,automake)
468 ("libtool" ,libtool)))
469 (synopsis "Graphical front-end tools for GNUnet")
470 (home-page "https://gnunet.org"))))
471
472;; fuse, pointing to the tests disabled version of gnunet-git
473(define-public gnunet-fuse-git
474 (let* ((commit "3503aeff6db6b39b85e13f9483d46d49ce9cec55")
475 (revision "3"))
476 (package
477 (inherit gnunetg)
478 ;;(inherit gnunet)
479 (name "gnunet-fuse-git")
480 (version (package-version gnunetgf))
481 ;;(version (package-version gnunet))
482 (source
483 (origin
484 (method git-fetch)
485 (uri (git-reference
486 (url "https://gnunet.org/git/gnunet-fuse.git")
487 (commit commit)))
488 (file-name (string-append name "-" version "-checkout"))
489 (sha256
490 (base32
491 "0sxzppanw2nrjqv1vnyj2jx3ja6gqrg0ibkl5n1fr265cqk5hgc5"))))
492 (arguments
493 `(#:configure-flags
494 (list "--with-qrencode"
495 (string-append "--with-gnunet="
496 (assoc-ref %build-inputs "gnunetgf"))) ;"gnunet")))
497 #:phases
498 (modify-phases %standard-phases
499 (add-after 'unpack 'fix-gnunet-include-path
500 (lambda _
501 (substitute* "configure.ac"
502 (("gnunet/gnunet_util_lib.h")
503 "${lookin}/include/gnunet/gnunet_util_lib.h"))
504 #t))
505 (add-before 'configure 'bootstrap
506 (lambda _
507 (zero? (system* "autoreconf" "-vfi")))))))
508 (inputs
509 `(("gnunetgf" ,gnunetgf)))
510 ;;`(("gnunet" ,gnunet)))
511 (native-inputs
512 `(("pkg-config" ,pkg-config)
513 ("fuse" ,fuse)
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"))))
diff --git a/contrib/packages/guix/packages/gnunet/packages/texlive.scm b/contrib/packages/guix/packages/gnunet/packages/texlive.scm
deleted file mode 100644
index 77256a947..000000000
--- a/contrib/packages/guix/packages/gnunet/packages/texlive.scm
+++ /dev/null
@@ -1,182 +0,0 @@
1;;; This file is part of GNUnet.
2;;; Copyright (C) 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;; Initially based on Guix commit eb0119efde826590a13973ab928c173780a7f257
20
21(define-module (gnunet packages texlive)
22 #:use-module ((guix licenses)
23 #:renamer (symbol-prefix-proc 'license:))
24 #:use-module (guix packages)
25 #:use-module (guix download)
26 #:use-module (guix build-system gnu)
27 #:use-module (gnu packages)
28 #:use-module (gnu packages compression)
29 #:use-module (gnu packages fontutils)
30 #:use-module (gnu packages ghostscript)
31 #:use-module (gnu packages icu4c)
32 #:use-module (gnu packages image)
33 #:use-module (gnu packages pdf)
34 #:use-module (gnu packages perl)
35 #:use-module (gnu packages pkg-config)
36 #:use-module (gnu packages python)
37 #:use-module (gnu packages compression))
38
39(define texlive-extra-src
40 (origin
41 (method url-fetch)
42 (uri "ftp://tug.org/historic/systems/texlive/2012/texlive-20120701-extra.tar.xz")
43 ;;(uri "ftp://tug.org/historic/systems/texlive/2012/texlive-20120701-extra.tar.xz")
44 (sha256 (base32
45 "0cb8fnv4x281gy5ka779f00ssdmdpjj4x3pkh9j9vq45hrwg3522"))))
46
47(define texlive-texmf-src
48 (origin
49 (method url-fetch)
50 (uri "ftp://tug.org/historic/systems/texlive/2012/texlive-20120701-texmf.tar.xz")
51 ;;(uri "ftp://tug.org/historic/systems/texlive/2012/texlive-20120701-texmf.tar.xz")
52 (sha256 (base32
53 "1fn1dg9k7pnh8a80j23zfkbrfnqyc4c2w4ss30dpkqj490nxsywq"))))
54
55;; Note that right now this does not include security fixes!
56;; FIXME: Needs more fixes, currently this fails building!
57
58(define-public texlive
59 (package
60 (name "texlive")
61 (version "2012")
62 (source (origin
63 (method url-fetch)
64 (uri "ftp://tug.org/historic/systems/texlive/2012/texlive-20120701-source.tar.xz")
65 ;;(uri "ftp://tug.org/historic/systems/texlive/2012/texlive-20120701-source.tar.xz")
66 (sha256 (base32
67 "10bcrdfsqnc6y3gqcb8ndnjy07i5kz63as39irbq4gmcbmyn2rln"))))
68 (build-system gnu-build-system)
69 (inputs `(("texlive-extra-src" ,texlive-extra-src)
70 ("texlive-texmf-src" ,texlive-texmf-src)
71 ("fontconfig" ,fontconfig)
72 ("freetype" ,freetype)
73 ("icu4c" ,icu4c)
74 ("ghostscript" ,ghostscript)
75 ("libpng" ,libpng)
76 ("perl" ,perl)
77 ("poppler" ,poppler)
78 ("pkg-config" ,pkg-config)
79 ;; FIXME: Add interpreters csh, fontforge and ruby,
80 ;; once they are available.
81 ("python" ,python)
82 ("teckit" ,teckit)
83 ("t1lib" ,t1lib)
84 ("zlib" ,zlib)
85 ("zziplib" ,zziplib)))
86 (outputs '("out" "data"))
87 (arguments
88 `(#:out-of-source? #t
89 #:configure-flags
90 `("--disable-native-texlive-build"
91 ;; Although the texmf and texmf-dist data is taken from
92 ;; texlive-texmf, setting datarootdir is still useful:
93 ;; "make install" creates symbolic links to scripts in this place.
94 ,(string-append "--datarootdir=" (assoc-ref %outputs "data"))
95 ,(string-append "--infodir=" (assoc-ref %outputs "out") "/share/info")
96 ,(string-append "--mandir=" (assoc-ref %outputs "out") "/share/man")
97 "--without-x" ; FIXME: Drop as soon as X is available.
98 "--with-system-freetype2"
99 ;; "--with-system-gd"
100 ;; "--with-system-graphite"
101 "--with-system-icu"
102 "--with-system-libgs"
103 "--with-system-libpng"
104 "--with-system-poppler"
105 "--with-system-t1lib"
106 "--with-system-teckit"
107 "--with-system-xpdf"
108 "--with-system-zlib"
109 "--with-system-zziplib")
110 #:phases
111 (alist-replace
112 'configure
113 (lambda* (#:key outputs #:allow-other-keys #:rest args)
114 (let ((configure (assoc-ref %standard-phases 'configure)))
115 (substitute* "utils/psutils/Makefile.in"
116 (("/usr/bin/env perl") (which "perl")))
117 (apply configure args)))
118 (alist-cons-after
119 'install 'postinst
120 (lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
121 (let ((texlive-extra (assoc-ref inputs "texlive-extra-src"))
122 (texlive-texmf (assoc-ref inputs "texlive-texmf-src"))
123 (out (assoc-ref outputs "out"))
124 (data (assoc-ref outputs "data"))
125 (unpack (assoc-ref %standard-phases 'unpack))
126 (patch-source-shebangs
127 (assoc-ref %standard-phases 'patch-source-shebangs)))
128 ;; Create symbolic links for the latex variants and their
129 ;; man pages.
130 (with-directory-excursion (string-append out "/bin/")
131 (for-each symlink
132 '("pdftex" "pdftex" "xetex" "luatex")
133 '("latex" "pdflatex" "xelatex" "lualatex")))
134 (with-directory-excursion (string-append out "/share/man/man1/")
135 (symlink "luatex.1" "lualatex.1"))
136 ;; Delete texmf and texmf-dist from "data", since they
137 ;; will be reinstalled from texlive-texmf.
138 (system* "rm" "-r" (string-append data "/texmf"))
139 (system* "rm" "-r" (string-append data "/texmf-dist"))
140 ;; Unpack texlive-extra and install tlpkg.
141 (mkdir "texlive-extra")
142 (with-directory-excursion "texlive-extra"
143 (apply unpack (list #:source texlive-extra))
144 (apply patch-source-shebangs (list #:source texlive-extra))
145 (system* "mv" "tlpkg" data)
146 (chdir ".."))
147 ;; Unpack and install texlive-texmf.
148 (mkdir "texlive-texmf")
149 (with-directory-excursion "texlive-texmf"
150 (apply unpack (list #:source texlive-texmf))
151 (apply patch-source-shebangs (list #:source texlive-texmf))
152 ;; Register "data" for kpathsea in texmf.cnf.
153 (substitute* "texmf/web2c/texmf.cnf"
154 (("TEXMFROOT = \\$SELFAUTOPARENT")
155 (string-append "TEXMFROOT = " data)))
156 (system* "mv" "texmf" data)
157 (system* "mv" "texmf-dist" data)
158 (chdir ".."))
159 ;; texmf.cnf must also be placed in "out", since kpsewhich does
160 ;; not know about "data" until it has found this file.
161 (mkdir (string-append out "/share/texmf"))
162 (mkdir (string-append out "/share/texmf/web2c"))
163 (copy-file (string-append data "/texmf/web2c/texmf.cnf")
164 (string-append out "/share/texmf/web2c/texmf.cnf"))))
165 (alist-cons-after 'patch-shebangs 'texconfig
166 (lambda* (#:key outputs #:allow-other-keys)
167 (let ((out (assoc-ref outputs "out")))
168 ;; Configure the texlive system; inspired from
169 ;; http://slackbuilds.org/repository/13.37/office/texlive/
170 (setenv "PATH" (string-append (getenv "PATH") ":" out "/bin"))
171 (system* "updmap-sys" "--nohash" "--syncwithtrees")
172 (system* "mktexlsr")
173 (system* "fmtutil-sys" "--all")))
174 %standard-phases)))))
175 (synopsis "Tex Live, a package of the TeX typesetting system")
176 (description
177 "TeX Live provides a comprehensive TeX document production system.
178It includes all the major TeX-related programs, macro packages, and fonts
179that are free software, including support for many languages around the
180world.")
181 (license (license:fsf-free "http://tug.org/texlive/copying.html"))
182 (home-page "http://www.tug.org/texlive/")))
diff --git a/doc/documentation/chapters/developer.texi b/doc/documentation/chapters/developer.texi
index a99f6a481..a341d0af7 100644
--- a/doc/documentation/chapters/developer.texi
+++ b/doc/documentation/chapters/developer.texi
@@ -94,8 +94,9 @@ following links:
94@c ** FIXME: Link to files in source, not online. 94@c ** FIXME: Link to files in source, not online.
95@c ** FIXME: Where is the Java tutorial? 95@c ** FIXME: Where is the Java tutorial?
96@itemize @bullet 96@itemize @bullet
97@item @xref{Top, Introduction,, gnunet-c-tutorial, The GNUnet C Tutorial}
97@c broken link 98@c broken link
98@item @uref{https://gnunet.org/git/gnunet.git/plain/doc/gnunet-c-tutorial.pdf, GNUnet C tutorial} 99@c @item @uref{https://gnunet.org/git/gnunet.git/plain/doc/gnunet-c-tutorial.pdf, GNUnet C tutorial}
99@item GNUnet Java tutorial 100@item GNUnet Java tutorial
100@end itemize 101@end itemize
101 102
@@ -116,7 +117,7 @@ The public subsystems on the GNUnet server that help developers are:
116 117
117@item The version control system (git) keeps our code and enables 118@item The version control system (git) keeps our code and enables
118distributed development. 119distributed development.
119It is pubclicly accessible at @uref{https://gnunet.org/git/}. 120It is publicly accessible at @uref{https://gnunet.org/git/}.
120Only developers with write access can commit code, everyone else is 121Only developers with write access can commit code, everyone else is
121encouraged to submit patches to the 122encouraged to submit patches to the
122@uref{https://lists.gnu.org/mailman/listinfo/gnunet-developers, GNUnet-developers mailinglist}. 123@uref{https://lists.gnu.org/mailman/listinfo/gnunet-developers, GNUnet-developers mailinglist}.
@@ -153,9 +154,11 @@ Details on how to use Gauger are here.
153@item We use @uref{http://junit.org/, junit} to automatically test 154@item We use @uref{http://junit.org/, junit} to automatically test
154@command{gnunet-java}. 155@command{gnunet-java}.
155Automatically generated, current reports on the test suite are here. 156Automatically generated, current reports on the test suite are here.
157@c FIXME: URL.
156 158
157@item We use Cobertura to generate test coverage reports for gnunet-java. 159@item We use Cobertura to generate test coverage reports for gnunet-java.
158Current reports on test coverage are here. 160Current reports on test coverage are here.
161@c FIXME: Likewise.
159 162
160@end itemize 163@end itemize
161 164
@@ -211,10 +214,11 @@ Code to run GNUnet nodes on testbeds for research, development,
211testing and evaluation 214testing and evaluation
212@c ** FIXME: Solve the status and location of gnunet-qt 215@c ** FIXME: Solve the status and location of gnunet-qt
213@item @command{gnunet-qt} 216@item @command{gnunet-qt}
214Qt-based GNUnet GUI (is it depreacated?) 217Qt-based GNUnet GUI (is it deprecated?)
215@item @command{gnunet-cocoa} 218@item @command{gnunet-cocoa}
216cocoa-based GNUnet GUI (is it depreacated?) 219cocoa-based GNUnet GUI (is it deprecated?)
217@item @command{gnunet-guile} 220@item @command{gnunet-guile}
221Guile bindings for GNUnet
218 222
219@end table 223@end table
220 224
@@ -231,8 +235,7 @@ Tool for performance regression analysis
231@item @command{monkey} 235@item @command{monkey}
232Tool for automated debugging of distributed systems 236Tool for automated debugging of distributed systems
233@item @command{libmwmodem} 237@item @command{libmwmodem}
234Library for accessing satellite connection quality 238Library for accessing satellite connection quality reports
235reports
236@item @command{libgnurl} 239@item @command{libgnurl}
237gnURL (feature-restricted variant of cURL/libcurl) 240gnURL (feature-restricted variant of cURL/libcurl)
238@end table 241@end table
diff --git a/contrib/packages/guix/gnunet.scm b/guix-env.scm
index d83111292..7708b2706 100644
--- a/contrib/packages/guix/gnunet.scm
+++ b/guix-env.scm
@@ -1,5 +1,5 @@
1;;; This file is part of GNUnet. 1;;; This file is part of GNUnet.
2;;; Copyright (C) 2016, 2017 GNUnet e.V. 2;;; Copyright (C) 2016, 2017, 2018 GNUnet e.V.
3;;; 3;;;
4;;; GNUnet is free software; you can redistribute it and/or modify 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 5;;; it under the terms of the GNU General Public License as published
@@ -69,24 +69,20 @@
69(define %source-dir (string-append (current-source-directory) 69(define %source-dir (string-append (current-source-directory)
70 "/../../../")) 70 "/../../../"))
71 71
72(define gnunet-test-git 72(define gnunet-dev-env
73 (let* ((revision "1") 73 (let* ((revision "1")
74 (select? (delay (or (git-predicate 74 (select? (delay (or (git-predicate
75 (string-append (current-source-directory) 75 (string-append (current-source-directory)
76 "/../../../")) 76 "/../../../"))
77 source-file?)))) 77 source-file?))))
78 (package 78 (package
79 (name "gnunet-test-git") 79 (inherit gnunet)
80 (version (string-append "0.10.1-" revision "." "dev")) 80 (name "gnunet-dev-env")
81 (version (string-append "0.11-" revision "." "dev-env"))
81 (source 82 (source
82 (local-file ;;"../../.." 83 (local-file
83 ;;%source-dir 84 (string-append (getcwd))
84 ;;(string-append (getcwd) "/../../../")
85 (string-append (getcwd)) ;drrty hack and this assumes one static position FIXME!
86 #:recursive? #t)) 85 #:recursive? #t))
87 ;;#:select? (git-predicate %source-dir)))
88 ;;#:select? (force select?)))
89 (build-system gnu-build-system)
90 (inputs 86 (inputs
91 `(("glpk" ,glpk) 87 `(("glpk" ,glpk)
92 ("gnurl" ,gnurl) 88 ("gnurl" ,gnurl)
@@ -114,9 +110,7 @@
114 ("gmp" ,gmp) 110 ("gmp" ,gmp)
115 ("bluez" ,bluez) ; for optional bluetooth feature 111 ("bluez" ,bluez) ; for optional bluetooth feature
116 ("glib" ,glib) 112 ("glib" ,glib)
117 ;; TODO: figure out the right texlive parts. 113 ("texlive" ,texlive) ;FIXME: minimize.
118 ;;("texlive-minimal" ,texlive-minimal)
119 ("texlive" ,texlive)
120 ("miniupnpc" ,miniupnpc) 114 ("miniupnpc" ,miniupnpc)
121 ("libogg" ,libogg))) 115 ("libogg" ,libogg)))
122 (native-inputs 116 (native-inputs
@@ -157,11 +151,6 @@
157 (lib (string-append out "/lib"))) 151 (lib (string-append out "/lib")))
158 (setenv "GNUNET_PREFIX" lib) 152 (setenv "GNUNET_PREFIX" lib)
159 (setenv "PATH" (string-append (getenv "PATH") ":" bin)) 153 (setenv "PATH" (string-append (getenv "PATH") ":" bin))
160 (zero? (system* "make" "check")))))))) 154 (zero? (system* "make" "check")))))))))))
161 (synopsis "tests enabled without experimental")
162 (description
163 "GNUnet from git HEAD")
164 (license license:gpl3+)
165 (home-page "https://gnunet.org"))))
166 155
167gnunet-test-git 156gnunet-dev-env
diff --git a/guix.packages b/guix.packages
new file mode 100644
index 000000000..3b2f6cfcd
--- /dev/null
+++ b/guix.packages
@@ -0,0 +1,44 @@
1;;; -*- mode: scheme -*-
2;;; Packages required to develop GNUnet with Guix.
3;;; (See guix package --manifest option for more details on this file).
4
5(use-modules (guix profiles)
6 (gnu packages))
7
8
9(define gnunet-dev-packages
10 (list "glpk"
11 "gnurl"
12 "gstreamer"
13 "gst-plugins-base"
14 "gnutls/dane"
15 "libextractor"
16 "libgcrypt"
17 "libidn"
18 "libunistring"
19 "openssl"
20 "opus"
21 "pulseaudio"
22 "sqlite"
23 "mysql"
24 "postgresql"
25 "zlib"
26 "perl"
27 "jansson"
28 "nss"
29 "glib"
30 "gmp"
31 "glib"
32 "glibc-locales"
33 "bluez"
34 "texlive" ; FIXME: minimize
35 "pkg-config"
36 "autoconf"
37 "automake"
38 "gnu-gettext"
39 "which"
40 "texinfo-5"
41 "libtool"))
42
43
44(map specification->package gnunet-dev-packages)
diff --git a/src/cadet/gnunet-service-cadet_peer.c b/src/cadet/gnunet-service-cadet_peer.c
index da78a03c4..05555e693 100644
--- a/src/cadet/gnunet-service-cadet_peer.c
+++ b/src/cadet/gnunet-service-cadet_peer.c
@@ -59,7 +59,10 @@
59 */ 59 */
60#define IDLE_PATH_TIMEOUT GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MINUTES, 2) 60#define IDLE_PATH_TIMEOUT GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MINUTES, 2)
61 61
62 62/**
63 * Queue size when we start dropping OOO messages.
64 */
65#define MAX_OOO_QUEUE_SIZE 100
63 66
64 67
65/** 68/**
@@ -1464,6 +1467,11 @@ GCP_send_ooo (struct CadetPeer *cp,
1464 GNUNET_MQ_discard (env); 1467 GNUNET_MQ_discard (env);
1465 return; 1468 return;
1466 } 1469 }
1470 if (GNUNET_MQ_get_length (cp->core_mq) > MAX_OOO_QUEUE_SIZE)
1471 {
1472 GNUNET_MQ_discard (env);
1473 return;
1474 }
1467 GNUNET_MQ_notify_sent (env, 1475 GNUNET_MQ_notify_sent (env,
1468 &mqm_send_done, 1476 &mqm_send_done,
1469 cp); 1477 cp);
diff --git a/src/fs/gnunet-service-fs_cp.c b/src/fs/gnunet-service-fs_cp.c
index 817aed257..6e28ca606 100644
--- a/src/fs/gnunet-service-fs_cp.c
+++ b/src/fs/gnunet-service-fs_cp.c
@@ -1230,7 +1230,9 @@ handle_p2p_get (void *cls,
1230 GNUNET_NO); 1230 GNUNET_NO);
1231 return; 1231 return;
1232 } 1232 }
1233 if (cp->ppd.pending_replies + cp->delay_queue_size > MAX_QUEUE_PER_PEER) 1233 unsigned int queue_size = GNUNET_MQ_get_length (cp->mq);
1234 queue_size += cp->ppd.pending_replies + cp->delay_queue_size;
1235 if (queue_size > MAX_QUEUE_PER_PEER)
1234 { 1236 {
1235 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1237 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1236 "Peer `%s' has too many replies queued already. Dropping query.\n", 1238 "Peer `%s' has too many replies queued already. Dropping query.\n",
diff --git a/src/gns/gnunet-gns-proxy.c b/src/gns/gnunet-gns-proxy.c
index 3af571eba..25092dcf0 100644
--- a/src/gns/gnunet-gns-proxy.c
+++ b/src/gns/gnunet-gns-proxy.c
@@ -1957,8 +1957,10 @@ mhd_log_callback (void *cls,
1957 } 1957 }
1958 s5r->url = GNUNET_strdup (url); 1958 s5r->url = GNUNET_strdup (url);
1959 if (NULL != s5r->timeout_task) 1959 if (NULL != s5r->timeout_task)
1960 {
1960 GNUNET_SCHEDULER_cancel (s5r->timeout_task); 1961 GNUNET_SCHEDULER_cancel (s5r->timeout_task);
1961 s5r->timeout_task = NULL; 1962 s5r->timeout_task = NULL;
1963 }
1962 GNUNET_assert (s5r->state == SOCKS5_SOCKET_WITH_MHD); 1964 GNUNET_assert (s5r->state == SOCKS5_SOCKET_WITH_MHD);
1963 return s5r; 1965 return s5r;
1964} 1966}
@@ -2060,7 +2062,10 @@ schedule_httpd (struct MhdHttpList *hd)
2060 wws = NULL; 2062 wws = NULL;
2061 } 2063 }
2062 if (NULL != hd->httpd_task) 2064 if (NULL != hd->httpd_task)
2065 {
2063 GNUNET_SCHEDULER_cancel (hd->httpd_task); 2066 GNUNET_SCHEDULER_cancel (hd->httpd_task);
2067 hd->httpd_task = NULL;
2068 }
2064 if ( (MHD_YES != haveto) && 2069 if ( (MHD_YES != haveto) &&
2065 (-1 == max) && 2070 (-1 == max) &&
2066 (hd != httpd) ) 2071 (hd != httpd) )
@@ -2108,8 +2113,7 @@ do_httpd (void *cls)
2108static void 2113static void
2109run_mhd_now (struct MhdHttpList *hd) 2114run_mhd_now (struct MhdHttpList *hd)
2110{ 2115{
2111 if (NULL != 2116 if (NULL != hd->httpd_task)
2112 hd->httpd_task)
2113 GNUNET_SCHEDULER_cancel (hd->httpd_task); 2117 GNUNET_SCHEDULER_cancel (hd->httpd_task);
2114 hd->httpd_task = GNUNET_SCHEDULER_add_now (&do_httpd, 2118 hd->httpd_task = GNUNET_SCHEDULER_add_now (&do_httpd,
2115 hd); 2119 hd);
@@ -2891,18 +2895,17 @@ do_accept (void *cls)
2891 struct GNUNET_NETWORK_Handle *s; 2895 struct GNUNET_NETWORK_Handle *s;
2892 struct Socks5Request *s5r; 2896 struct Socks5Request *s5r;
2893 2897
2894 if (lsock == lsock4) 2898 GNUNET_assert (NULL != lsock);
2895 ltask4 = NULL;
2896 else
2897 ltask6 = NULL;
2898 if (lsock == lsock4) 2899 if (lsock == lsock4)
2899 ltask4 = GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL, 2900 ltask4 = GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL,
2900 lsock, 2901 lsock,
2901 &do_accept, lsock); 2902 &do_accept, lsock);
2902 else 2903 else if (lsock == lsock6)
2903 ltask6 = GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL, 2904 ltask6 = GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL,
2904 lsock, 2905 lsock,
2905 &do_accept, lsock); 2906 &do_accept, lsock);
2907 else
2908 GNUNET_assert (0);
2906 s = GNUNET_NETWORK_socket_accept (lsock, NULL, NULL); 2909 s = GNUNET_NETWORK_socket_accept (lsock, NULL, NULL);
2907 if (NULL == s) 2910 if (NULL == s)
2908 { 2911 {
diff --git a/src/identity/plugin_rest_identity.c b/src/identity/plugin_rest_identity.c
index 33804143d..6044d0641 100644
--- a/src/identity/plugin_rest_identity.c
+++ b/src/identity/plugin_rest_identity.c
@@ -241,7 +241,10 @@ cleanup_handle (struct RequestHandle *handle)
241 if (NULL != handle->name) 241 if (NULL != handle->name)
242 GNUNET_free (handle->name); 242 GNUNET_free (handle->name);
243 if (NULL != handle->timeout_task) 243 if (NULL != handle->timeout_task)
244 {
244 GNUNET_SCHEDULER_cancel (handle->timeout_task); 245 GNUNET_SCHEDULER_cancel (handle->timeout_task);
246 handle->timeout_task = NULL;
247 }
245 if (NULL != handle->identity_handle) 248 if (NULL != handle->identity_handle)
246 GNUNET_IDENTITY_disconnect (handle->identity_handle); 249 GNUNET_IDENTITY_disconnect (handle->identity_handle);
247 if (NULL != handle->subsys) 250 if (NULL != handle->subsys)
diff --git a/src/include/gnunet_crypto_lib.h b/src/include/gnunet_crypto_lib.h
index e886a561c..f46afa6cc 100644
--- a/src/include/gnunet_crypto_lib.h
+++ b/src/include/gnunet_crypto_lib.h
@@ -363,7 +363,7 @@ struct GNUNET_CRYPTO_PaillierPublicKey
363 363
364 364
365/** 365/**
366 * Paillier public key. 366 * Paillier private key.
367 */ 367 */
368struct GNUNET_CRYPTO_PaillierPrivateKey 368struct GNUNET_CRYPTO_PaillierPrivateKey
369{ 369{
diff --git a/src/rest/gnunet-rest-server.c b/src/rest/gnunet-rest-server.c
index 5415937a7..c14b09819 100644
--- a/src/rest/gnunet-rest-server.c
+++ b/src/rest/gnunet-rest-server.c
@@ -154,11 +154,14 @@ do_httpd (void *cls);
154static void 154static void
155run_mhd_now () 155run_mhd_now ()
156{ 156{
157 if (NULL != 157 if (NULL != httpd_task)
158 httpd_task) 158 {
159 GNUNET_SCHEDULER_cancel (httpd_task); 159 GNUNET_SCHEDULER_cancel (httpd_task);
160 httpd_task = NULL;
161 }
160 httpd_task = GNUNET_SCHEDULER_add_now (&do_httpd, 162 httpd_task = GNUNET_SCHEDULER_add_now (&do_httpd,
161 NULL); 163 NULL);
164
162} 165}
163 166
164/** 167/**
@@ -449,7 +452,18 @@ kill_httpd ()
449 GNUNET_SCHEDULER_cancel (ltask6); 452 GNUNET_SCHEDULER_cancel (ltask6);
450 ltask6 = NULL; 453 ltask6 = NULL;
451 } 454 }
452} 455
456 if (NULL != lsock4)
457 {
458 GNUNET_NETWORK_socket_close (lsock4);
459 lsock4 = NULL;
460 }
461 if (NULL != lsock6)
462 {
463 GNUNET_NETWORK_socket_close (lsock6);
464 lsock6 = NULL;
465 }
466 }
453 467
454 468
455/** 469/**
@@ -499,7 +513,10 @@ schedule_httpd ()
499 wws = NULL; 513 wws = NULL;
500 } 514 }
501 if (NULL != httpd_task) 515 if (NULL != httpd_task)
516 {
502 GNUNET_SCHEDULER_cancel (httpd_task); 517 GNUNET_SCHEDULER_cancel (httpd_task);
518 httpd_task = NULL;
519 }
503 if ( (MHD_YES == haveto) || 520 if ( (MHD_YES == haveto) ||
504 (-1 != max)) 521 (-1 != max))
505 { 522 {
@@ -507,6 +524,7 @@ schedule_httpd ()
507 GNUNET_SCHEDULER_add_select (GNUNET_SCHEDULER_PRIORITY_DEFAULT, 524 GNUNET_SCHEDULER_add_select (GNUNET_SCHEDULER_PRIORITY_DEFAULT,
508 tv, wrs, wws, 525 tv, wrs, wws,
509 &do_httpd, NULL); 526 &do_httpd, NULL);
527
510 } 528 }
511 if (NULL != wrs) 529 if (NULL != wrs)
512 GNUNET_NETWORK_fdset_destroy (wrs); 530 GNUNET_NETWORK_fdset_destroy (wrs);
@@ -543,18 +561,23 @@ do_accept (void *cls)
543 const struct sockaddr *addr; 561 const struct sockaddr *addr;
544 socklen_t len; 562 socklen_t len;
545 563
564 GNUNET_assert (NULL != lsock);
546 if (lsock == lsock4) 565 if (lsock == lsock4)
547 ltask4 = NULL; 566 {
548 else
549 ltask6 = NULL;
550 if (lsock == lsock4)
551 ltask4 = GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL, 567 ltask4 = GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL,
552 lsock, 568 lsock,
553 &do_accept, lsock); 569 &do_accept, lsock);
554 else 570
571 }
572 else if (lsock == lsock6)
573 {
555 ltask6 = GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL, 574 ltask6 = GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL,
556 lsock, 575 lsock,
557 &do_accept, lsock); 576 &do_accept, lsock);
577
578 }
579 else
580 GNUNET_assert (0);
558 s = GNUNET_NETWORK_socket_accept (lsock, NULL, NULL); 581 s = GNUNET_NETWORK_socket_accept (lsock, NULL, NULL);
559 if (NULL == s) 582 if (NULL == s)
560 { 583 {
@@ -759,6 +782,7 @@ run (void *cls,
759 { 782 {
760 ltask6 = GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL, 783 ltask6 = GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL,
761 lsock6, &do_accept, lsock6); 784 lsock6, &do_accept, lsock6);
785
762 } 786 }
763 } 787 }
764 lsock4 = bind_v4 (); 788 lsock4 = bind_v4 ();
@@ -778,6 +802,7 @@ run (void *cls,
778 { 802 {
779 ltask4 = GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL, 803 ltask4 = GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL,
780 lsock4, &do_accept, lsock4); 804 lsock4, &do_accept, lsock4);
805
781 } 806 }
782 } 807 }
783 if ( (NULL == lsock4) && 808 if ( (NULL == lsock4) &&
@@ -824,10 +849,10 @@ main (int argc, char *const *argv)
824{ 849{
825 struct GNUNET_GETOPT_CommandLineOption options[] = { 850 struct GNUNET_GETOPT_CommandLineOption options[] = {
826 GNUNET_GETOPT_option_ulong ('p', 851 GNUNET_GETOPT_option_ulong ('p',
827 "port", 852 "port",
828 "PORT", 853 "PORT",
829 gettext_noop ("listen on specified port (default: 7776)"), 854 gettext_noop ("listen on specified port (default: 7776)"),
830 &port), 855 &port),
831 GNUNET_GETOPT_OPTION_END 856 GNUNET_GETOPT_OPTION_END
832 }; 857 };
833 static const char* err_page = 858 static const char* err_page =
diff --git a/src/rps/test_rps.c b/src/rps/test_rps.c
index 2cc1ac62e..6189557f6 100644
--- a/src/rps/test_rps.c
+++ b/src/rps/test_rps.c
@@ -325,6 +325,34 @@ typedef void (*PostTest) (void *cls, struct GNUNET_RPS_Handle *h);
325 */ 325 */
326typedef int (*EvaluationCallback) (void); 326typedef int (*EvaluationCallback) (void);
327 327
328/**
329 * @brief Do we have Churn?
330 */
331enum OPTION_CHURN {
332 /**
333 * @brief If we have churn this is set
334 */
335 HAVE_CHURN,
336 /**
337 * @brief If we have no churn this is set
338 */
339 HAVE_NO_CHURN,
340};
341
342/**
343 * @brief Is it ok to quit the test before the timeout?
344 */
345enum OPTION_QUICK_QUIT {
346 /**
347 * @brief It is ok for the test to quit before the timeout triggers
348 */
349 HAVE_QUICK_QUIT,
350
351 /**
352 * @brief It is NOT ok for the test to quit before the timeout triggers
353 */
354 HAVE_NO_QUICK_QUIT,
355};
328 356
329/** 357/**
330 * Structure to define a single test 358 * Structure to define a single test
@@ -377,9 +405,14 @@ struct SingleTestRun
377 uint32_t num_requests; 405 uint32_t num_requests;
378 406
379 /** 407 /**
380 * Run with churn 408 * Run with (-out) churn
381 */ 409 */
382 int have_churn; 410 enum OPTION_CHURN have_churn;
411
412 /**
413 * Quit test before timeout?
414 */
415 enum OPTION_QUICK_QUIT have_quick_quit;
383} cur_test_run; 416} cur_test_run;
384 417
385/** 418/**
@@ -801,8 +834,9 @@ default_reply_handle (void *cls,
801 rps_peer->num_recv_ids++; 834 rps_peer->num_recv_ids++;
802 } 835 }
803 836
804 if (0 == evaluate ()) 837 if (0 == evaluate () && HAVE_QUICK_QUIT == cur_test_run.have_quick_quit)
805 { 838 {
839 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test succeeded before timeout\n");
806 GNUNET_assert (NULL != shutdown_task); 840 GNUNET_assert (NULL != shutdown_task);
807 GNUNET_SCHEDULER_cancel (shutdown_task); 841 GNUNET_SCHEDULER_cancel (shutdown_task);
808 shutdown_task = GNUNET_SCHEDULER_add_now (&shutdown_op, NULL); 842 shutdown_task = GNUNET_SCHEDULER_add_now (&shutdown_op, NULL);
@@ -1143,7 +1177,7 @@ churn_test_cb (struct RPSPeer *rps_peer)
1143 } 1177 }
1144 1178
1145 /* Start churn */ 1179 /* Start churn */
1146 if (GNUNET_YES == cur_test_run.have_churn && NULL == churn_task) 1180 if (HAVE_CHURN == cur_test_run.have_churn && NULL == churn_task)
1147 { 1181 {
1148 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1182 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1149 "Starting churn task\n"); 1183 "Starting churn task\n");
@@ -1265,8 +1299,6 @@ manage_service_wrapper (unsigned int i, unsigned int j,
1265 struct OpListEntry *entry; 1299 struct OpListEntry *entry;
1266 uint32_t prob; 1300 uint32_t prob;
1267 1301
1268 GNUNET_assert (GNUNET_YES == rps_peers[j].online);
1269
1270 /* make sure that management operation is not already scheduled */ 1302 /* make sure that management operation is not already scheduled */
1271 if (NULL != rps_peers[j].entry_op_manage) 1303 if (NULL != rps_peers[j].entry_op_manage)
1272 { 1304 {
@@ -1288,10 +1320,6 @@ manage_service_wrapper (unsigned int i, unsigned int j,
1288 GNUNET_i2s (rps_peers[j].peer_id), 1320 GNUNET_i2s (rps_peers[j].peer_id),
1289 (PEER_GO_OFFLINE == delta) ? "offline" : "online"); 1321 (PEER_GO_OFFLINE == delta) ? "offline" : "online");
1290 1322
1291 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1292 "testbed_peers points to %p, peer 0 to %p\n",
1293 testbed_peers, testbed_peers[0]);
1294
1295 if (PEER_GO_OFFLINE == delta) 1323 if (PEER_GO_OFFLINE == delta)
1296 cancel_pending_req_rep (&rps_peers[j]); 1324 cancel_pending_req_rep (&rps_peers[j]);
1297 entry = make_oplist_entry (); 1325 entry = make_oplist_entry ();
@@ -1441,7 +1469,7 @@ profiler_cb (struct RPSPeer *rps_peer)
1441 } 1469 }
1442 1470
1443 /* Start churn */ 1471 /* Start churn */
1444 if (GNUNET_YES == cur_test_run.have_churn && NULL == churn_task) 1472 if (HAVE_CHURN == cur_test_run.have_churn && NULL == churn_task)
1445 { 1473 {
1446 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1474 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1447 "Starting churn task\n"); 1475 "Starting churn task\n");
@@ -1621,7 +1649,7 @@ main (int argc, char *argv[])
1621 cur_test_run.pre_test = NULL; 1649 cur_test_run.pre_test = NULL;
1622 cur_test_run.reply_handle = default_reply_handle; 1650 cur_test_run.reply_handle = default_reply_handle;
1623 cur_test_run.eval_cb = default_eval_cb; 1651 cur_test_run.eval_cb = default_eval_cb;
1624 cur_test_run.have_churn = GNUNET_YES; 1652 cur_test_run.have_churn = HAVE_CHURN;
1625 churn_task = NULL; 1653 churn_task = NULL;
1626 timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30); 1654 timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30);
1627 1655
@@ -1656,7 +1684,7 @@ main (int argc, char *argv[])
1656 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Test single request\n"); 1684 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Test single request\n");
1657 cur_test_run.name = "test-rps-single-req"; 1685 cur_test_run.name = "test-rps-single-req";
1658 cur_test_run.main_test = single_req_cb; 1686 cur_test_run.main_test = single_req_cb;
1659 cur_test_run.have_churn = GNUNET_NO; 1687 cur_test_run.have_churn = HAVE_NO_CHURN;
1660 } 1688 }
1661 1689
1662 else if (strstr (argv[0], "_delayed_reqs") != NULL) 1690 else if (strstr (argv[0], "_delayed_reqs") != NULL)
@@ -1664,7 +1692,7 @@ main (int argc, char *argv[])
1664 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test delayed requests\n"); 1692 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test delayed requests\n");
1665 cur_test_run.name = "test-rps-delayed-reqs"; 1693 cur_test_run.name = "test-rps-delayed-reqs";
1666 cur_test_run.main_test = delay_req_cb; 1694 cur_test_run.main_test = delay_req_cb;
1667 cur_test_run.have_churn = GNUNET_NO; 1695 cur_test_run.have_churn = HAVE_NO_CHURN;
1668 } 1696 }
1669 1697
1670 else if (strstr (argv[0], "_seed_big") != NULL) 1698 else if (strstr (argv[0], "_seed_big") != NULL)
@@ -1674,7 +1702,7 @@ main (int argc, char *argv[])
1674 cur_test_run.name = "test-rps-seed-big"; 1702 cur_test_run.name = "test-rps-seed-big";
1675 cur_test_run.main_test = seed_big_cb; 1703 cur_test_run.main_test = seed_big_cb;
1676 cur_test_run.eval_cb = no_eval; 1704 cur_test_run.eval_cb = no_eval;
1677 cur_test_run.have_churn = GNUNET_NO; 1705 cur_test_run.have_churn = HAVE_NO_CHURN;
1678 timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10); 1706 timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10);
1679 } 1707 }
1680 1708
@@ -1683,7 +1711,7 @@ main (int argc, char *argv[])
1683 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test seeding and requesting on a single peer\n"); 1711 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test seeding and requesting on a single peer\n");
1684 cur_test_run.name = "test-rps-single-peer-seed"; 1712 cur_test_run.name = "test-rps-single-peer-seed";
1685 cur_test_run.main_test = single_peer_seed_cb; 1713 cur_test_run.main_test = single_peer_seed_cb;
1686 cur_test_run.have_churn = GNUNET_NO; 1714 cur_test_run.have_churn = HAVE_NO_CHURN;
1687 } 1715 }
1688 1716
1689 else if (strstr (argv[0], "_seed_request") != NULL) 1717 else if (strstr (argv[0], "_seed_request") != NULL)
@@ -1691,7 +1719,7 @@ main (int argc, char *argv[])
1691 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test seeding and requesting on multiple peers\n"); 1719 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test seeding and requesting on multiple peers\n");
1692 cur_test_run.name = "test-rps-seed-request"; 1720 cur_test_run.name = "test-rps-seed-request";
1693 cur_test_run.main_test = seed_req_cb; 1721 cur_test_run.main_test = seed_req_cb;
1694 cur_test_run.have_churn = GNUNET_NO; 1722 cur_test_run.have_churn = HAVE_NO_CHURN;
1695 } 1723 }
1696 1724
1697 else if (strstr (argv[0], "_seed") != NULL) 1725 else if (strstr (argv[0], "_seed") != NULL)
@@ -1700,7 +1728,7 @@ main (int argc, char *argv[])
1700 cur_test_run.name = "test-rps-seed"; 1728 cur_test_run.name = "test-rps-seed";
1701 cur_test_run.main_test = seed_cb; 1729 cur_test_run.main_test = seed_cb;
1702 cur_test_run.eval_cb = no_eval; 1730 cur_test_run.eval_cb = no_eval;
1703 cur_test_run.have_churn = GNUNET_NO; 1731 cur_test_run.have_churn = HAVE_NO_CHURN;
1704 } 1732 }
1705 1733
1706 else if (strstr (argv[0], "_req_cancel") != NULL) 1734 else if (strstr (argv[0], "_req_cancel") != NULL)
@@ -1710,7 +1738,7 @@ main (int argc, char *argv[])
1710 num_peers = 1; 1738 num_peers = 1;
1711 cur_test_run.main_test = req_cancel_cb; 1739 cur_test_run.main_test = req_cancel_cb;
1712 cur_test_run.eval_cb = no_eval; 1740 cur_test_run.eval_cb = no_eval;
1713 cur_test_run.have_churn = GNUNET_NO; 1741 cur_test_run.have_churn = HAVE_NO_CHURN;
1714 timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10); 1742 timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10);
1715 } 1743 }
1716 1744
@@ -1723,7 +1751,8 @@ main (int argc, char *argv[])
1723 cur_test_run.main_test = churn_test_cb; 1751 cur_test_run.main_test = churn_test_cb;
1724 cur_test_run.reply_handle = default_reply_handle; 1752 cur_test_run.reply_handle = default_reply_handle;
1725 cur_test_run.eval_cb = default_eval_cb; 1753 cur_test_run.eval_cb = default_eval_cb;
1726 cur_test_run.have_churn = GNUNET_YES; 1754 cur_test_run.have_churn = HAVE_CHURN;
1755 cur_test_run.have_quick_quit = HAVE_NO_QUICK_QUIT;
1727 timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10); 1756 timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10);
1728 } 1757 }
1729 1758
@@ -1740,8 +1769,9 @@ main (int argc, char *argv[])
1740 cur_test_run.eval_cb = profiler_eval; 1769 cur_test_run.eval_cb = profiler_eval;
1741 cur_test_run.request_interval = 2; 1770 cur_test_run.request_interval = 2;
1742 cur_test_run.num_requests = 5; 1771 cur_test_run.num_requests = 5;
1743 cur_test_run.have_churn = GNUNET_YES; 1772 cur_test_run.have_churn = HAVE_CHURN;
1744 timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 90); 1773 cur_test_run.have_quick_quit = HAVE_NO_QUICK_QUIT;
1774 timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 300);
1745 1775
1746 /* 'Clean' directory */ 1776 /* 'Clean' directory */
1747 (void) GNUNET_DISK_directory_remove ("/tmp/rps/"); 1777 (void) GNUNET_DISK_directory_remove ("/tmp/rps/");
diff --git a/src/util/scheduler.c b/src/util/scheduler.c
index 9d37231e7..279a4ed02 100644
--- a/src/util/scheduler.c
+++ b/src/util/scheduler.c
@@ -1659,8 +1659,7 @@ GNUNET_SCHEDULER_add_file_with_priority (struct GNUNET_TIME_Relative delay,
1659 1659
1660 1660
1661void 1661void
1662extract_handles (struct GNUNET_SCHEDULER_Task *t, 1662extract_handles (const struct GNUNET_NETWORK_FDSet *fdset,
1663 const struct GNUNET_NETWORK_FDSet *fdset,
1664 const struct GNUNET_NETWORK_Handle ***ntarget, 1663 const struct GNUNET_NETWORK_Handle ***ntarget,
1665 unsigned int *extracted_nhandles, 1664 unsigned int *extracted_nhandles,
1666 const struct GNUNET_DISK_FileHandle ***ftarget, 1665 const struct GNUNET_DISK_FileHandle ***ftarget,
@@ -1673,7 +1672,6 @@ extract_handles (struct GNUNET_SCHEDULER_Task *t,
1673 unsigned int nhandles_len; 1672 unsigned int nhandles_len;
1674 unsigned int fhandles_len; 1673 unsigned int fhandles_len;
1675 1674
1676 (void) t;
1677 nhandles = NULL; 1675 nhandles = NULL;
1678 fhandles = NULL; 1676 fhandles = NULL;
1679 nhandles_len = 0; 1677 nhandles_len = 0;
@@ -1748,57 +1746,63 @@ GNUNET_SCHEDULER_add_select (enum GNUNET_SCHEDULER_Priority prio,
1748 void *task_cls) 1746 void *task_cls)
1749{ 1747{
1750 struct GNUNET_SCHEDULER_Task *t; 1748 struct GNUNET_SCHEDULER_Task *t;
1751 const struct GNUNET_NETWORK_Handle **read_nhandles; 1749 const struct GNUNET_NETWORK_Handle **read_nhandles = NULL;
1752 const struct GNUNET_NETWORK_Handle **write_nhandles; 1750 const struct GNUNET_NETWORK_Handle **write_nhandles = NULL;
1753 const struct GNUNET_DISK_FileHandle **read_fhandles; 1751 const struct GNUNET_DISK_FileHandle **read_fhandles = NULL;
1754 const struct GNUNET_DISK_FileHandle **write_fhandles; 1752 const struct GNUNET_DISK_FileHandle **write_fhandles = NULL;
1755 unsigned int read_nhandles_len, write_nhandles_len, 1753 unsigned int read_nhandles_len = 0;
1756 read_fhandles_len, write_fhandles_len; 1754 unsigned int write_nhandles_len = 0;
1757 int no_fdsets = (NULL == rs) && (NULL == ws); 1755 unsigned int read_fhandles_len = 0;
1758 int no_socket_descriptors = 1756 unsigned int write_fhandles_len = 0;
1759 ((NULL != rs) && (0 == rs->nsds)) && ((NULL != ws) && (0 == ws->nsds)); 1757
1760
1761 if (no_fdsets || no_socket_descriptors)
1762 return GNUNET_SCHEDULER_add_delayed_with_priority (delay,
1763 prio,
1764 task,
1765 task_cls);
1766 /* scheduler must be running */ 1758 /* scheduler must be running */
1767 GNUNET_assert (NULL != scheduler_driver); 1759 GNUNET_assert (NULL != scheduler_driver);
1768 GNUNET_assert (NULL != active_task); 1760 GNUNET_assert (NULL != active_task);
1769 GNUNET_assert (NULL != task); 1761 GNUNET_assert (NULL != task);
1770 t = GNUNET_new (struct GNUNET_SCHEDULER_Task); 1762 int no_rs = (NULL == rs);
1771 t->callback = task; 1763 int no_ws = (NULL == ws);
1772 t->callback_cls = task_cls; 1764 int empty_rs = (NULL != rs) && (0 == rs->nsds);
1773 t->read_fd = -1; 1765 int empty_ws = (NULL != ws) && (0 == ws->nsds);
1774 t->write_fd = -1; 1766 int no_fds = (no_rs && no_ws) ||
1775 t->own_handles = GNUNET_YES; 1767 (empty_rs && empty_ws) ||
1776 read_nhandles = NULL; 1768 (no_rs && empty_ws) ||
1777 write_nhandles = NULL; 1769 (no_ws && empty_rs);
1778 read_fhandles = NULL; 1770 if (! no_fds)
1779 write_fhandles = NULL;
1780 read_nhandles_len = 0;
1781 write_nhandles_len = 0;
1782 read_fhandles_len = 0;
1783 write_fhandles_len = 0;
1784 if (NULL != rs)
1785 {
1786 extract_handles (t,
1787 rs,
1788 &read_nhandles,
1789 &read_nhandles_len,
1790 &read_fhandles,
1791 &read_fhandles_len);
1792 }
1793 if (NULL != ws)
1794 { 1771 {
1795 extract_handles (t, 1772 if (NULL != rs)
1796 ws, 1773 {
1797 &write_nhandles, 1774 extract_handles (rs,
1798 &write_nhandles_len, 1775 &read_nhandles,
1799 &write_fhandles, 1776 &read_nhandles_len,
1800 &write_fhandles_len); 1777 &read_fhandles,
1778 &read_fhandles_len);
1779 }
1780 if (NULL != ws)
1781 {
1782 extract_handles (ws,
1783 &write_nhandles,
1784 &write_nhandles_len,
1785 &write_fhandles,
1786 &write_fhandles_len);
1787 }
1801 } 1788 }
1789 /**
1790 * here we consider the case that a GNUNET_NETWORK_FDSet might be empty
1791 * although its maximum FD number (nsds) is greater than 0. We handle
1792 * this case gracefully because some libraries such as libmicrohttpd
1793 * only provide a hint what the maximum FD number in an FD set might be
1794 * and not the exact FD number (see e.g. gnunet-rest-service.c)
1795 */
1796 int no_fds_extracted = (0 == read_nhandles_len) &&
1797 (0 == read_fhandles_len) &&
1798 (0 == write_nhandles_len) &&
1799 (0 == write_fhandles_len);
1800 if (no_fds || no_fds_extracted)
1801 return GNUNET_SCHEDULER_add_delayed_with_priority (delay,
1802 prio,
1803 task,
1804 task_cls);
1805 t = GNUNET_new (struct GNUNET_SCHEDULER_Task);
1802 init_fd_info (t, 1806 init_fd_info (t,
1803 read_nhandles, 1807 read_nhandles,
1804 read_nhandles_len, 1808 read_nhandles_len,
@@ -1808,6 +1812,9 @@ GNUNET_SCHEDULER_add_select (enum GNUNET_SCHEDULER_Priority prio,
1808 read_fhandles_len, 1812 read_fhandles_len,
1809 write_fhandles, 1813 write_fhandles,
1810 write_fhandles_len); 1814 write_fhandles_len);
1815 t->callback = task;
1816 t->callback_cls = task_cls;
1817 t->own_handles = GNUNET_YES;
1811 /* free the arrays of pointers to network / file handles, the actual 1818 /* free the arrays of pointers to network / file handles, the actual
1812 * handles will be freed in destroy_task */ 1819 * handles will be freed in destroy_task */
1813 GNUNET_array_grow (read_nhandles, read_nhandles_len, 0); 1820 GNUNET_array_grow (read_nhandles, read_nhandles_len, 0);
@@ -2006,7 +2013,7 @@ GNUNET_SCHEDULER_run_from_driver (struct GNUNET_SCHEDULER_Handle *sh)
2006 if (GNUNET_OK != del_result) 2013 if (GNUNET_OK != del_result)
2007 { 2014 {
2008 LOG (GNUNET_ERROR_TYPE_ERROR, 2015 LOG (GNUNET_ERROR_TYPE_ERROR,
2009 "driver could not delete task\n"); 2016 "driver could not delete task %p\n", pos);
2010 GNUNET_assert (0); 2017 GNUNET_assert (0);
2011 } 2018 }
2012 } 2019 }