Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / gnu / packages / sphinx.scm
index 71cff12..5ec7693 100644 (file)
@@ -30,6 +30,7 @@
 (define-module (gnu packages sphinx)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix utils)
   #:use-module (guix build-system python)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (gnu packages)
 (define-public python-sphinx
   (package
     (name "python-sphinx")
-    (version "1.7.7")
+    (version "2.1.2")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "Sphinx" version))
        (sha256
         (base32
-         "0pkkbfj7cl157q550gcs45am5y78ps0h7q6455d64s1zmw01jlvi"))))
+         "09y4mjmbxz94pmfr2lzf1hkx2xk0khcpb8xsqfmir4l7dds9x9zr"))))
     (build-system python-build-system)
     (arguments
      `(#:phases
              (substitute* "tests/test_build_latex.py"
                (("@pytest.mark.sphinx\\('latex', testroot='images'\\)")
                 "@pytest.mark.skip()"))
-             (when (which "python")
-               ;; XXX: These tests are broken when using Python2:
-               ;; <https://github.com/sphinx-doc/sphinx/issues/4710>.
-               (delete-file "tests/test_api_translator.py")
-               (delete-file "tests/test_setup_command.py"))
              (invoke "make" "test"))))))
     (propagated-inputs
      `(("python-imagesize" ,python-imagesize)
        ("python-packaging" ,python-packaging)
        ("python-pygments" ,python-pygments)
        ("python-requests" ,python-requests)
-       ("python-six" ,python-six)
-       ("python-sphinxcontrib-websupport" ,python-sphinxcontrib-websupport)))
+       ("python-sphinxcontrib-applehelp" ,python-sphinxcontrib-applehelp)
+       ("python-sphinxcontrib-devhelp" ,python-sphinxcontrib-devhelp)
+       ("python-sphinxcontrib-htmlhelp" ,python-sphinxcontrib-htmlhelp)
+       ("python-sphinxcontrib-jsmath" ,python-sphinxcontrib-jsmath)
+       ("python-sphinxcontrib-qthelp" ,python-sphinxcontrib-qthelp)
+       ("python-sphinxcontrib-serializinghtml"
+        ,python-sphinxcontrib-serializinghtml)))
     (native-inputs
      `(("graphviz" ,graphviz)
        ("imagemagick" ,imagemagick)                    ;for "convert"
@@ -89,7 +90,7 @@
        ("python-mock" ,python-mock)
        ("python-nose" ,python-nose)
        ("python-pytest" ,python-pytest)))
-    (home-page "http://sphinx-doc.org/")
+    (home-page "https://sphinx-doc.org/")
     (synopsis "Python documentation generator")
     (description "Sphinx is a tool that makes it easy to create documentation
 for Python projects or other documents consisting of multiple reStructuredText
@@ -97,16 +98,50 @@ sources.")
     (license license:bsd-3)
     (properties `((python2-variant . ,(delay python2-sphinx))))))
 
