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