Navigation Menu

Skip to content

Commit

Permalink
doc: use system sphinx-build instead of hg clone
Browse files Browse the repository at this point in the history
Because it is hard to resolve Sphinx dependency by hand. :<
  • Loading branch information
kou committed Jun 5, 2014
1 parent 60699cf commit 9a291ab
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 23 deletions.
2 changes: 1 addition & 1 deletion build/makefiles/gettext.am
Expand Up @@ -39,7 +39,7 @@ html: build
man: build
pdf: build

gettext: sphinx-ensure-updated
gettext:
rm *.pot || true
$(SPHINX_BUILD_COMMAND) -d doctrees -b gettext $(ALLSPHINXOPTS) .
xgettext --language Python --output conf.pot ../../../source/conf.py
Expand Down
18 changes: 1 addition & 17 deletions build/makefiles/sphinx-build.am
Expand Up @@ -11,25 +11,9 @@ PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = $(PAPEROPT_$(PAPER)) -E $(SPHINXOPTS) $(SOURCE_DIR)

SPHINX_DIR = $(abs_top_builddir)/doc/sphinx
SPHINX_BUILD = $(SPHINX_DIR)/sphinx-build.py
SPHINX_BUILD_COMMAND = \
DOCUMENT_VERSION="$(DOCUMENT_VERSION)" \
DOCUMENT_VERSION_FULL="$(DOCUMENT_VERSION_FULL)" \
LOCALE="$(LOCALE)" \
PYTHONPATH="$(SPHINX_DIR):$$PYTHONPATH" \
python $(SPHINX_BUILD)

.PHONY: sphinx-ensure-updated

if DOCUMENT_BUILDABLE
sphinx-ensure-updated:
if ! $(SPHINX_BUILD_COMMAND) --version | grep -q ' 1\.[23]' > /dev/null; then \
if test -d $(SPHINX_DIR); then \
(cd $(SPHINX_DIR) && $(HG) pull --update); \
else \
$(HG) clone https://bitbucket.org/birkenfeld/sphinx $(SPHINX_DIR); \
fi; \
fi
else
sphinx-ensure-updated:
endif
$(SPHINX_BUILD)
1 change: 0 additions & 1 deletion build/makefiles/sphinx.am
Expand Up @@ -154,7 +154,6 @@ build_stamps = \
doctest-build-stamp

$(build_stamps): $(document_source_files)
$(MAKE) sphinx-ensure-updated
target=`echo $@ | sed -e 's/-build-stamp$$//'`; \
$(SPHINX_BUILD_COMMAND) \
-Dlanguage=$(LOCALE) \
Expand Down
26 changes: 22 additions & 4 deletions configure.ac
Expand Up @@ -1116,14 +1116,32 @@ if test x"$enable_document" != x"no"; then
fi

if test x"$enable_document" = x"yes"; then
AC_PATH_PROG(HG, hg, [])
if test -n "$HG"; then
AC_PATH_PROG(SPHINX_BUILD, sphinx-build, [])
if test -n "$SPHINX_BUILD"; then
sphinx_build_version=`"$SPHINX_BUILD" --version`
if ! echo "$sphinx_build_version" | grep -q ' 1\.[[23]]'; then
AC_MSG_ERROR([
sphinx-build is old: $sphinx_build_version
Sphinx 1.2 or later is required.])
fi
document_available=yes
document_buildable=yes
else
AC_MSG_ERROR("No hg found")
AC_MSG_ERROR([
No sphinx-build found.
Install it and try again.
How to install sphinx-build:
For Debian GNU/Linux based system like Ubuntu:
% sudo apt-get install -y python-pip
% sudo pip install sphinx
For Red Hat based system like CentOS:
% sudo yum install -y python-pip
% sudo pip install sphinx])
fi
AC_SUBST(HG)
AC_SUBST(SPHINX_BUILD)
fi
fi

Expand Down

0 comments on commit 9a291ab

Please sign in to comment.