gnu: mit-scheme: Generate and install documentation.

* gnu/packages/scheme.scm (mit-scheme): Add 'doc' output.
  [arguments]: Add phases 'configure-doc, 'build-doc and 'install-doc.
  [native-inputs]: Add 'texlive'. Move 'texinfo' and 'm4' from inputs.
This commit is contained in:
Federico Beffa 2016-01-09 11:04:40 +01:00
parent af00e63352
commit f163c290f1
1 changed files with 46 additions and 4 deletions

View File

@ -30,6 +30,7 @@
#:use-module (gnu packages databases) #:use-module (gnu packages databases)
#:use-module (gnu packages emacs) #:use-module (gnu packages emacs)
#:use-module (gnu packages texinfo) #:use-module (gnu packages texinfo)
#:use-module (gnu packages texlive)
#:use-module (gnu packages base) #:use-module (gnu packages base)
#:use-module (gnu packages pkg-config) #:use-module (gnu packages pkg-config)
#:use-module (gnu packages avahi) #:use-module (gnu packages avahi)
@ -55,9 +56,13 @@
(name "mit-scheme") (name "mit-scheme")
(version "9.2") (version "9.2")
(source #f) ; see below (source #f) ; see below
(outputs '("out" "doc"))
(build-system gnu-build-system) (build-system gnu-build-system)
(arguments (arguments
`(#:tests? #f ; no "check" target `(#:tests? #f ; no "check" target
#:modules ((guix build gnu-build-system)
(guix build utils)
(srfi srfi-1))
#:phases #:phases
(modify-phases %standard-phases (modify-phases %standard-phases
(replace 'unpack (replace 'unpack
@ -83,11 +88,48 @@
(string-prefix? "i686" system)) (string-prefix? "i686" system))
(zero? (system* "make" "compile-microcode")) (zero? (system* "make" "compile-microcode"))
(zero? (system* "./etc/make-liarc.sh" (zero? (system* "./etc/make-liarc.sh"
(string-append "--prefix=" out)))))))))) (string-append "--prefix=" out)))))))
(add-after 'configure 'configure-doc
(lambda* (#:key outputs inputs #:allow-other-keys)
(with-directory-excursion "../doc"
(let* ((out (assoc-ref outputs "out"))
(bash (assoc-ref inputs "bash"))
(bin/sh (string-append bash "/bin/sh")))
(system* bin/sh "./configure"
(string-append "--prefix=" out)
(string-append "SHELL=" bin/sh))
(substitute* '("Makefile" "make-common")
(("/lib/mit-scheme/doc")
(string-append "/share/doc/" ,name "-" ,version)))
#t))))
(add-after 'build 'build-doc
(lambda* _
(with-directory-excursion "../doc"
(zero? (system* "make")))))
(add-after 'install 'install-doc
(lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(doc (assoc-ref outputs "doc"))
(old-doc-dir (string-append out "/share/doc"))
(new-doc/mit-scheme-dir
(string-append doc "/share/doc/" ,name "-" ,version)))
(with-directory-excursion "../doc"
(for-each (lambda (target)
(system* "make" target))
'("install-config" "install-info-gz" "install-man"
"install-html" "install-pdf")))
(mkdir-p new-doc/mit-scheme-dir)
(copy-recursively
(string-append old-doc-dir "/" ,name "-" ,version)
new-doc/mit-scheme-dir)
(delete-file-recursively old-doc-dir)
#t))))))
(native-inputs
`(("texlive" ,texlive)
("texinfo" ,texinfo)
("m4" ,m4)))
(inputs (inputs
`(("texinfo" ,texinfo) `(("libx11" ,libx11)
("m4" ,m4)
("libx11" ,libx11)
("source" ("source"