introduce API functions for duplicating the DNSPARSER record types
[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" ,mariadb)
100          ("zlib" ,zlib)
101          ("perl" ,perl)
102          ("python-2" ,python-2) ; tests and gnunet-qr
103          ("python2-future" ,python2-future)
104          ("jansson" ,jansson)
105          ("nss" ,nss)
106          ("glib" ,glib "bin")
107          ("gmp" ,gmp)
108          ("bluez" ,bluez) ; for optional bluetooth feature
109          ("glib" ,glib)
110          ;; ("texlive" ,texlive) ;FIXME: minimize.
111          ("texlive-tiny" ,texlive-tiny) ;; Seems to be enough for _just_ info output.
112          ("miniupnpc" ,miniupnpc)
113          ("libogg" ,libogg)))
114       (native-inputs
115        `(("pkg-config" ,pkg-config)
116          ("autoconf" ,autoconf)
117          ("automake" ,automake)
118          ("gnu-gettext" ,gnu-gettext)
119          ("which" ,which)
120          ("texinfo" ,texinfo-5) ; Debian stable: 5.2
121          ("libtool" ,libtool)))
122       (outputs '("out" "debug"))
123       (arguments
124        `(;#:configure-flags
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")
131          #:phases
132          ;; swap check and install phases and set paths to installed bin
133          (modify-phases %standard-phases
134            (add-after 'unpack 'patch-bin-sh
135              (lambda _
136                (for-each (lambda (f) (chmod f #o755))
137                          (find-files "po" ""))
138                #t))
139            (add-after 'patch-bin-sh 'bootstrap
140              (lambda _
141                (invoke "sh" "bootstrap")))
142            ;;(add-before 'build 'chdir
143            ;; (lambda _
144            ;;  (chdir "doc/documentation")))
145            (delete 'check)
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"))))))))))
155
156 gnunet-dev-env