guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

06/10: gnu: mit-scheme: Generate and install documentation.


From: Federico Beffa
Subject: 06/10: gnu: mit-scheme: Generate and install documentation.
Date: Wed, 03 Feb 2016 09:50:36 +0000

beffa pushed a commit to branch master
in repository guix.

commit f163c290f1aa2925d0c7fdbc94f82625092bb330
Author: Federico Beffa <address@hidden>
Date:   Sat Jan 9 11:04:40 2016 +0100

    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.
---
 gnu/packages/scheme.scm |   50 +++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 46 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/scheme.scm b/gnu/packages/scheme.scm
index 752dae2..352b66c 100644
--- a/gnu/packages/scheme.scm
+++ b/gnu/packages/scheme.scm
@@ -30,6 +30,7 @@
   #:use-module (gnu packages databases)
   #:use-module (gnu packages emacs)
   #:use-module (gnu packages texinfo)
+  #:use-module (gnu packages texlive)
   #:use-module (gnu packages base)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages avahi)
@@ -55,9 +56,13 @@
     (name "mit-scheme")
     (version "9.2")
     (source #f)                                   ; see below
+    (outputs '("out" "doc"))
     (build-system gnu-build-system)
     (arguments
      `(#:tests? #f                                ; no "check" target
+       #:modules ((guix build gnu-build-system)
+                  (guix build utils)
+                  (srfi srfi-1))
        #:phases
        (modify-phases %standard-phases
          (replace 'unpack
@@ -83,11 +88,48 @@
                        (string-prefix? "i686" system))
                    (zero? (system* "make" "compile-microcode"))
                    (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
-     `(("texinfo" ,texinfo)
-       ("m4" ,m4)
-       ("libx11" ,libx11)
+     `(("libx11" ,libx11)
 
        ("source"
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]