Merge remote-tracking branch 'origin/master' into credentials
[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-svn package, but this is subject to tests right now.
39 ;;
40 ;; Further versions of GNUnet for Guix can currently be found in
41 ;; https://git.pragmatique.xyz/ng0-packages/log.html, mirrored at
42 ;; https://notabug.org/ng0/ng0-packages
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  (gnu packages)
53  (gnu packages aidc)
54  (gnu packages autotools)
55  (gnu packages backup)
56  (gnu packages base)
57  (gnu packages compression)
58  (gnu packages curl)
59  (gnu packages databases)
60  (gnu packages file)
61  (gnu packages gettext)
62  (gnu packages glib)
63  (gnu packages gnome)
64  (gnu packages gnunet)
65  (gnu packages gnupg)
66  (gnu packages gnuzilla)
67  (gnu packages groff)
68  (gnu packages gstreamer)
69  (gnu packages gtk)
70  (gnu packages guile)
71  (gnu packages image)
72  (gnu packages image-viewers)
73  (gnu packages libidn)
74  (gnu packages libunistring)
75  (gnu packages linux)
76  (gnu packages maths)
77  (gnu packages multiprecision)
78  (gnu packages perl)
79  (gnu packages pkg-config)
80  (gnu packages pulseaudio)
81  (gnu packages python)
82  (gnu packages tex)
83  (gnu packages tls)
84  (gnu packages video)
85  (gnu packages web)
86  (gnu packages xiph)
87  ((guix licenses) #:prefix license:))
88
89 (define %source-dir (dirname (current-filename)))
90
91 (define gnunet-git
92   (package
93     (name "gnunet-git")
94     (version (string-append "0.10.1-" "dev"))
95     (source
96      (local-file %source-dir
97                  #:recursive? #t))
98     (build-system gnu-build-system)
99     (inputs
100      `(("glpk" ,glpk)
101        ("gnurl" ,gnurl)
102        ("gstreamer" ,gstreamer)
103        ("gst-plugins-base" ,gst-plugins-base)
104        ("gnutls" ,gnutls)
105        ("libextractor" ,libextractor)
106        ("libgcrypt" ,libgcrypt)
107        ("libidn" ,libidn)
108        ("libmicrohttpd" ,libmicrohttpd)
109        ("libltdl" ,libltdl)
110        ("libunistring" ,libunistring)
111        ("openssl" ,openssl)
112        ("opus" ,opus)
113        ("pulseaudio" ,pulseaudio)
114        ("sqlite" ,sqlite)
115        ("postgresql" ,postgresql)
116        ("mysql" ,mysql)
117        ("zlib" ,zlib)
118        ("perl" ,perl)
119        ("python" ,python) ; tests and gnunet-qr
120        ("jansson" ,jansson)
121        ("nss" ,nss)
122        ("gmp" ,gmp)
123        ("bluez" ,bluez) ; for optional bluetooth feature
124        ("glib" ,glib)
125        ;; There are currently no binary substitutes for texlive on
126        ;; hydra.gnu.org or its mirrors due to its size. Uncomment if you need it.
127        ;;("texlive-minimal" ,texlive-minimal) ; optional.
128        ("libogg" ,libogg)))
129     (native-inputs
130      `(("pkg-config" ,pkg-config)
131        ("autoconf" ,autoconf)
132        ("automake" ,automake)
133        ("gnu-gettext" ,gnu-gettext)
134        ("libtool" ,libtool)))
135     ;; TODO:  To make use of out:debug, which carries the symbols,
136     ;; this file needs to fixed.
137     (outputs '("out" "debug"))
138     (arguments
139      `(#:configure-flags
140        (list (string-append "--with-nssdir=" %output "/lib")
141              ;; These appear to be "broken" on Guix, needs debugging.
142              "--enable-gcc-hardening"
143              "--enable-linker-hardening"
144
145              "--enable-poisoning"
146              "--enable-sanitizer"
147              "--enable-experimental"
148              "--enable-logging=verbose"
149              "CFLAGS=-ggdb -O0")
150        ;;#:parallel-tests? #f ; parallel building seems to fail
151        ;;#:tests? #f ; fail: test_gnunet_statistics.py
152        #:phases
153        ;; swap check and install phases and set paths to installed bin
154        (modify-phases %standard-phases
155          (add-after 'unpack 'patch-bin-sh
156            (lambda _
157              (substitute* "bootstrap"
158                (("contrib/pogen.sh") "sh contrib/pogen.sh"))
159              (for-each (lambda (f) (chmod f #o755))
160                        (find-files "po" ""))
161              #t))
162          (add-after 'patch-bin-sh 'bootstrap
163            (lambda _
164              (zero? (system* "sh" "bootstrap"))))
165          (delete 'check))))
166     ;; XXX: https://gnunet.org/bugs/view.php?id=4619
167     ;; (add-after 'install 'set-path-for-check
168     ;;   (lambda* (#:key outputs #:allow-other-keys)
169     ;;     (let* ((out (assoc-ref outputs "out"))
170     ;;            (bin (string-append out "/bin"))
171     ;;            (lib (string-append out "/lib")))
172     ;;       (setenv "GNUNET_PREFIX" lib)
173     ;;       (setenv "PATH" (string-append (getenv "PATH") ":" bin))
174     ;;       (zero? (system* "make" "check"))))))))
175     (synopsis "Secure, decentralized, peer-to-peer networking framework")
176     (description
177      "GNUnet is a framework for secure peer-to-peer networking.  The
178 high-level goal is to provide a strong foundation of free software for a
179 global, distributed network that provides security and privacy.  GNUnet in
180 that sense aims to replace the current internet protocol stack.  Along with
181 an application for secure publication of files, it has grown to include all
182 kinds of basic applications for the foundation of a GNU internet.")
183     (license license:gpl3+)
184     (home-page "https://gnunet.org/")))
185
186 gnunet-git