gnu: libdvdcss: Update to 1.4.3.
[jackhill/guix/guix.git] / gnu / packages / lout.scm
CommitLineData
233e7676 1;;; GNU Guix --- Functional package management for GNU
2ffa297a 2;;; Copyright © 2012, 2013 Ludovic Courtès <ludo@gnu.org>
9a9d64ea 3;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
1722d680 4;;;
233e7676 5;;; This file is part of GNU Guix.
1722d680 6;;;
233e7676 7;;; GNU Guix is free software; you can redistribute it and/or modify it
1722d680
LC
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.
11;;;
233e7676 12;;; GNU Guix is distributed in the hope that it will be useful, but
1722d680
LC
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.
16;;;
17;;; You should have received a copy of the GNU General Public License
233e7676 18;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
1722d680 19
1ffa7090 20(define-module (gnu packages lout)
4a44e743 21 #:use-module (guix licenses)
1722d680 22 #:use-module (guix packages)
87f5d366 23 #:use-module (guix download)
2ffa297a
LC
24 #:use-module (guix build-system gnu)
25 #:use-module (gnu packages ghostscript))
1722d680 26
1722d680 27(define-public lout
9a9d64ea 28 (package
1722d680 29 (name "lout")
88a0b7b0 30 (version "3.40")
1722d680 31 (source (origin
9a9d64ea
TGR
32 (method url-fetch)
33 (uri (string-append "mirror://savannah/lout/lout-"
34 version ".tar.gz"))
35 (sha256
36 (base32
37 "1gb8vb1wl7ikn269dd1c7ihqhkyrwk19jwx5kd0rdvbk6g7g25ix"))))
38 (build-system gnu-build-system) ; actually, just a makefile
1722d680 39 (outputs '("out" "doc"))
02b934e2 40 (native-inputs
fb0b9ff1 41 `(("ghostscript" ,ghostscript)))
9a9d64ea
TGR
42 (arguments
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
47 #:phases
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.
53 (replace 'configure
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")))
66 (mkdir out)
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"))
71 #t)))
72 (add-after 'install 'install-man-pages
73 (lambda* (#:key outputs #:allow-other-keys)
74 (invoke "make" "installman")
75 #t))
76 (add-after 'install 'install-doc
77 (lambda* (#:key outputs #:allow-other-keys)
78 (let ((out (assoc-ref outputs "doc")))
79 (setenv "PATH"
80 (string-append (assoc-ref outputs "out")
81 "/bin:" (getenv "PATH")))
82 (with-directory-excursion "doc"
83 (every (lambda (doc)
84 (format #t "doc: building `~a'...~%" doc)
85 (with-directory-excursion doc
86 (let ((file (string-append out "/share/doc/lout/"
87 doc ".ps")))
88 (unless (file-exists? "outfile.ps")
89 (invoke "lout" "-r4" "-o"
90 "outfile.ps" "all"))
91 (copy-file "outfile.ps" file)
92 (invoke "ps2pdf"
93 "-dPDFSETTINGS=/prepress"
94 "-sPAPERSIZE=a4"
95 file
96 (string-append out "/share/doc/lout/"
97 doc ".pdf")))))
98 '("design" "expert" "slides" "user")))
99 #t))))))
35b9e423 100 (synopsis "Document layout system")
d45122f5 101 (description
9a9d64ea 102 "The Lout document formatting system reads a high-level description of
1722d680
LC
103a document similar in style to LaTeX and produces a PostScript or plain text
104output file.
105
106Lout offers an unprecedented range of advanced features, including optimal
107paragraph and page breaking, automatic hyphenation, PostScript EPS file
108inclusion and generation, equation formatting, tables, diagrams, rotation and
109scaling, sorted indexes, bibliographic databases, running headers and
110odd-even pages, automatic cross referencing, multilingual documents including
111hyphenation (most European languages are supported), formatting of computer
112programs, and much more, all ready to use. Furthermore, Lout is easily
113extended with definitions which are very much easier to write than troff of
114TeX macros because Lout is a high-level, purely functional language, the
115outcome of an eight-year research project that went back to the
116beginning.")
4a44e743 117 (license gpl3+)
9a9d64ea 118 (home-page "https://savannah.nongnu.org/projects/lout/")))