diff mbox

gnu: Build and install xonsh docs.

Message ID 20161007103821.25844-1-dannym@scratchpost.org
State New
Headers show

Commit Message

Danny Milosavljevic Oct. 7, 2016, 10:38 a.m. UTC
* gnu/packages/shells.scm (xonsh): Changed.
---
 gnu/packages/shells.scm | 29 ++++++++++++++++++++++++++---
 1 file changed, 26 insertions(+), 3 deletions(-)

Comments

Ludovic Courtès Oct. 9, 2016, 9:59 p.m. UTC | #1
Hi!

Danny Milosavljevic <dannym@scratchpost.org> skribis:

> * gnu/packages/shells.scm (xonsh): Changed.
> ---
>  gnu/packages/shells.scm | 29 ++++++++++++++++++++++++++---
>  1 file changed, 26 insertions(+), 3 deletions(-)
>
> diff --git a/gnu/packages/shells.scm b/gnu/packages/shells.scm
> index 6d510c2..99d1f3e 100644
> --- a/gnu/packages/shells.scm
> +++ b/gnu/packages/shells.scm
> @@ -291,10 +291,11 @@ ksh, and tcsh.")
>      (source
>        (origin
>          (method url-fetch)
> -        (uri (pypi-uri "xonsh" version))
> +        (uri (string-append "https://github.com/xonsh/xonsh/archive/"
> +                            version ".tar.gz"))
>          (sha256
>            (base32
> -            "0byxd9kjl99q2pyvjh9jy18l0di1i35wr0qqgnw4i6jh6ig3zcki"))
> +            "0v0l3bpyxh2fyhybycjr22sh9v0ggswgmbm9gsyf7yvkrcr5fqzr"))

Is the URL change intended?  Is it needed?  If so, please add a comment
above as to why the github.com tarball is preferred.

> +    (native-inputs
> +     `(("python-numpydoc" ,python-numpydoc)
> +       ("python-sphinx" ,python-sphinx)
> +       ("python-sphinx-cloud-sptheme"
> +        ,python-sphinx-cloud-sptheme)))

I got:

  gnu/packages/shells.scm:323:5: In procedure module-lookup: Unbound variable: python-sphinx-cloud-sptheme

Am I missing another patch that adds this package?

> +      ;; TODO jupyter distro
> +     `(("python-ply" ,python-ply)
> +       ("python-prompt-toolkit" ,python-prompt-toolkit)))

I’m not sure what the comment means.  Maybe remove it?

Thanks!

Ludo’.
Danny Milosavljevic Oct. 11, 2016, 3:42 p.m. UTC | #2
Hi Ludo,

On Sun, 09 Oct 2016 23:59:15 +0200
ludo@gnu.org (Ludovic Courtès) wrote:

> Is the URL change intended?  Is it needed?  If so, please add a comment
> above as to why the github.com tarball is preferred.

Yes. The github URL contains the docs, the other doesn't.

> Am I missing another patch that adds this package?

Yeah, see "gnu: Update Sphinx to 1.4.6."

> > +      ;; TODO jupyter distro
> > +     `(("python-ply" ,python-ply)
> > +       ("python-prompt-toolkit" ,python-prompt-toolkit)))  
> 
> I’m not sure what the comment means.  Maybe remove it?

It has further optional dependencies that we haven't packaged yet - and that's how they are called.
diff mbox

Patch

diff --git a/gnu/packages/shells.scm b/gnu/packages/shells.scm
index 6d510c2..99d1f3e 100644
--- a/gnu/packages/shells.scm
+++ b/gnu/packages/shells.scm
@@ -291,10 +291,11 @@  ksh, and tcsh.")
     (source
       (origin
         (method url-fetch)
-        (uri (pypi-uri "xonsh" version))
+        (uri (string-append "https://github.com/xonsh/xonsh/archive/"
+                            version ".tar.gz"))
         (sha256
           (base32
-            "0byxd9kjl99q2pyvjh9jy18l0di1i35wr0qqgnw4i6jh6ig3zcki"))
+            "0v0l3bpyxh2fyhybycjr22sh9v0ggswgmbm9gsyf7yvkrcr5fqzr"))
         (modules '((guix build utils)))
         (snippet
          `(begin
@@ -304,8 +305,30 @@  ksh, and tcsh.")
               (("'xonsh\\.ply',") ""))
             #t))))
     (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'build 'build-docs
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               ;; Make it find "xonsh" module
+               (setenv "PYTHONPATH" (string-append (getcwd) ":" (getenv "PYTHONPATH")))
+               (zero? (system* "make" "-C" "docs" "html")))))
+         (add-after 'install 'install-docs
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (docout (string-append out "/share/doc/xonsh")))
+               (mkdir-p docout)
+               (copy-recursively "docs/_build/html" docout)))))))
+    (native-inputs
+     `(("python-numpydoc" ,python-numpydoc)
+       ("python-sphinx" ,python-sphinx)
+       ("python-sphinx-cloud-sptheme"
+        ,python-sphinx-cloud-sptheme)))
     (inputs
-     `(("python-ply" ,python-ply)))
+      ;; TODO jupyter distro
+     `(("python-ply" ,python-ply)
+       ("python-prompt-toolkit" ,python-prompt-toolkit)))
     (home-page "http://xon.sh/")
     (synopsis "Python-ish shell")
     (description