paragraph for gnunet devs that don't know how to use the web
[oweals/gnunet.git] / guix-env.scm
1 ;;; This file is part of GNUnet.
2 ;;; Copyright (C) 2016, 2017, 2018 GNUnet e.V.
3 ;;;
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.
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 ;;; Affero General Public License for more details.
13 ;;;
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/>.
16
17 (use-modules
18  (ice-9 popen)
19  (ice-9 match)
20  (ice-9 rdelim)
21  (guix packages)
22  (guix build-system gnu)
23  (guix gexp)
24  ((guix build utils) #:select (with-directory-excursion))
25  (guix git-download)
26  (guix utils) ; current-source-directory
27  (gnu packages)
28  (gnu packages aidc)
29  (gnu packages autotools)
30  (gnu packages backup)
31  (gnu packages base)
32  (gnu packages compression)
33  (gnu packages curl)
34  (gnu packages databases)
35  (gnu packages file)
36  (gnu packages gettext)
37  (gnu packages glib)
38  (gnu packages gnome)
39  (gnu packages gnunet)
40  (gnu packages gnupg)
41  (gnu packages gnuzilla)
42  (gnu packages groff)
43  (gnu packages gstreamer)
44  (gnu packages gtk)
45  (gnu packages guile)
46  (gnu packages image)
47  (gnu packages image-viewers)
48  (gnu packages libidn)
49  (gnu packages libunistring)
50  (gnu packages linux)
51  (gnu packages maths)
52  (gnu packages multiprecision)
53  (gnu packages perl)
54  (gnu packages pkg-config)
55  (gnu packages pulseaudio)
56  (gnu packages python)
57  (gnu packages tex)
58  (gnu packages texinfo)
59  (gnu packages tex)
60  (gnu packages tls)
61  (gnu packages upnp)
62  (gnu packages video)
63  (gnu packages web)
64  (gnu packages xiph)
65  ((guix licenses) #:prefix license:))
66
67 (define %source-dir (current-source-directory))
68
69 (define gnunet-dev-env
70   (let* ((revision "1")
71          (select? (delay (or (git-predicate
72                               (current-source-directory))
73                              source-file?))))
74     (package
75       (inherit gnunet)
76       (name "gnunet")
77       (version (string-append "git" revision))
78       (source
79        (local-file
80         (string-append (getcwd))
81         #:recursive? #t))
82       (inputs
83        `(("glpk" ,glpk)
84          ("gnurl" ,gnurl)
85          ("gstreamer" ,gstreamer)
86          ("gst-plugins-base" ,gst-plugins-base)
87          ("gnutls/dane" ,gnutls/dane)
88          ("libextractor" ,libextractor)
89          ("libgcrypt" ,libgcrypt)
90          ("libidn" ,libidn)
91          ("libmicrohttpd" ,libmicrohttpd)
92          ("libltdl" ,libltdl)
93          ("libunistring" ,libunistring)
94          ("openssl" ,openssl)
95          ("opus" ,opus)
96          ("pulseaudio" ,pulseaudio)
97          ("sqlite" ,sqlite)
98          ("postgresql" ,postgresql)
99          ("mysql" ,mysql)
100          ("zlib" ,zlib)
101          ("perl" ,perl)
102          ("python-2" ,python-2) ; tests and gnunet-qr
103          ("jansson" ,jansson)
104          ("nss" ,nss)
105          ("glib" ,glib "bin")
106          ("gmp" ,gmp)
107          ("bluez" ,bluez) ; for optional bluetooth feature
108          ("glib" ,glib)
109          ;; ("texlive" ,texlive) ;FIXME: minimize.
110          ("texlive-tiny" ,texlive-tiny) ;; Seems to be enough for _just_ info output.
111          ("miniupnpc" ,miniupnpc)
112          ("libogg" ,libogg)))
113       (native-inputs
114        `(("pkg-config" ,pkg-config)
115          ("autoconf" ,autoconf)
116          ("automake" ,automake)
117          ("gnu-gettext" ,gnu-gettext)
118          ("which" ,which)
119          ("texinfo" ,texinfo-5) ; Debian stable: 5.2
120          ("libtool" ,libtool)))
121       (outputs '("out" "debug"))
122       (arguments
123        `(;#:configure-flags
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")
130          #:phases
131          ;; swap check and install phases and set paths to installed bin
132          (modify-phases %standard-phases
133            (add-after 'unpack 'patch-bin-sh
134              (lambda _
135                (for-each (lambda (f) (chmod f #o755))
136                          (find-files "po" ""))
137                #t))
138            (add-after 'patch-bin-sh 'bootstrap
139              (lambda _
140                (zero? (system* "sh" "bootstrap"))))
141            ;;(add-before 'build 'chdir
142            ;; (lambda _
143            ;;  (chdir "doc/documentation")))
144            (delete 'check)
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")))))))))))
154
155 gnunet-dev-env