Skip to content
Snippets Groups Projects
Commit e6e4cb34 authored by David Malcolm's avatar David Malcolm
Browse files

maintainer-scripts: build the libgdiagnostics docs for the website [PR117883]


maintainer-scripts/ChangeLog:
	PR web/117883
	* update_web_docs_git: Introduce SPHINX_VENV to make
	it easier to test the script.  Add the libgdiagnostics docs
	and testsuite to the files to be preserved.  Use sphinx to build
	the libgdiagnostics docs as HTML.  Copy them into $DOCSDIR.

Signed-off-by: default avatarDavid Malcolm <dmalcolm@redhat.com>
parent 168f938b
No related branches found
No related tags found
No related merge requests found
...@@ -14,6 +14,10 @@ export GITROOT ...@@ -14,6 +14,10 @@ export GITROOT
PATH=/usr/local/bin:$PATH PATH=/usr/local/bin:$PATH
# We use a copy of Sphinx installed in a virtual environment so that
# we don't depend on a system package.
SPHINX_VENV=${SPHINX_VENV:-"/home/gccadmin/venv"}
makeinfo_git=/home/gccadmin/texinfo/install-git/bin/ makeinfo_git=/home/gccadmin/texinfo/install-git/bin/
if [ -x "${makeinfo_git}"/makeinfo ]; then if [ -x "${makeinfo_git}"/makeinfo ]; then
: "${MAKEINFO:=${makeinfo_git}/makeinfo}" : "${MAKEINFO:=${makeinfo_git}/makeinfo}"
...@@ -138,7 +142,7 @@ rm -rf gcc/.git ...@@ -138,7 +142,7 @@ rm -rf gcc/.git
# Note that we have to preserve gcc/jit/docs since the jit docs are # Note that we have to preserve gcc/jit/docs since the jit docs are
# not .texi files (Makefile, .rst and .png), and the jit docs use # not .texi files (Makefile, .rst and .png), and the jit docs use
# include directives to pull in content from jit/jit-common.h and # include directives to pull in content from jit/jit-common.h and
# jit/notes.txt, and from the testsuite, so we have to preserve those also. # Similar considerations apply for libgdiagnostics.
find gcc -type f \( -name '*.texi' \ find gcc -type f \( -name '*.texi' \
-o -path gcc/gcc/doc/install.texi2html \ -o -path gcc/gcc/doc/install.texi2html \
-o -path gcc/gcc/doc/include/texinfo.tex \ -o -path gcc/gcc/doc/include/texinfo.tex \
...@@ -149,6 +153,8 @@ find gcc -type f \( -name '*.texi' \ ...@@ -149,6 +153,8 @@ find gcc -type f \( -name '*.texi' \
-o -path "gcc/gcc/jit/jit-common.h" \ -o -path "gcc/gcc/jit/jit-common.h" \
-o -path "gcc/gcc/jit/notes.txt" \ -o -path "gcc/gcc/jit/notes.txt" \
-o -path "gcc/gcc/testsuite/jit.dg/*" \ -o -path "gcc/gcc/testsuite/jit.dg/*" \
-o -path "gcc/gcc/doc/libgdiagnostics/*" \
-o -path "gcc/gcc/testsuite/libgdiagnostics.dg/*" \
-o -print0 \) | xargs -0 rm -f -o -print0 \) | xargs -0 rm -f
# Build a tarball of the sources. # Build a tarball of the sources.
...@@ -194,18 +200,24 @@ for file in $MANUALS; do ...@@ -194,18 +200,24 @@ for file in $MANUALS; do
fi fi
done done
# The jit is a special-case, using Sphinx rather than texinfo. # jit and libgdiagnostics are a special-case, using Sphinx rather than texinfo.
# Specifically, the jit docs need Sphinx 3.0 or later. # Specifically, they need Sphinx 3.0 or later.
# #
# Use the Sphinx installed in a virtual environment so that # Use the Sphinx installed in a virtual environment so that
# we don't depend on a system package. # we don't depend on a system package.
pushd gcc/gcc/jit/docs pushd gcc/gcc/jit/docs
make html SPHINXBUILD=/home/gccadmin/venv/bin/sphinx-build || true make html SPHINXBUILD=$SPHINX_VENV/bin/sphinx-build || true
popd popd
cp -a gcc/gcc/jit/docs/_build/html jit cp -a gcc/gcc/jit/docs/_build/html jit
mkdir -p $DOCSDIR/jit mkdir -p $DOCSDIR/jit
pushd gcc/gcc/doc/libgdiagnostics
make html SPHINXBUILD=$SPHINX_VENV/bin/sphinx-build || true
popd
cp -a gcc/gcc/doc/libgdiagnostics/_build/html libgdiagnostics
mkdir -p $DOCSDIR/libgdiagnostics
# Work around makeinfo generated file names and references with # Work around makeinfo generated file names and references with
# "_002d" instead of "-". # "_002d" instead of "-".
find . -name '*.html' | while read f; do find . -name '*.html' | while read f; do
...@@ -252,11 +264,11 @@ for file in */*.html *.ps *.pdf *.tar; do ...@@ -252,11 +264,11 @@ for file in */*.html *.ps *.pdf *.tar; do
fi fi
done done
# Again, the jit is a special case, with nested subdirectories # Again, jit and libgdignostics are special cases, with nested subdirectories
# below "jit", and with some non-HTML files (.png images from us, # below them, and with some non-HTML files (.png images from us,
# plus .css and .js supplied by sphinx, and source files, renamed # plus .css and .js supplied by sphinx, and source files, renamed
# from .rst to .txt). # from .rst to .txt).
find jit \ find jit libgdiagnostics \
-name "*.html" -o -name "*.png" \ -name "*.html" -o -name "*.png" \
-o -name "*.css" -o -name "*.js" \ -o -name "*.css" -o -name "*.js" \
-o -name "*.txt" | -o -name "*.txt" |
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment