distro: guile-1.8: Propagate GMP and Libtool.
[jackhill/guix/guix.git] / distro / base.scm
1 ;;; Guix --- Nix package management from Guile. -*- coding: utf-8 -*-
2 ;;; Copyright (C) 2012 Ludovic Courtès <ludo@gnu.org>
3 ;;;
4 ;;; This file is part of Guix.
5 ;;;
6 ;;; Guix is free software; you can redistribute it and/or modify it
7 ;;; under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation; either version 3 of the License, or (at
9 ;;; your option) any later version.
10 ;;;
11 ;;; Guix is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;; GNU General Public License for more details.
15 ;;;
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with Guix. If not, see <http://www.gnu.org/licenses/>.
18
19 (define-module (distro base)
20 #:use-module (guix packages)
21 #:use-module (guix http)
22 #:use-module (guix build-system gnu)
23 #:use-module (guix utils))
24
25 ;;; Commentary:
26 ;;;
27 ;;; A Guix-based distribution.
28 ;;;
29 ;;; Code:
30
31 (define-public libsigsegv
32 (package
33 (name "libsigsegv")
34 (version "2.10")
35 (source (origin
36 (method http-fetch)
37 (uri (string-append
38 "http://ftp.gnu.org/gnu/libsigsegv/libsigsegv-"
39 version ".tar.gz"))
40 (sha256
41 (base32 "16hrs8k3nmc7a8jam5j1fpspd6sdpkamskvsdpcw6m29vnis8q44"))))
42 (build-system gnu-build-system)
43 (outputs '("out" "lib")) ; separate libdir from the rest
44 (home-page "http://www.gnu.org/software/libsigsegv/")
45 (description "GNU libsigsegv, a library to handle page faults in user mode")
46 (long-description
47 "GNU libsigsegv is a library for handling page faults in user mode. A page
48 fault occurs when a program tries to access to a region of memory that is
49 currently not available. Catching and handling a page fault is a useful
50 technique for implementing pageable virtual memory, memory-mapped access to
51 persistent databases, generational garbage collectors, stack overflow
52 handlers, distributed shared memory, and more.")
53 (license "GPLv2+")))
54
55 (define-public gawk
56 (package
57 (name "gawk")
58 (version "4.0.0")
59 (source (origin
60 (method http-fetch)
61 (uri (string-append "http://ftp.gnu.org/gnu/gawk/gawk-" version
62 ".tar.bz2"))
63 (sha256
64 (base32 "0sss7rhpvizi2a88h6giv0i7w5h07s2fxkw3s6n1hqvcnhrfgbb0"))))
65 (build-system gnu-build-system)
66 (arguments (case-lambda
67 ((system)
68 (if (string=? system "i686-cygwin")
69 '(#:tests? #f) ; work around test failure on Cygwin
70 '(#:parallel-tests? #f))) ; test suite fails in parallel
71 ((system cross-system)
72 '(#:parallel-tests? #f))))
73 (inputs `(("libsigsegv" ,libsigsegv) ; headers
74 ("libsigsegv/lib" ,libsigsegv "lib"))) ; library
75 (home-page "http://www.gnu.org/software/gawk/")
76 (description "GNU implementation of the Awk programming language")
77 (long-description
78 "Many computer users need to manipulate text files: extract and then
79 operate on data from parts of certain lines while discarding the rest, make
80 changes in various text files wherever certain patterns appear, and so on.
81 To write a program to do these things in a language such as C or Pascal is a
82 time-consuming inconvenience that may take many lines of code. The job is
83 easy with awk, especially the GNU implementation: Gawk.
84
85 The awk utility interprets a special-purpose programming language that makes
86 it possible to handle many data-reformatting jobs with just a few lines of
87 code.")
88 (license "GPLv3+")))
89
90 (define-public hello
91 (package
92 (name "hello")
93 (version "2.8")
94 (source (origin
95 (method http-fetch)
96 (uri (string-append "http://ftp.gnu.org/gnu/hello/hello-" version
97 ".tar.gz"))
98 (sha256
99 (base32 "0wqd8sjmxfskrflaxywc7gqw7sfawrfvdxd9skxawzfgyy0pzdz6"))))
100 (build-system gnu-build-system)
101 (arguments '(#:configure-flags
102 `("--disable-dependency-tracking"
103 ,(string-append "--with-gawk=" ; for illustration purposes
104 (assoc-ref %build-inputs "gawk")))))
105 (inputs `(("gawk" ,gawk)))
106 (description "GNU Hello")
107 (long-description "Yeah...")
108 (home-page "http://www.gnu.org/software/hello/")
109 (license "GPLv3+")))
110
111 (define-public guile-1.8
112 (package
113 (name "guile")
114 (version "1.8.8")
115 (source (origin
116 (method http-fetch)
117 (uri (string-append "http://ftp.gnu.org/gnu/guile/guile-" version
118 ".tar.gz"))
119 (sha256
120 (base32
121 "0l200a0v7h8bh0cwz6v7hc13ds39cgqsmfrks55b1rbj5vniyiy3"))))
122 (build-system gnu-build-system)
123 (arguments '(#:configure-flags '("--disable-error-on-warning")
124 #:patches (list (assoc-ref %build-inputs "patch/snarf"))
125
126 ;; Insert a phase before `configure' to patch things up.
127 #:phases (alist-cons-before
128 'configure
129 'patch-loader-search-path
130 (lambda* (#:key outputs #:allow-other-keys)
131 ;; Add a call to `lt_dladdsearchdir' so that
132 ;; `libguile-readline.so' & co. are in the
133 ;; loader's search path.
134 (substitute* "libguile/dynl.c"
135 (("lt_dlinit.*$" match)
136 (format #f
137 " ~a~% lt_dladdsearchdir(\"~a/lib\");~%"
138 match
139 (assoc-ref outputs "out")))))
140 %standard-phases)))
141 (inputs `(("patch/snarf"
142 ,(search-path %load-path "distro/guile-1.8-cpp-4.5.patch"))
143 ("gawk" ,gawk)
144 ("readline" ,(nixpkgs-derivation "readline"))))
145
146 ;; Since `guile-1.8.pc' has "Libs: ... -lgmp -lltdl", these must be
147 ;; propagated.
148 (propagated-inputs `(("gmp" ,(nixpkgs-derivation "gmp"))
149 ("libtool" ,(nixpkgs-derivation "libtool"))))
150
151 ;; When cross-compiling, a native version of Guile itself is needed.
152 (self-native-input? #t)
153
154 (description "GNU Guile 1.8, an embeddable Scheme interpreter")
155 (long-description
156 "GNU Guile 1.8 is an interpreter for the Scheme programming language,
157 packaged as a library that can be embedded into programs to make them
158 extensible. It supports many SRFIs.")
159 (home-page "http://www.gnu.org/software/guile/")
160 (license "LGPLv2+")))
161
162 (define-public guile-2.0
163 (package
164 (name "guile")
165 (version "2.0.6")
166 (source (origin
167 (method http-fetch)
168 (uri (string-append "http://ftp.gnu.org/gnu/guile/guile-" version
169 ".tar.xz"))
170 (sha256
171 (base32
172 "000ng5qsq3cl1k35jvzvhwxj92wx4q87745n2fppkd4irh58vv5l"))))
173 (build-system gnu-build-system)
174 (native-inputs `(("xz" ,(nixpkgs-derivation "xz"))
175 ("pkgconfig" ,(nixpkgs-derivation "pkgconfig"))))
176 (inputs `(("libunistring" ,(nixpkgs-derivation "libunistring"))
177 ("libffi" ,(nixpkgs-derivation "libffi"))
178 ("libtool" ,(nixpkgs-derivation "libtool"))
179 ("readline" ,(nixpkgs-derivation "readline"))))
180
181 ;; The headers and/or `guile-2.0.pc' refer to these packages, so they must
182 ;; be propagated.
183 (propagated-inputs `(("bdw-gc" ,(nixpkgs-derivation "boehmgc"))
184 ("gmp" ,(nixpkgs-derivation "gmp"))))
185
186 (self-native-input? #t)
187
188 (description "GNU Guile 2.0, an embeddable Scheme implementation")
189 (long-description
190 "GNU Guile is an implementation of the Scheme programming language, with
191 support for many SRFIs, packaged for use in a wide variety of environments.
192 In addition to implementing the R5RS Scheme standard and a large subset of
193 R6RS, Guile includes a module system, full access to POSIX system calls,
194 networking support, multiple threads, dynamic linking, a foreign function
195 call interface, and powerful string processing.")
196 (home-page "http://www.gnu.org/software/guile/")
197 (license "LGPLv3+")))
198
199 (define-public lout
200 ;; This one is a bit tricky, because it doesn't follow the GNU Build System
201 ;; rules. Instead, it has a makefile that has to be patched to set the
202 ;; prefix, etc., and it has no makefile rules to build its doc.
203 (let ((configure-phase
204 '(lambda* (#:key outputs #:allow-other-keys)
205 (let ((out (assoc-ref outputs "out"))
206 (doc (assoc-ref outputs "doc")))
207 (substitute* "makefile"
208 (("^PREFIX[[:blank:]]*=.*$")
209 (string-append "PREFIX = " out "\n"))
210 (("^LOUTLIBDIR[[:blank:]]*=.*$")
211 (string-append "LOUTLIBDIR = " out "/lib/lout\n"))
212 (("^LOUTDOCDIR[[:blank:]]*=.*$")
213 (string-append "LOUTDOCDIR = " doc "/doc/lout\n"))
214 (("^MANDIR[[:blank:]]*=.*$")
215 (string-append "MANDIR = " out "/man\n")))
216 (mkdir out)
217 (mkdir (string-append out "/bin")) ; TODO: use `mkdir-p'
218 (mkdir (string-append out "/lib"))
219 (mkdir (string-append out "/man"))
220 (mkdir doc)
221 (mkdir (string-append doc "/doc"))
222 (mkdir (string-append doc "/doc/lout")))))
223 (install-man-phase
224 '(lambda* (#:key outputs #:allow-other-keys)
225 (zero? (system* "make" "installman"))))
226 (doc-phase
227 '(lambda* (#:key outputs #:allow-other-keys)
228 (define out
229 (assoc-ref outputs "doc"))
230
231 (setenv "PATH"
232 (string-append (assoc-ref outputs "out")
233 "/bin:" (getenv "PATH")))
234 (chdir "doc")
235 (every (lambda (doc)
236 (format #t "doc: building `~a'...~%" doc)
237 (with-directory-excursion doc
238 (let ((file (string-append out "/doc/lout/"
239 doc ".ps")))
240 (and (or (file-exists? "outfile.ps")
241 (zero? (system* "lout" "-r4" "-o"
242 "outfile.ps" "all")))
243 (begin
244 (copy-file "outfile.ps" file)
245 #t)
246 (zero? (system* "ps2pdf"
247 "-dPDFSETTINGS=/prepress"
248 "-sPAPERSIZE=a4"
249 file
250 (string-append out "/doc/lout/"
251 doc ".pdf")))))))
252 '("design" "expert" "slides" "user")))))
253 (package
254 (name "lout")
255 (version "3.39")
256 (source (origin
257 (method http-fetch)
258 ;; FIXME: `http-get' doesn't follow redirects, hence the URL.
259 (uri (string-append
260 "http://download-mirror.savannah.gnu.org/releases/lout/lout-"
261 version ".tar.gz"))
262 (sha256
263 (base32
264 "12gkyqrn0kaa8xq7sc7v3wm407pz2fxg9ngc75aybhi5z825b9vq"))))
265 (build-system gnu-build-system) ; actually, just a makefile
266 (outputs '("out" "doc"))
267 (inputs `(("ghostscript" ,(nixpkgs-derivation "ghostscript"))))
268 (arguments `(#:modules ((guix build utils)
269 (guix build gnu-build-system)
270 (srfi srfi-1)) ; we need SRFI-1
271 #:tests? #f ; no "check" target
272
273 ;; Customize the build phases.
274 #:phases (alist-replace
275 'configure ,configure-phase
276
277 (alist-cons-after
278 'install 'install-man-pages
279 ,install-man-phase
280
281 (alist-cons-after
282 'install 'install-doc
283 ,doc-phase
284 %standard-phases)))))
285 (description "Lout, a document layout system similar in style to LaTeX")
286 (long-description
287 "The Lout document formatting system is now reads a high-level description of
288 a document similar in style to LaTeX and produces a PostScript or plain text
289 output file.
290
291 Lout offers an unprecedented range of advanced features, including optimal
292 paragraph and page breaking, automatic hyphenation, PostScript EPS file
293 inclusion and generation, equation formatting, tables, diagrams, rotation and
294 scaling, sorted indexes, bibliographic databases, running headers and
295 odd-even pages, automatic cross referencing, multilingual documents including
296 hyphenation (most European languages are supported), formatting of computer
297 programs, and much more, all ready to use. Furthermore, Lout is easily
298 extended with definitions which are very much easier to write than troff of
299 TeX macros because Lout is a high-level, purely functional language, the
300 outcome of an eight-year research project that went back to the
301 beginning.")
302 (license "GPLv3+")
303 (home-page "http://savannah.nongnu.org/projects/lout/"))))
304
305 ;;; Local Variables:
306 ;;; eval: (put 'lambda* 'scheme-indent-function 1)
307 ;;; eval: (put 'substitute* 'scheme-indent-function 1)
308 ;;; eval: (put 'with-directory-excursion 'scheme-indent-function 1)
309 ;;; End: