guix-env.scm: Small adjustments.
[oweals/gnunet.git] / guix-env.scm
1 ;;; This file is part of GNUnet.
2 ;;; Copyright (C) 2016, 2017 GNUnet e.V.
3 ;;;
4 ;;; GNUnet is free software; you can redistribute it and/or modify
5 ;;; it under the terms of the GNU General Public License as published
6 ;;; by the Free Software Foundation; either version 3, or (at your
7 ;;; 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 ;;; General Public License for more details.
13 ;;;
14 ;;; You should have received a copy of the GNU General Public License
15 ;;; along with GNUnet; see the file COPYING.  If not, write to the
16 ;;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 ;;; Boston, MA 02110-1301, USA.
18 ;;;
19 ;; Guix package for GNUnet development
20 ;;
21 ;; INSTALL
22 ;; -------
23 ;;
24 ;; To build and install the package in the user environment, use:
25 ;;
26 ;; guix package --install-from-file=guix-env.scm
27 ;;
28 ;; BUILD ONLY
29 ;; ----------
30 ;;
31 ;; Precondition for using this file is that you run Guix and have a
32 ;; development setup for this setup, which involves a version of Guile in
33 ;; your PATH.
34 ;;
35 ;; guix build -f guix-env.scm
36 ;;
37 ;; We'd like to provide advanced functions such as guix environment specific
38 ;; gnunet-git package and usage of gnunet-gtk-git, but this is subject
39 ;; to tests right now.
40 ;;
41 ;; Further versions of GNUnet for Guix can currently be found in
42 ;; https://gitweb.krosos.org/ng0_guix/packages.git/
43
44 (use-modules
45  (ice-9 popen)
46  (ice-9 match)
47  (ice-9 rdelim)
48  (guix packages)
49  (guix build-system gnu)
50  (guix gexp)
51  ((guix build utils) #:select (with-directory-excursion))
52  (guix git-download)
53  (gnu packages)
54  (gnu packages aidc)
55  (gnu packages autotools)
56  (gnu packages backup)
57  (gnu packages base)
58  (gnu packages compression)
59  (gnu packages curl)
60  (gnu packages databases)
61  (gnu packages file)
62  (gnu packages gettext)
63  (gnu packages glib)
64  (gnu packages gnome)
65  (gnu packages gnunet)
66  (gnu packages gnupg)
67  (gnu packages gnuzilla)
68  (gnu packages groff)
69  (gnu packages gstreamer)
70  (gnu packages gtk)
71  (gnu packages guile)
72  (gnu packages image)
73  (gnu packages image-viewers)
74  (gnu packages libidn)
75  (gnu packages libunistring)
76  (gnu packages linux)
77  (gnu packages maths)
78  (gnu packages multiprecision)
79  (gnu packages perl)
80  (gnu packages pkg-config)
81  (gnu packages pulseaudio)
82  (gnu packages python)
83  (gnu packages tex)
84  (gnu packages tls)
85  (gnu packages video)
86  (gnu packages web)
87  (gnu packages xiph)
88  ((guix licenses) #:prefix license:))
89
90 (define %source-dir (dirname (current-filename)))
91
92 (define gnunet-git
93   (let* ((revision "1"))
94     (package
95       (name "gnunet-git")
96       (version (string-append "0.10.1-" revision "." "dev"))
97       (source
98        (local-file %source-dir
99                    #:recursive? #t))
100       (build-system gnu-build-system)
101       (inputs
102        `(("glpk" ,glpk)
103          ("gnurl" ,gnurl)
104          ("gstreamer" ,gstreamer)
105          ("gst-plugins-base" ,gst-plugins-base)
106          ("gnutls" ,gnutls)
107          ("libextractor" ,libextractor)
108          ("libgcrypt" ,libgcrypt)
109          ("libidn" ,libidn)
110          ("libmicrohttpd" ,libmicrohttpd)
111          ("libltdl" ,libltdl)
112          ("libunistring" ,libunistring)
113          ("openssl" ,openssl)
114          ("opus" ,opus)
115          ("pulseaudio" ,pulseaudio)
116          ("sqlite" ,sqlite)
117          ("postgresql" ,postgresql)
118          ("mysql" ,mysql)
119          ("zlib" ,zlib)
120          ("perl" ,perl)
121          ("python" ,python) ; tests and gnunet-qr
122          ("jansson" ,jansson)
123          ("nss" ,nss)
124          ("gmp" ,gmp)
125          ("bluez" ,bluez) ; for optional bluetooth feature
126          ("glib" ,glib)
127          ;; There are currently no binary substitutes for texlive on
128          ;; hydra.gnu.org or its mirrors due to its size. Uncomment if you need it.
129          ;;("texlive-minimal" ,texlive-minimal) ; optional.
130          ("libogg" ,libogg)))
131       (native-inputs
132        `(("pkg-config" ,pkg-config)
133          ("autoconf" ,autoconf)
134          ("automake" ,automake)
135          ("gnu-gettext" ,gnu-gettext)
136          ("libtool" ,libtool)))
137       ;; TODO:  To make use of out:debug, which carries the symbols,
138       ;; this file needs to fixed.
139       (outputs '("out" "debug"))
140       (arguments
141        `(#:configure-flags
142          (list (string-append "--with-nssdir=" %output "/lib")
143                "--enable-gcc-hardening"
144                "--enable-linker-hardening"
145
146                "--enable-poisoning"
147                "--enable-sanitizer"
148                "--enable-experimental"
149                "--enable-logging=verbose"
150                "CFLAGS=-ggdb -O0")
151          ;;#:parallel-tests? #f ; parallel building seems to fail
152          ;;#:tests? #f ; fail: test_gnunet_statistics.py
153          #:phases
154          ;; swap check and install phases and set paths to installed bin
155          (modify-phases %standard-phases
156            (add-after 'unpack 'patch-bin-sh
157              (lambda _
158                (substitute* "bootstrap"
159                  (("contrib/pogen.sh") "sh contrib/pogen.sh"))
160                (for-each (lambda (f) (chmod f #o755))
161                          (find-files "po" ""))
162                #t))
163            (add-after 'patch-bin-sh 'bootstrap
164              (lambda _
165                (zero? (system* "sh" "bootstrap"))))
166            (delete 'check))))
167       ;; XXX: https://gnunet.org/bugs/view.php?id=4619
168       ;; (add-after 'install 'set-path-for-check
169       ;;   (lambda* (#:key outputs #:allow-other-keys)
170       ;;     (let* ((out (assoc-ref outputs "out"))
171       ;;            (bin (string-append out "/bin"))
172       ;;            (lib (string-append out "/lib")))
173       ;;       (setenv "GNUNET_PREFIX" lib)
174       ;;       (setenv "PATH" (string-append (getenv "PATH") ":" bin))
175       ;;       (zero? (system* "make" "check"))))))))
176       (synopsis "Secure, decentralized, peer-to-peer networking framework")
177       (description
178        "GNUnet is a framework for secure peer-to-peer networking.  The
179 high-level goal is to provide a strong foundation of free software for a
180 global, distributed network that provides security and privacy.  GNUnet in
181 that sense aims to replace the current internet protocol stack.  Along with
182 an application for secure publication of files, it has grown to include all
183 kinds of basic applications for the foundation of a GNU internet.")
184       (license license:gpl3+)
185       (home-page "https://gnunet.org/"))))
186
187 gnunet-git