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
107 ("bluez" ,bluez) ; for optional bluetooth feature
109 ;; ("texlive" ,texlive) ;FIXME: minimize.
110 ("texlive-tiny" ,texlive-tiny) ;; Seems to be enough for _just_ info output.
111 ("miniupnpc" ,miniupnpc)
114 `(("pkg-config" ,pkg-config)
115 ("autoconf" ,autoconf)
116 ("automake" ,automake)
117 ("gnu-gettext" ,gnu-gettext)
119 ("texinfo" ,texinfo-5) ; Debian stable: 5.2
120 ("libtool" ,libtool)))
121 (outputs '("out" "debug"))
124 ;;(list (string-append "--with-nssdir=" %output "/lib")
125 ;;"--enable-gcc-hardening"
126 ;;"--enable-linker-hardening"
127 ;;;;"--enable-documentation-only")
128 ;;;"--enable-logging=verbose"
129 ;;;"CFLAGS=-ggdb -O0")
131 ;; swap check and install phases and set paths to installed bin
132 (modify-phases %standard-phases
133 (add-after 'unpack 'patch-bin-sh
135 (for-each (lambda (f) (chmod f #o755))
136 (find-files "po" ""))
138 (add-after 'patch-bin-sh 'bootstrap
140 (zero? (system* "sh" "bootstrap"))))
141 ;;(add-before 'build 'chdir
143 ;; (chdir "doc/documentation")))
145 ;; XXX: https://gnunet.org/bugs/view.php?id=4619
146 (add-after 'install 'set-path-for-check
147 (lambda* (#:key outputs #:allow-other-keys)
148 (let* ((out (assoc-ref outputs "out"))
149 (bin (string-append out "/bin"))
150 (lib (string-append out "/lib")))
151 (setenv "GNUNET_PREFIX" lib)
152 (setenv "PATH" (string-append (getenv "PATH") ":" bin))
153 (zero? (system* "make" "check")))))))))))