1 ;;; Guix --- Nix package management from Guile. -*- coding: utf-8 -*-
2 ;;; Copyright (C) 2012 Ludovic Courtès <ludo@gnu.org>
4 ;;; This file is part of Guix.
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.
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.
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/>.
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))
27 ;;; A Guix-based distribution.
31 (define-public libsigsegv
38 "http://ftp.gnu.org/gnu/libsigsegv/libsigsegv-"
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")
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.")
61 (uri (string-append "http://ftp.gnu.org/gnu/gawk/gawk-" version
64 (base32 "0sss7rhpvizi2a88h6giv0i7w5h07s2fxkw3s6n1hqvcnhrfgbb0"))))
65 (build-system gnu-build-system)
66 (arguments (case-lambda
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")
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.
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
96 (uri (string-append "http://ftp.gnu.org/gnu/hello/hello-" version
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/")
111 (define-public guile-1.8
117 (uri (string-append "http://ftp.gnu.org/gnu/guile/guile-" version
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"))
126 ;; Insert a phase before `configure' to patch things up.
127 #:phases (alist-cons-before
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)
137 " ~a~% lt_dladdsearchdir(\"~a/lib\");~%"
139 (assoc-ref outputs "out")))))
141 (inputs `(("patch/snarf"
142 ,(search-path %load-path "distro/guile-1.8-cpp-4.5.patch"))
144 ("readline" ,(nixpkgs-derivation "readline"))))
146 ;; Since `guile-1.8.pc' has "Libs: ... -lgmp -lltdl", these must be
148 (propagated-inputs `(("gmp" ,(nixpkgs-derivation "gmp"))
149 ("libtool" ,(nixpkgs-derivation "libtool"))))
151 ;; When cross-compiling, a native version of Guile itself is needed.
152 (self-native-input? #t)
154 (description "GNU Guile 1.8, an embeddable Scheme interpreter")
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+")))
162 (define-public guile-2.0
168 (uri (string-append "http://ftp.gnu.org/gnu/guile/guile-" version
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"))))
181 ;; The headers and/or `guile-2.0.pc' refer to these packages, so they must
183 (propagated-inputs `(("bdw-gc" ,(nixpkgs-derivation "boehmgc"))
184 ("gmp" ,(nixpkgs-derivation "gmp"))))
186 (self-native-input? #t)
188 (description "GNU Guile 2.0, an embeddable Scheme implementation")
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+")))
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")))
217 (mkdir (string-append out "/bin")) ; TODO: use `mkdir-p'
218 (mkdir (string-append out "/lib"))
219 (mkdir (string-append out "/man"))
221 (mkdir (string-append doc "/doc"))
222 (mkdir (string-append doc "/doc/lout")))))
224 '(lambda* (#:key outputs #:allow-other-keys)
225 (zero? (system* "make" "installman"))))
227 '(lambda* (#:key outputs #:allow-other-keys)
229 (assoc-ref outputs "doc"))
232 (string-append (assoc-ref outputs "out")
233 "/bin:" (getenv "PATH")))
236 (format #t "doc: building `~a'...~%" doc)
237 (with-directory-excursion doc
238 (let ((file (string-append out "/doc/lout/"
240 (and (or (file-exists? "outfile.ps")
241 (zero? (system* "lout" "-r4" "-o"
242 "outfile.ps" "all")))
244 (copy-file "outfile.ps" file)
246 (zero? (system* "ps2pdf"
247 "-dPDFSETTINGS=/prepress"
250 (string-append out "/doc/lout/"
252 '("design" "expert" "slides" "user")))))
258 ;; FIXME: `http-get' doesn't follow redirects, hence the URL.
260 "http://download-mirror.savannah.gnu.org/releases/lout/lout-"
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
273 ;; Customize the build phases.
274 #:phases (alist-replace
275 'configure ,configure-phase
278 'install 'install-man-pages
282 'install 'install-doc
284 %standard-phases)))))
285 (description "Lout, a document layout system similar in style to LaTeX")
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
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
303 (home-page "http://savannah.nongnu.org/projects/lout/"))))
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)