1 ;;; This file is part of GNUnet.
2 ;;; Copyright (C) 2016, 2017, 2018 GNUnet e.V.
4 ;;; GNUnet is free software: you can redistribute it and/or modify it
5 ;;; under the terms of the GNU Affero General Public License as published
6 ;;; by the Free Software Foundation, either version 3 of the License,
7 ;;; or (at your option) any later version.
9 ;;; GNUnet is distributed in the hope that it will be useful, but
10 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
11 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 ;;; Affero General Public License for more details.
14 ;;; You should have received a copy of the GNU Affero General Public License
15 ;;; along with this program. If not, see <http://www.gnu.org/licenses/>.
22 (guix build-system gnu)
24 ((guix build utils) #:select (with-directory-excursion))
26 (guix utils) ; current-source-directory
29 (gnu packages autotools)
32 (gnu packages compression)
34 (gnu packages databases)
36 (gnu packages gettext)
41 (gnu packages gnuzilla)
43 (gnu packages gstreamer)
47 (gnu packages image-viewers)
49 (gnu packages libunistring)
52 (gnu packages multiprecision)
54 (gnu packages pkg-config)
55 (gnu packages pulseaudio)
58 (gnu packages texinfo)
65 ((guix licenses) #:prefix license:))
67 (define %source-dir (current-source-directory))
69 (define gnunet-dev-env
71 (select? (delay (or (git-predicate
72 (current-source-directory))
77 (version (string-append "git" revision))
80 (string-append (getcwd))
85 ("gstreamer" ,gstreamer)
86 ("gst-plugins-base" ,gst-plugins-base)
87 ("gnutls/dane" ,gnutls/dane)
88 ("libextractor" ,libextractor)
89 ("libgcrypt" ,libgcrypt)
91 ("libmicrohttpd" ,libmicrohttpd)
93 ("libunistring" ,libunistring)
96 ("pulseaudio" ,pulseaudio)
98 ("postgresql" ,postgresql)
102 ("python-2" ,python-2) ; tests and gnunet-qr
103 ("python2-future" ,python2-future)
108 ("bluez" ,bluez) ; for optional bluetooth feature
110 ;; ("texlive" ,texlive) ;FIXME: minimize.
111 ("texlive-tiny" ,texlive-tiny) ;; Seems to be enough for _just_ info output.
112 ("miniupnpc" ,miniupnpc)
115 `(("pkg-config" ,pkg-config)
116 ("autoconf" ,autoconf)
117 ("automake" ,automake)
118 ("gnu-gettext" ,gnu-gettext)
120 ("texinfo" ,texinfo-5) ; Debian stable: 5.2
121 ("libtool" ,libtool)))
122 (outputs '("out" "debug"))
125 ;;(list (string-append "--with-nssdir=" %output "/lib")
126 ;;"--enable-gcc-hardening"
127 ;;"--enable-linker-hardening"
128 ;;;;"--enable-documentation-only")
129 ;;;"--enable-logging=verbose"
130 ;;;"CFLAGS=-ggdb -O0")
132 ;; swap check and install phases and set paths to installed bin
133 (modify-phases %standard-phases
134 (add-after 'unpack 'patch-bin-sh
136 (for-each (lambda (f) (chmod f #o755))
137 (find-files "po" ""))
139 (add-after 'patch-bin-sh 'bootstrap
141 (invoke "sh" "bootstrap")))
142 ;;(add-before 'build 'chdir
144 ;; (chdir "doc/documentation")))
146 ;; XXX: https://gnunet.org/bugs/view.php?id=4619
147 (add-after 'install 'set-path-for-check
148 (lambda* (#:key outputs #:allow-other-keys)
149 (let* ((out (assoc-ref outputs "out"))
150 (bin (string-append out "/bin"))
151 (lib (string-append out "/lib")))
152 (setenv "GNUNET_PREFIX" lib)
153 (setenv "PATH" (string-append (getenv "PATH") ":" bin))
154 (invoke "make" "check"))))))))))