Skip to content

Commit

Permalink
Doc: updates to support building with upcoming update proj-docs Docke…
Browse files Browse the repository at this point in the history
…r image updated to Ubuntu 24.04

I've tested locally those changes with a local build of the updated
proj-docs Docker image per OSGeo/PROJ#4128
  • Loading branch information
rouault committed Apr 26, 2024
1 parent 2be3c80 commit 22b74a9
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/doc_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
apt update
apt install -y libproj-dev swig
python3 -m pip install -r doc/requirements.txt
python3 -m pip install numpy
python3 -m pip install numpy setuptools
pushd .
mkdir build
cd build
Expand All @@ -43,6 +43,14 @@ jobs:
-DOGR_BUILD_OPTIONAL_DRIVERS=OFF
cmake --build . -j$(nproc)
cmake --install .
# With the new ghcr.io/osgeo/proj-docs image based on Ubuntu 24.04
# a venv is activated. The above does not install the
# Python bindings into it (and the ones in the system are not found
# without overriding PYTHONPATH), so do it through pip install
cd swig/python
python3 setup.py sdist
cp dist/* /tmp/gdal.tar.gz
python3 -m pip install /tmp/gdal.tar.gz
ldconfig
popd
Expand Down
18 changes: 17 additions & 1 deletion doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,14 +441,30 @@
\fi
"""

# Package substitutefont no longer exists since TeXLive 2023 later than August 2023
# and has been replaced with sphinxpackagesubstitutefont
# https://github.com/jfbu/sphinx/commit/04cbd819b0e285d058549b2173af7efadf1cd020
import sphinx

if os.path.exists(
os.path.join(
os.path.dirname(sphinx.__file__), "texinputs", "sphinxpackagesubstitutefont.sty"
)
):
substitutefont_package = "sphinxpackagesubstitutefont"
else:
substitutefont_package = "substitutefont"

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
"preamble": preamble,
"inputenc": "\\usepackage[utf8]{inputenc}\n\\usepackage{CJKutf8}\n\\usepackage{substitutefont}",
"inputenc": "\\usepackage[utf8]{inputenc}\n\\usepackage{CJKutf8}\n\\usepackage{"
+ substitutefont_package
+ "}",
"babel": "\\usepackage[russian,main=english]{babel}\n\\selectlanguage{english}",
"fontenc": "\\usepackage[LGR,X2,T1]{fontenc}"
# Latex figure (float) alignment
Expand Down

0 comments on commit 22b74a9

Please sign in to comment.