[PATCH] wip: support differently named sphinx-build binaries

Tomi Ollila tomi.ollila at iki.fi
Sat Oct 13 12:52:13 PDT 2018


Needed at least on Fedora 28 when only python3-sphinx is installed.

This is just midway to quick hack (which I used when updating wiki
manpages) and full support (and will time fix this before anyone
really cares)...

---
 configure          | 20 +++++++++++++++++++-
 doc/Makefile.local |  3 +--
 2 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index b2200be0..505fea69 100755
--- a/configure
+++ b/configure
@@ -654,12 +654,27 @@ if [ $WITH_RUBY = "1" ] ; then
     fi
 fi
 
+# the value of sphinx_build will be written to Makefile.config
+# even WITH_DOCS=0 (current Makefile.config generator doesn't
+# provide (neat) way to leave SPHINXBUID variable out)
+# Note: currently I'm naming this a bit differently... ;/
+
+SPHINX_BUILD=${SPHINX_BUILD:-} # move this line up...
+
+sphinx_build=
+for name in ${SPHINX_BUILD} sphinx-build-3 sphinx-build; do
+    if command -v $name > /dev/null; then
+	sphinx_build=$name
+	break
+    fi
+done
+
 have_sphinx=0
 have_makeinfo=0
 have_install_info=0
 if [ $WITH_DOCS = "1" ] ; then
     printf "Checking if sphinx is available and supports nroff output... "
-    if command -v sphinx-build > /dev/null && ${python} -m sphinx.writers.manpage > /dev/null 2>&1 ; then
+    if test "$sphinx_build" && ${python} -m sphinx.writers.manpage > /dev/null 2>&1 ; then
 	printf "Yes.\n"
 	have_sphinx=1
     else
@@ -1117,6 +1132,9 @@ HAVE_EMACS = ${have_emacs}
 # Whether there's a sphinx-build binary available for building documentation
 HAVE_SPHINX=${have_sphinx}
 
+# The sphinx-build found... (or default if not found)
+SPHINXBUILD=${sphinx_build:-sphinx-build}
+
 # Whether there's a makeinfo binary available for building info format documentation
 HAVE_MAKEINFO=${have_makeinfo}
 
diff --git a/doc/Makefile.local b/doc/Makefile.local
index 16459e35..1cb1c893 100644
--- a/doc/Makefile.local
+++ b/doc/Makefile.local
@@ -2,9 +2,8 @@
 
 dir := doc
 
-# You can set these variables from the command line.
 SPHINXOPTS    := -q
-SPHINXBUILD   = sphinx-build
+SPHINXBUILD   ?= sphinx-build
 DOCBUILDDIR      := $(dir)/_build
 
 # Internal variables.
-- 
2.17.1



More information about the notmuch mailing list