Commit | Line | Data |
---|---|---|
233e7676 | 1 | ;;; GNU Guix --- Functional package management for GNU |
2ffa297a | 2 | ;;; Copyright © 2012, 2013 Ludovic Courtès <ludo@gnu.org> |
1722d680 | 3 | ;;; |
233e7676 | 4 | ;;; This file is part of GNU Guix. |
1722d680 | 5 | ;;; |
233e7676 | 6 | ;;; GNU Guix is free software; you can redistribute it and/or modify it |
1722d680 LC |
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 | ;;; | |
233e7676 | 11 | ;;; GNU Guix is distributed in the hope that it will be useful, but |
1722d680 LC |
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 | |
233e7676 | 17 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. |
1722d680 | 18 | |
1ffa7090 | 19 | (define-module (gnu packages lout) |
4a44e743 | 20 | #:use-module (guix licenses) |
1722d680 | 21 | #:use-module (guix packages) |
87f5d366 | 22 | #:use-module (guix download) |
2ffa297a LC |
23 | #:use-module (guix build-system gnu) |
24 | #:use-module (gnu packages ghostscript)) | |
1722d680 | 25 | |
1722d680 LC |
26 | (define-public lout |
27 | ;; This one is a bit tricky, because it doesn't follow the GNU Build System | |
28 | ;; rules. Instead, it has a makefile that has to be patched to set the | |
29 | ;; prefix, etc., and it has no makefile rules to build its doc. | |
30 | (let ((configure-phase | |
31 | '(lambda* (#:key outputs #:allow-other-keys) | |
32 | (let ((out (assoc-ref outputs "out")) | |
33 | (doc (assoc-ref outputs "doc"))) | |
34 | (substitute* "makefile" | |
35 | (("^PREFIX[[:blank:]]*=.*$") | |
36 | (string-append "PREFIX = " out "\n")) | |
37 | (("^LOUTLIBDIR[[:blank:]]*=.*$") | |
38 | (string-append "LOUTLIBDIR = " out "/lib/lout\n")) | |
39 | (("^LOUTDOCDIR[[:blank:]]*=.*$") | |
829b1b25 | 40 | (string-append "LOUTDOCDIR = " doc "/share/doc/lout\n")) |
1722d680 LC |
41 | (("^MANDIR[[:blank:]]*=.*$") |
42 | (string-append "MANDIR = " out "/man\n"))) | |
43 | (mkdir out) | |
7da95264 | 44 | (mkdir (string-append out "/bin")) |
1722d680 LC |
45 | (mkdir (string-append out "/lib")) |
46 | (mkdir (string-append out "/man")) | |
829b1b25 | 47 | (mkdir-p (string-append doc "/share/doc/lout"))))) |
1722d680 LC |
48 | (install-man-phase |
49 | '(lambda* (#:key outputs #:allow-other-keys) | |
50 | (zero? (system* "make" "installman")))) | |
51 | (doc-phase | |
52 | '(lambda* (#:key outputs #:allow-other-keys) | |
53 | (define out | |
54 | (assoc-ref outputs "doc")) | |
55 | ||
56 | (setenv "PATH" | |
57 | (string-append (assoc-ref outputs "out") | |
58 | "/bin:" (getenv "PATH"))) | |
59 | (chdir "doc") | |
60 | (every (lambda (doc) | |
61 | (format #t "doc: building `~a'...~%" doc) | |
62 | (with-directory-excursion doc | |
829b1b25 | 63 | (let ((file (string-append out "/share/doc/lout/" |
1722d680 LC |
64 | doc ".ps"))) |
65 | (and (or (file-exists? "outfile.ps") | |
66 | (zero? (system* "lout" "-r4" "-o" | |
67 | "outfile.ps" "all"))) | |
68 | (begin | |
69 | (copy-file "outfile.ps" file) | |
70 | #t) | |
71 | (zero? (system* "ps2pdf" | |
72 | "-dPDFSETTINGS=/prepress" | |
73 | "-sPAPERSIZE=a4" | |
74 | file | |
829b1b25 | 75 | (string-append out "/share/doc/lout/" |
1722d680 LC |
76 | doc ".pdf"))))))) |
77 | '("design" "expert" "slides" "user"))))) | |
78 | (package | |
79 | (name "lout") | |
88a0b7b0 | 80 | (version "3.40") |
1722d680 | 81 | (source (origin |
87f5d366 | 82 | (method url-fetch) |
2ffa297a LC |
83 | (uri (string-append "mirror://savannah/lout/lout-" |
84 | version ".tar.gz")) | |
1722d680 LC |
85 | (sha256 |
86 | (base32 | |
88a0b7b0 | 87 | "1gb8vb1wl7ikn269dd1c7ihqhkyrwk19jwx5kd0rdvbk6g7g25ix")))) |
1722d680 LC |
88 | (build-system gnu-build-system) ; actually, just a makefile |
89 | (outputs '("out" "doc")) | |
d7e2841b | 90 | (inputs |
2ffa297a | 91 | `(("ghostscript" ,ghostscript))) |
1722d680 LC |
92 | (arguments `(#:modules ((guix build utils) |
93 | (guix build gnu-build-system) | |
94 | (srfi srfi-1)) ; we need SRFI-1 | |
95 | #:tests? #f ; no "check" target | |
96 | ||
97 | ;; Customize the build phases. | |
98 | #:phases (alist-replace | |
99 | 'configure ,configure-phase | |
100 | ||
101 | (alist-cons-after | |
102 | 'install 'install-man-pages | |
103 | ,install-man-phase | |
104 | ||
105 | (alist-cons-after | |
106 | 'install 'install-doc | |
107 | ,doc-phase | |
108 | %standard-phases))))) | |
35b9e423 | 109 | (synopsis "Document layout system") |
d45122f5 | 110 | (description |
35b9e423 | 111 | "The Lout document formatting system reads a high-level description of |
1722d680 LC |
112 | a document similar in style to LaTeX and produces a PostScript or plain text |
113 | output file. | |
114 | ||
115 | Lout offers an unprecedented range of advanced features, including optimal | |
116 | paragraph and page breaking, automatic hyphenation, PostScript EPS file | |
117 | inclusion and generation, equation formatting, tables, diagrams, rotation and | |
118 | scaling, sorted indexes, bibliographic databases, running headers and | |
119 | odd-even pages, automatic cross referencing, multilingual documents including | |
120 | hyphenation (most European languages are supported), formatting of computer | |
121 | programs, and much more, all ready to use. Furthermore, Lout is easily | |
122 | extended with definitions which are very much easier to write than troff of | |
123 | TeX macros because Lout is a high-level, purely functional language, the | |
124 | outcome of an eight-year research project that went back to the | |
125 | beginning.") | |
4a44e743 | 126 | (license gpl3+) |
1722d680 | 127 | (home-page "http://savannah.nongnu.org/projects/lout/")))) |