From d75881a403b59ade7e01a431a308849ed897534d Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Tue, 6 Dec 2016 05:52:38 +1300 Subject: [PATCH] [python,python3] Handle shell script sphinx-build We need to run Sphinx for the right version of Python here, so we can't just run sphinx-build as that might be for a different version. Previously we ran $(PYTHON2) $(SPHINX_BUILD)/$(PYTHON3) $(SPHINX_BUILD) but that fails for homebrew where sphinx-build is actually a shell script. Instead invoke sphinx.main() from an inline code snippet. Fixes https://github.com/xapian/xapian/pull/126, reported by Alex Dunn. (cherry picked from commit ec4028ce75ea265bae38b23b019254921607c3cc) --- xapian-bindings/python/Makefile.am | 6 +++++- xapian-bindings/python3/Makefile.am | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/xapian-bindings/python/Makefile.am b/xapian-bindings/python/Makefile.am index 3139dd298..ea5d01941 100644 --- a/xapian-bindings/python/Makefile.am +++ b/xapian-bindings/python/Makefile.am @@ -163,4 +163,8 @@ install-data-local: all-local: $(sphinxdocs) $(sphinxdocs): xapian/__init__.py xapian/_xapian$(PYTHON2_SO) docs/conf.py $(RST_DOCS) $(dist_exampledata_DATA) - PYTHONPATH=..:$$PYTHONPATH $(PYTHON2) $(SPHINX_BUILD) -b html -d doctrees -c docs $(srcdir)/docs docs/html +## We need to run Sphinx for the right version of Python here, so we can't +## just run sphinx-build as that might be for a different version. + PYTHONPATH=..:$$PYTHONPATH $(PYTHON2) \ + -c 'import sphinx,sys;sys.exit(sphinx.main(sys.argv))' \ + -b html -d doctrees -c docs $(srcdir)/docs docs/html diff --git a/xapian-bindings/python3/Makefile.am b/xapian-bindings/python3/Makefile.am index 1c61b6409..e4a20ce40 100644 --- a/xapian-bindings/python3/Makefile.am +++ b/xapian-bindings/python3/Makefile.am @@ -168,4 +168,8 @@ install-data-local: all-local: $(sphinxdocs) $(sphinxdocs): xapian/__init__.py xapian/_xapian$(PYTHON3_SO) docs/conf.py $(RST_DOCS) $(dist_exampledata_DATA) - PYTHONPATH=..:$$PYTHONPATH $(PYTHON3) $(SPHINX_BUILD) -b html -d doctrees -c docs $(srcdir)/docs docs/html +## We need to run Sphinx for the right version of Python here, so we can't +## just run sphinx-build as that might be for a different version. + PYTHONPATH=..:$$PYTHONPATH $(PYTHON3) \ + -c 'import sphinx,sys;sys.exit(sphinx.main(sys.argv))' \ + -b html -d doctrees -c docs $(srcdir)/docs docs/html -- 2.11.4.GIT