+;; Sphinx 2 does not support Python 2, so we stick with this older version here.
+;; Remove this package once python2-pbcore no longer requires it.
 (define-public python2-sphinx
   (let ((base (package-with-python2 (strip-python2-variant python-sphinx))))
     (package
       (inherit base)
+      (version "1.7.7")
+      (source (origin
+                (method url-fetch)
+                (uri (pypi-uri "Sphinx" version))
+                (sha256
+                 (base32
+                  "0pkkbfj7cl157q550gcs45am5y78ps0h7q6455d64s1zmw01jlvi"))))
+      (arguments
+       (substitute-keyword-arguments (package-arguments base)
+         ((#:phases phases)
+          `(modify-phases ,phases
+             (add-before 'check 'disable-broken-tests
+               (lambda _
+                 ;; These tests are broken when using Python2:
+                 ;; <https://github.com/sphinx-doc/sphinx/issues/4710>.
+                 (for-each delete-file '("tests/test_api_translator.py"
+                                         "tests/test_setup_command.py"))
+                 #t))))))
       (native-inputs `(("python2-mock" ,python2-mock)
                        ("python2-enum34" ,python2-enum34)
                        ,@(package-native-inputs base)))
+      ;; Sphinx 2 has some dependencies that do not support Python 2, so
+      ;; we keep our own propagated-inputs here instead of inheriting.
       (propagated-inputs `(("python2-pytz" ,python2-pytz)
                            ("python2-typing" ,python2-typing)
-                       ,@(package-propagated-inputs base))))))
+                           ("python2-imagesize" ,python2-imagesize)
+                           ("python2-sphinx-alabaster-theme"
+                            ,python2-sphinx-alabaster-theme)
+                           ("python2-babel" ,python2-babel-2.6)
+                           ("python2-snowballstemmer" ,python2-snowballstemmer)
+                           ("python2-docutils" ,python2-docutils)
+                           ("python2-jinja2" ,python2-jinja2)
+                           ("python2-packaging" ,python2-packaging)
+                           ("python2-pygments" ,python2-pygments)
+                           ("python2-requests" ,python2-requests)
+                           ("python2-six" ,python2-six)
+                           ("python2-sphinxcontrib-websupport"
+                            ,python2-sphinxcontrib-websupport))))))
 
 (define-public python-sphinxcontrib-applehelp
   (package
@@ -148,6 +183,26 @@ Apple help books.")
 @url{Devhelp,https://wiki.gnome.org/Apps/Devhelp} documents.")
     (license license:bsd-2)))
 
+(define-public python-sphinxcontrib-htmlhelp
+  (package
+    (name "python-sphinxcontrib-htmlhelp")
+    (version "1.0.2")
+    (source (origin
+              (method url-fetch)
+              (uri (pypi-uri "sphinxcontrib-htmlhelp" version))
+              (sha256
+               (base32
+                "08l4x8a2l4xjqdd5rhvmfsqihmlgg4prdayj9b6pigaii6gzjw26"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:tests? #f))                    ;XXX: circular dependency on Sphinx
+    (home-page "https://github.com/sphinx-doc/sphinxcontrib-htmlhelp")
+    (synopsis "Sphinx exension for rendering HTML help files")
+    (description
+     "@code{sphinxcontrib-htmlhelp} is a Sphinx extension which renders
+HTML help files.")
+    (license license:bsd-2)))
+
 (define-public python-sphinxcontrib-jsmath
   (package
     (name "python-sphinxcontrib-jsmath")
@@ -213,6 +268,26 @@ commands into documents, helping you to keep your command examples up to date.")
 (define-public python2-sphinxcontrib-programoutput
   (package-with-python2 python-sphinxcontrib-programoutput))
 
+(define-public python-sphinxcontrib-qthelp
+  (package
+    (name "python-sphinxcontrib-qthelp")
+    (version "1.0.2")
+    (source (origin
+              (method url-fetch)
+              (uri (pypi-uri "sphinxcontrib-qthelp" version))
+              (sha256
+               (base32
+                "0vs09m6kf5vhiivpi5s5pks59iq0lqlsbkdycpqlysg53bhmqikr"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:tests? #f))                    ;XXX: circular dependency on Sphinx
+    (home-page "https://github.com/sphinx-doc/sphinxcontrib-qthelp")
+    (synopsis "Sphinx extension to output QtHelp documents")
+    (description
+     "@code{sphinxcontrib-qthelp} is a Sphinx extension which outputs QtHelp
+documents.")
+    (license license:bsd-2)))
+
 (define-public python-sphinxcontrib-serializinghtml
   (package
     (name "python-sphinxcontrib-serializinghtml")
@@ -266,7 +341,7 @@ SVG images natively (e.g. LaTeX).")
     (arguments
      ;; FIXME: Tests depend on Sphinx, which depends on this.
      `(#:tests? #f))
-    (home-page "http://sphinx-doc.org/")
+    (home-page "https://sphinx-doc.org/")
     (synopsis "Sphinx API for web applications")
     (description "This package provides a Python API to easily integrate
 Sphinx documentation into your web application.  It provides tools to