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.
19 (guix build-system gnu)
21 ((guix build utils) #:select (with-directory-excursion))
23 (guix utils) ; current-source-directory
26 (gnu packages autotools)
29 (gnu packages compression)
31 (gnu packages databases)
33 (gnu packages gettext)
38 (gnu packages gnuzilla)
40 (gnu packages gstreamer)
44 (gnu packages image-viewers)
46 (gnu packages libunistring)
49 (gnu packages multiprecision)
51 (gnu packages pkg-config)
52 (gnu packages pulseaudio)
55 (gnu packages texinfo)
62 ((guix licenses) #:prefix license:))
64 (define %source-dir (current-source-directory))
66 (define gnunet-dev-env
68 (select? (delay (or (git-predicate
69 (current-source-directory))
74 (version (string-append "git" revision))
77 (string-append (getcwd))
82 ("gstreamer" ,gstreamer)
83 ("gst-plugins-base" ,gst-plugins-base)
84 ("gnutls/dane" ,gnutls/dane)
85 ("libextractor" ,libextractor)
86 ("libgcrypt" ,libgcrypt)
88 ("libmicrohttpd" ,libmicrohttpd)
90 ("libunistring" ,libunistring)
93 ("pulseaudio" ,pulseaudio)
95 ("postgresql" ,postgresql)
99 ("python-2" ,python-2) ; tests and gnunet-qr
104 ("bluez" ,bluez) ; for optional bluetooth feature
106 ;; ("texlive" ,texlive) ;FIXME: minimize.
107 ("texlive-tiny" ,texlive-tiny) ;; Seems to be enough for _just_ info output.
108 ("miniupnpc" ,miniupnpc)
111 `(("pkg-config" ,pkg-config)
112 ("autoconf" ,autoconf)
113 ("automake" ,automake)
114 ("gnu-gettext" ,gnu-gettext)
116 ("texinfo" ,texinfo-5) ; Debian stable: 5.2
117 ("libtool" ,libtool)))
118 (outputs '("out" "debug"))
121 ;;(list (string-append "--with-nssdir=" %output "/lib")
122 ;;"--enable-gcc-hardening"
123 ;;"--enable-linker-hardening"
124 ;;;;"--enable-documentation-only")
125 ;;;"--enable-logging=verbose"
126 ;;;"CFLAGS=-ggdb -O0")
128 ;; swap check and install phases and set paths to installed bin
129 (modify-phases %standard-phases
130 (add-after 'unpack 'patch-bin-sh
132 (for-each (lambda (f) (chmod f #o755))
133 (find-files "po" ""))
135 (add-after 'patch-bin-sh 'bootstrap
137 (zero? (system* "sh" "bootstrap"))))
138 ;;(add-before 'build 'chdir
140 ;; (chdir "doc/documentation")))
142 ;; XXX: https://gnunet.org/bugs/view.php?id=4619
143 (add-after 'install 'set-path-for-check
144 (lambda* (#:key outputs #:allow-other-keys)
145 (let* ((out (assoc-ref outputs "out"))
146 (bin (string-append out "/bin"))
147 (lib (string-append out "/lib")))
148 (setenv "GNUNET_PREFIX" lib)
149 (setenv "PATH" (string-append (getenv "PATH") ":" bin))
150 (zero? (system* "make" "check")))))))))))