1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
5 ;;; This file is part of GNU Guix.
7 ;;; GNU Guix is free software; you can redistribute it and/or modify it
8 ;;; under the terms of the GNU General Public License as published by
9 ;;; the Free Software Foundation; either version 3 of the License, or (at
10 ;;; your option) any later version.
12 ;;; GNU Guix is distributed in the hope that it will be useful, but
13 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;;; GNU General Public License for more details.
17 ;;; You should have received a copy of the GNU General Public License
18 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20 (define-module (gnu packages lout)
21 #:use-module (guix licenses)
22 #:use-module (guix packages)
23 #:use-module (guix download)
24 #:use-module (guix build-system gnu)
25 #:use-module (gnu packages ghostscript))
33 (uri (string-append "mirror://savannah/lout/lout-"
37 "1gb8vb1wl7ikn269dd1c7ihqhkyrwk19jwx5kd0rdvbk6g7g25ix"))))
38 (build-system gnu-build-system) ; actually, just a makefile
39 (outputs '("out" "doc"))
41 `(("ghostscript" ,ghostscript)))
43 `(#:modules ((guix build utils)
44 (guix build gnu-build-system)
45 (srfi srfi-1)) ; we need SRFI-1
46 #:tests? #f ; no "check" target
48 (modify-phases %standard-phases
49 ;; This package is a bit tricky, because it doesn't follow the GNU
50 ;; Build System rules. Instead, it has a makefile that has to be
51 ;; patched to set the prefix, etc., and it has no makefile rules to
52 ;; build its documentation.
54 (lambda* (#:key outputs #:allow-other-keys)
55 (let ((out (assoc-ref outputs "out"))
56 (doc (assoc-ref outputs "doc")))
57 (substitute* "makefile"
58 (("^PREFIX[[:blank:]]*=.*$")
59 (string-append "PREFIX = " out "\n"))
60 (("^LOUTLIBDIR[[:blank:]]*=.*$")
61 (string-append "LOUTLIBDIR = " out "/lib/lout\n"))
62 (("^LOUTDOCDIR[[:blank:]]*=.*$")
63 (string-append "LOUTDOCDIR = " doc "/share/doc/lout\n"))
64 (("^MANDIR[[:blank:]]*=.*$")
65 (string-append "MANDIR = " out "/man\n")))
67 (mkdir (string-append out "/bin"))
68 (mkdir (string-append out "/lib"))
69 (mkdir (string-append out "/man"))
70 (mkdir-p (string-append doc "/share/doc/lout"))
72 (add-after 'install 'install-man-pages
73 (lambda* (#:key outputs #:allow-other-keys)
74 (invoke "make" "installman")
76 (add-after 'install 'install-doc
77 (lambda* (#:key outputs #:allow-other-keys)
78 (let ((out (assoc-ref outputs "doc")))
80 (string-append (assoc-ref outputs "out")
81 "/bin:" (getenv "PATH")))
82 (with-directory-excursion "doc"
84 (format #t "doc: building `~a'...~%" doc)
85 (with-directory-excursion doc
86 (let ((file (string-append out "/share/doc/lout/"
88 (unless (file-exists? "outfile.ps")
89 (invoke "lout" "-r4" "-o"
91 (copy-file "outfile.ps" file)
93 "-dPDFSETTINGS=/prepress"
96 (string-append out "/share/doc/lout/"
98 '("design" "expert" "slides" "user")))
100 (synopsis "Document layout system")
102 "The Lout document formatting system reads a high-level description of
103 a document similar in style to LaTeX and produces a PostScript or plain text
106 Lout offers an unprecedented range of advanced features, including optimal
107 paragraph and page breaking, automatic hyphenation, PostScript EPS file
108 inclusion and generation, equation formatting, tables, diagrams, rotation and
109 scaling, sorted indexes, bibliographic databases, running headers and
110 odd-even pages, automatic cross referencing, multilingual documents including
111 hyphenation (most European languages are supported), formatting of computer
112 programs, and much more, all ready to use. Furthermore, Lout is easily
113 extended with definitions which are very much easier to write than troff of
114 TeX macros because Lout is a high-level, purely functional language, the
115 outcome of an eight-year research project that went back to the
118 (home-page "https://savannah.nongnu.org/projects/lout/")))