me
/
guix
Archived
1
0
Fork 0

gnu: python-matplotlib-documentation: Fix build.

* gnu/packages/python-xyz.scm (python-matplotlib-documentation): Inherit from
python-matplotlib.
[version, source, build-system, home-page, description, license]: Delete
fields, now inherited.
[phases]: Streamline build and install phases and enable parallel build.
[native-inputs]: Use new style.  Remove python-matplotlib, python-ipykernel,
python-mock, texlive-enumitem, texlive-latex-geometry, texlive-latex-preview,
texlive-latex-ucs, texlive-pdftex, texlive-fonts-ec, texlive-txfonts and
inherited python-matplotlib packages.
Add inkscape, python-mpl-sphinx-theme, python-scipy, python-ipywidgets,
texlive-babel, texlive-fontspec, texlive-unicode-math, texlive-etoolbox,
and texlive-underscore.
master
Maxim Cournoyer 2022-04-23 23:48:31 -04:00
parent b3a77978c9
commit 44256e57cc
No known key found for this signature in database
GPG Key ID: 1260E46482E63562
1 changed files with 57 additions and 79 deletions

View File

@ -6800,87 +6800,65 @@ toolkits.")
(define-public python-matplotlib-documentation (define-public python-matplotlib-documentation
(package (package
(inherit python-matplotlib)
(name "python-matplotlib-documentation") (name "python-matplotlib-documentation")
(version (package-version python-matplotlib))
(source (package-source python-matplotlib))
(build-system python-build-system)
(native-inputs
`(("python-matplotlib" ,python-matplotlib)
("python-colorspacious" ,python-colorspacious)
("python-sphinx" ,python-sphinx)
("python-sphinx-copybutton" ,python-sphinx-copybutton)
("python-sphinx-gallery" ,python-sphinx-gallery)
("python-numpydoc" ,python-numpydoc)
("python-ipython" ,python-ipython)
("python-ipykernel" ,python-ipykernel)
("python-mock" ,python-mock)
("graphviz" ,graphviz)
("texlive" ,(texlive-updmap.cfg (list texlive-amsfonts
texlive-enumitem
texlive-latex-amsmath
texlive-latex-expdlist
texlive-latex-geometry
texlive-latex-preview
texlive-latex-type1cm
texlive-latex-ucs
texlive-pdftex
texlive-fonts-ec
texlive-times
texlive-txfonts)))
("texinfo" ,texinfo)
,@(package-native-inputs python-matplotlib)))
(arguments (arguments
`(#:tests? #f ; we're only generating documentation (list
#:phases #:tests? #f ;we're only generating documentation
(modify-phases %standard-phases #:phases
;; The tests in python-matplotlib are run after the install phase, so #~(modify-phases %standard-phases
;; we need to delete the extra phase here. (replace 'build
(delete 'check) (lambda _
(replace 'build (setenv "HOME" "/tmp")
(lambda _ (chdir "doc")
(chdir "doc") (substitute* "conf.py"
(setenv "PYTHONPATH" "../examples/units") ;; The sphinx_panels extension causes a "TypeError: first
(substitute* "conf.py" ;; argument must be callable" to be raised when generating the
;; Don't use git. ;; info target; remove it (see:
(("^SHA = check_output.*") ;; https://github.com/executablebooks/sphinx-panels/issues/74).
(string-append "SHA = \"" ,version "\"\n")) ((".*'sphinx_panels',.*") ""))
;; Don't fetch intersphinx files from the Internet (invoke "make" "html" "info"
(("^explicit_order_folders" m) ;; Don't abort on warnings; build in parallel.
(string-append "intersphinx_mapping = {}\n" m)) (format #f "SPHINXOPTS=-j~a" (parallel-job-count)))))
(("'sphinx.ext.intersphinx',") "") (replace 'install
;; Disable URL embedding which requires internet access. (lambda _
(("'https://docs.scipy.org/doc/numpy'") "None") (let* ((data (string-append #$output "/share"))
(("'https://docs.scipy.org/doc/scipy/reference'") "None")) (doc (string-append data "/doc/matplotlib"))
(invoke "make" (info (string-append data "/info"))
"SPHINXBUILD=sphinx-build" (html (string-append doc "/html")))
"SPHINXOPTS=" ; don't abort on warnings (mkdir-p html)
"html" "texinfo"))) (copy-recursively "build/html" html)
(replace 'install (install-file "build/texinfo/matplotlib.info" info)
(lambda* (#:key inputs outputs #:allow-other-keys) ;; The "matplotlib-figures" directory contains are a subset of
(let* ((data (string-append (assoc-ref outputs "out") "/share")) ;; the images produced for the html target; simply create a
(doc (string-append data "/doc/python-matplotlib-" ,version)) ;; symlink to it, saving about 11 MiB.
(info (string-append data "/info")) (symlink (string-append html "/_images")
(html (string-append doc "/html"))) (string-append info "/matplotlib-figures"))))))))
(mkdir-p html) (native-inputs
(mkdir-p info) (list graphviz
(copy-recursively "build/html" html) inkscape
(symlink (string-append html "/_images") python-colorspacious
(string-append info "/matplotlib-figures")) python-mpl-sphinx-theme
(with-directory-excursion "build/texinfo" python-scipy
(substitute* "matplotlib.texi" python-sphinx
(("@image\\{([^,]*)" all file) python-sphinx-copybutton
(string-append "@image{matplotlib-figures/" file))) python-sphinx-gallery
(symlink (string-append html "/_images") python-sphinxcontrib-svg2pdfconverter
"./matplotlib-figures") python-numpydoc
(invoke "makeinfo" "--no-split" python-ipython
"-o" "matplotlib.info" "matplotlib.texi")) python-ipywidgets
(install-file "build/texinfo/matplotlib.info" info))))))) texlive-amsfonts
(home-page (package-home-page python-matplotlib)) texlive-amsmath
(synopsis "Documentation for the python-matplotlib package") texlive-babel
(description (package-description python-matplotlib)) texlive-fontspec
(license (package-license python-matplotlib)))) texlive-unicode-math
texlive-etoolbox
texlive-latex-expdlist
texlive-underscore
texlive-latex-type1cm
texlive-times
texinfo))
(synopsis "Documentation for the @code{python-matplotlib} package")))
(define-public python-matplotlib-inline (define-public python-matplotlib-inline
(package (package