doc: start work on mdoc generation support
[oweals/gnunet.git] / contrib / packages / guix / guix-env-gillmann.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
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 (use-modules
20  (ice-9 popen)
21  (ice-9 match)
22  (ice-9 rdelim)
23  (guix packages)
24  (guix build-system gnu)
25  (guix gexp)
26  ((guix build utils) #:select (with-directory-excursion))
27  (guix git-download)
28  (guix utils) ; current-source-directory
29  (gnu packages)
30  (gnu packages aidc)
31  (gnu packages autotools)
32  (gnu packages backup)
33  (gnu packages base)
34  (gnu packages compression)
35  (gnu packages curl)
36  (gnu packages databases)
37  (gnu packages file)
38  (gnu packages gettext)
39  (gnu packages glib)
40  (gnu packages gnome)
41  (gnu packages gnunet)
42  (gnu packages gnupg)
43  (gnu packages gnuzilla)
44  (gnu packages groff)
45  (gnu packages gstreamer)
46  (gnu packages gtk)
47  (gnu packages guile)
48  (gnu packages image)
49  (gnu packages image-viewers)
50  (gnu packages libidn)
51  (gnu packages libunistring)
52  (gnu packages linux)
53  (gnu packages maths)
54  (gnu packages multiprecision)
55  (gnu packages perl)
56  (gnu packages pkg-config)
57  (gnu packages pulseaudio)
58  (gnu packages python)
59  (gnu packages tex)
60  (gnu packages texinfo)
61  (gnu packages tex)
62  (gnu packages tls)
63  (gnu packages upnp)
64  (gnu packages video)
65  (gnu packages web)
66  (gnu packages xiph)
67  (ports app-text mandoc mandoc)
68  (ports app-text texi2mdoc texi2mdoc)
69  ((guix licenses) #:prefix license:))
70
71 (define %source-dir (current-source-directory))
72
73 (define gnunet-dev-env
74   (let* ((revision "1")
75          (select? (delay (or (git-predicate
76                               (current-source-directory))
77                              source-file?))))
78     (package
79       (inherit gnunet)
80       (name "gnunet")
81       (version (string-append "git" revision))
82       (source
83        (local-file
84         (string-append (getcwd))
85         #:recursive? #t))
86       (inputs
87        `(("glpk" ,glpk)
88          ("gnurl" ,gnurl)
89          ("gstreamer" ,gstreamer)
90          ("gst-plugins-base" ,gst-plugins-base)
91          ("gnutls/dane" ,gnutls/dane)
92          ("iptables" ,iptables)
93          ("libextractor" ,libextractor)
94          ("libgcrypt" ,libgcrypt)
95          ("libidn" ,libidn)
96          ("libmicrohttpd" ,libmicrohttpd)
97          ("libltdl" ,libltdl)
98          ("libunistring" ,libunistring)
99          ("openssl" ,openssl)
100          ("opus" ,opus)
101          ("pulseaudio" ,pulseaudio)
102          ("sqlite" ,sqlite)
103          ("postgresql" ,postgresql)
104          ("mariadb" ,mariadb)
105          ("zlib" ,zlib)
106          ("perl" ,perl)
107          ("python-2" ,python-2) ; tests and gnunet-qr
108          ("jansson" ,jansson)
109          ("nss" ,nss)
110          ("glib" ,glib "bin")
111          ("gmp" ,gmp)
112          ("bluez" ,bluez) ; for optional bluetooth feature
113          ("glib" ,glib)
114          ;; ("texlive" ,texlive) ;FIXME: minimize.
115          ("texlive-tiny" ,texlive-tiny) ;; Seems to be enough for _just_ info output.
116          ("miniupnpc" ,miniupnpc)
117          ("libogg" ,libogg)))
118       (native-inputs
119        `(("pkg-config" ,pkg-config)
120          ("autoconf" ,autoconf)
121          ("automake" ,automake)
122          ("gnu-gettext" ,gnu-gettext)
123          ("which" ,which)
124          ("mandoc" ,mandoc)
125          ("texi2mdoc" ,texi2mdoc)
126          ("texinfo" ,texinfo-5) ; Debian stable: 5.2
127          ("libtool" ,libtool)))
128       (outputs '("out" "debug"))
129       ;;#:configure-flags
130       ;;(list (string-append "--with-nssdir=" %output "/lib")
131       ;;"--enable-gcc-hardening"
132       ;;"--enable-linker-hardening"
133       ;;;;"--enable-documentation-only")
134       ;;;"--enable-logging=verbose"
135       ;;;"CFLAGS=-ggdb -O0")
136       (arguments
137        `(#:configure-flags (list "--enable-section7")
138          #:phases
139          ;; swap check and install phases and set paths to installed bin
140          (modify-phases %standard-phases
141            (add-after 'unpack 'patch-bin-sh
142              (lambda _
143                (for-each (lambda (f) (chmod f #o755))
144                          (find-files "po" ""))
145                #t))
146            (add-after 'patch-bin-sh 'bootstrap
147              (lambda _
148                (invoke "sh" "bootstrap")))
149            (add-after 'build 'install-section7
150              (lambda _
151                (with-directory-excursion "doc/documentation"
152                  (invoke "make" "gnunet-c-tutorial.7")
153                  (invoke "make" "gnunet-documentation.7")
154                  (mkdir-p (string-append (assoc-ref %outputs "out")
155                                          "/share/man/man7"))
156                  (copy-file "../man/gnunet-c-tutorial.7"
157                             (string-append (assoc-ref %outputs "out")
158                                            "/share/man/man7/gnunet-c-tutorial.7"))
159                  (copy-file "../man/gnunet-documentation.7"
160                             (string-append (assoc-ref %outputs "out")
161                                          "/share/man/man7/gnunet-documentation.7")))))
162            ;;(add-before 'build 'chdir
163            ;; (lambda _
164            ;;  (chdir "doc/documentation")))
165            (delete 'check)))))))
166 ;; XXX: https://gnunet.org/bugs/view.php?id=4619
167                              
168
169 gnunet-dev-env