diff mbox series

[bug#49607,3/3] gnu: idris: Add doc output and build the html documentation.

Message ID 20220414121612.9815-3-attila@lendvai.name
State New
Headers show
Series [bug#49607,v2,1/3] gnu: idris: Use wrap-program to define IDRIS_CC | expand

Checks

Context Check Description
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

Attila Lendvai April 14, 2022, 12:16 p.m. UTC
* gnu/packages/idris.scm (make-idris-package): Build the html docs and install
it into the doc output.
---
 gnu/packages/idris.scm | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/gnu/packages/idris.scm b/gnu/packages/idris.scm
index 28e918a486..b9b309d6d5 100644
--- a/gnu/packages/idris.scm
+++ b/gnu/packages/idris.scm
@@ -50,7 +50,9 @@  (define-module (gnu packages idris)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages node)
   #:use-module (gnu packages perl)
+  #:use-module (gnu packages python)
   #:use-module (gnu packages racket)
+  #:use-module (gnu packages sphinx)
   #:use-module (gnu packages version-control)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system haskell)
@@ -248,11 +250,17 @@  (define* (make-idris-package source idris-version
                bootstrap-idris)
            clang-toolchain-12 ; older clang-toolchain versions don't have a bin/cc
            coreutils which git
-           node                         ; only for the tests
-           racket                       ; only for the tests
-           sed))
+           sed
+           ;; Only for the tests
+           node
+           racket
+           ;; Only for the docs
+           python-minimal
+           python-sphinx
+           python-sphinx-rtd-theme))
     (inputs
      (list bash-minimal chez-scheme gmp))
+    (outputs '("out" "doc"))
     (arguments
      (list
       #:tests? tests?
@@ -275,6 +283,15 @@  (define* (make-idris-package source idris-version
          (delete 'bootstrap)
          (delete 'configure)
          (delete 'check)    ; check must happen after install and wrap-program
+         (add-before 'build 'build-doc
+           (lambda* (#:key outputs #:allow-other-keys)
+             (invoke "make" "--directory" "docs/" "html")))
+         (add-after 'build-doc 'install-doc
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((doc (assoc-ref outputs "doc")))
+               (copy-recursively "docs/build/html"
+                                 (string-append doc "/share/doc/"
+                                                ,name "-" ,version)))))
          (add-after 'unpack 'patch-paths
            (lambda* (#:key inputs #:allow-other-keys)
              (let ((files-to-patch (filter file-exists?