| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 |
|
| 20 | (define-module (gnu packages lout)
|
| 21 | #:use-module (guix licenses)
|
| 22 | #:use-module (guix packages)
|
| 23 | #:use-module (guix git-download)
|
| 24 | #:use-module (guix build-system gnu)
|
| 25 | #:use-module (gnu packages ghostscript))
|
| 26 |
|
| 27 | (define-public lout
|
| 28 | (package
|
| 29 | (name "lout")
|
| 30 | (version "3.43.4")
|
| 31 |
|
| 32 | |
| 33 | |
| 34 | |
| 35 | (home-page "https://github.com/william8000/lout")
|
| 36 |
|
| 37 | (source (origin
|
| 38 | (method git-fetch)
|
| 39 | (uri (git-reference (url home-page)
|
| 40 | (commit version)))
|
| 41 | (file-name (git-file-name name version))
|
| 42 | (sha256
|
| 43 | (base32
|
| 44 | "09s6mcimvhw96i3vncqa8cz04xcq9x3qir8m1nzqfny8vdwyz35n"))))
|
| 45 | (build-system gnu-build-system) |
| 46 | (outputs '("out" "doc"))
|
| 47 | (native-inputs
|
| 48 | (list ghostscript))
|
| 49 | (arguments
|
| 50 | `(#:modules ((guix build utils)
|
| 51 | (guix build gnu-build-system)
|
| 52 | (srfi srfi-1)) |
| 53 | #:tests? #f |
| 54 | #:phases
|
| 55 | (modify-phases %standard-phases
|
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | (replace 'configure
|
| 61 | (lambda* (#:key outputs #:allow-other-keys)
|
| 62 | (let ((out (assoc-ref outputs "out"))
|
| 63 | (doc (assoc-ref outputs "doc")))
|
| 64 | (substitute* "makefile"
|
| 65 | (("^PREFIX[[:blank:]]*=.*$")
|
| 66 | (string-append "PREFIX = " out "\n"))
|
| 67 | (("^LOUTLIBDIR[[:blank:]]*=.*$")
|
| 68 | (string-append "LOUTLIBDIR = " out "/lib/lout\n"))
|
| 69 | (("^LOUTDOCDIR[[:blank:]]*=.*$")
|
| 70 | (string-append "LOUTDOCDIR = " doc "/share/doc/lout\n"))
|
| 71 | (("^MANDIR[[:blank:]]*=.*$")
|
| 72 | (string-append "MANDIR = " out "/man\n")))
|
| 73 | (mkdir out)
|
| 74 | (mkdir (string-append out "/bin"))
|
| 75 | (mkdir (string-append out "/lib"))
|
| 76 | (mkdir (string-append out "/man"))
|
| 77 | (mkdir-p (string-append doc "/share/doc/lout"))
|
| 78 | #t)))
|
| 79 | (add-after 'install 'install-man-pages
|
| 80 | (lambda* (#:key outputs #:allow-other-keys)
|
| 81 | (invoke "make" "installman")
|
| 82 | #t))
|
| 83 | (add-after 'install 'install-doc
|
| 84 | (lambda* (#:key outputs #:allow-other-keys)
|
| 85 | (let ((out (assoc-ref outputs "doc")))
|
| 86 | (setenv "PATH"
|
| 87 | (string-append (assoc-ref outputs "out")
|
| 88 | "/bin:" (getenv "PATH")))
|
| 89 | (with-directory-excursion "doc"
|
| 90 | (every (lambda (doc)
|
| 91 | (format #t "doc: building `~a'...~%" doc)
|
| 92 | (with-directory-excursion doc
|
| 93 | (let ((file (string-append out "/share/doc/lout/"
|
| 94 | doc ".ps")))
|
| 95 | (unless (file-exists? "outfile.ps")
|
| 96 | (invoke "lout" "-r4" "-o"
|
| 97 | "outfile.ps" "all"))
|
| 98 | (copy-file "outfile.ps" file)
|
| 99 | (invoke "ps2pdf"
|
| 100 | "-dPDFSETTINGS=/prepress"
|
| 101 | "-sPAPERSIZE=a4"
|
| 102 | file
|
| 103 | (string-append out "/share/doc/lout/"
|
| 104 | doc ".pdf")))))
|
| 105 | '("design" "expert" "slides" "user")))
|
| 106 | #t))))))
|
| 107 | (synopsis "Document layout system")
|
| 108 | (description
|
| 109 | "The Lout document formatting system reads a high-level description of
|
| 110 | a document similar in style to LaTeX and produces a PostScript or plain text
|
| 111 | output file.
|
| 112 |
|
| 113 | Lout offers an unprecedented range of advanced features, including optimal
|
| 114 | paragraph and page breaking, automatic hyphenation, PostScript EPS file
|
| 115 | inclusion and generation, equation formatting, tables, diagrams, rotation and
|
| 116 | scaling, sorted indexes, bibliographic databases, running headers and
|
| 117 | odd-even pages, automatic cross referencing, multilingual documents including
|
| 118 | hyphenation (most European languages are supported), formatting of computer
|
| 119 | programs, and much more, all ready to use. Furthermore, Lout is easily
|
| 120 | extended with definitions which are very much easier to write than troff of
|
| 121 | TeX macros because Lout is a high-level, purely functional language, the
|
| 122 | outcome of an eight-year research project that went back to the
|
| 123 | beginning.")
|
| 124 | (license gpl3+)))
|