2018-07-10 17:32:35 +10:00
|
|
|
# Sphinx build
|
|
|
|
|
sphinx = find_program('sphinx-build-3', 'sphinx-build', required : false)
|
|
|
|
|
if not sphinx.found()
|
|
|
|
|
error('Program "sphinx-build" not found or not executable. Try building with -Ddocumentation=false')
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
sphinx_config = configuration_data()
|
|
|
|
|
sphinx_config.set('PROJECT_NAME', meson.project_name())
|
|
|
|
|
sphinx_config.set('PROJECT_VERSION', meson.project_version())
|
2018-08-02 09:30:57 +10:00
|
|
|
sphinx_config.set('BUILDDIR', meson.current_build_dir())
|
2019-10-17 13:53:07 +10:00
|
|
|
sphinx_config.set('HTTP_DOC_LINK', doc_url)
|
2018-08-02 09:30:57 +10:00
|
|
|
|
|
|
|
|
git_version_page = vcs_tag(command : ['git', 'log', '-1', '--format=%H'],
|
|
|
|
|
fallback : 'unknown',
|
|
|
|
|
input : 'git_version.py.in',
|
|
|
|
|
output : 'git_version.py',
|
|
|
|
|
replace_string: '__GIT_VERSION__')
|
2018-07-10 17:32:35 +10:00
|
|
|
|
|
|
|
|
sphinx_conf_py = configure_file(input : 'conf.py.in',
|
|
|
|
|
output : 'conf.py',
|
2019-08-02 22:45:16 +10:00
|
|
|
configuration : sphinx_config)
|
2018-07-10 17:32:35 +10:00
|
|
|
|
2018-08-03 11:04:18 +10:00
|
|
|
# 404 replacements for old URLs
|
|
|
|
|
# The switch to sphinx caused a few pages to be renamed, sphinx uses
|
|
|
|
|
# filename.html whereas doxygen used whatever the @page foo was. So old docs
|
|
|
|
|
# *mostly* used underscores, now we're consistent with dashes.
|
|
|
|
|
# We can't use htaccess on the server, so let's auto-generate a 404 list
|
|
|
|
|
# with a basic page telling users that the link has moved. This can be
|
|
|
|
|
# removed in a few months, towards the end of 2018.
|
|
|
|
|
#
|
|
|
|
|
# File list is: [current-sphinx-input-file, old-generated-page]
|
|
|
|
|
# If they're the same they'll be ignored.
|
|
|
|
|
src_404s = [
|
|
|
|
|
[ 'absolute-axes.rst', 'absolute_axes.html'],
|
|
|
|
|
[ 'absolute-coordinate-ranges.rst', 'absolute_coordinate_ranges.html'],
|
|
|
|
|
[ 'architecture.rst', 'architecture.html'],
|
|
|
|
|
[ 'building.rst', 'building_libinput.html'],
|
|
|
|
|
[ 'button-debouncing.rst', 'button_debouncing.html'],
|
|
|
|
|
[ 'clickpad-softbuttons.rst', 'clickpad_softbuttons.html'],
|
|
|
|
|
[ 'configuration.rst', 'config_options.html'],
|
|
|
|
|
[ 'contributing.rst', 'contributing.html'],
|
|
|
|
|
[ 'development.rst', 'development.html'],
|
|
|
|
|
[ 'device-configuration-via-udev.rst', 'udev_config.html'],
|
|
|
|
|
[ 'device-quirks.rst', 'device-quirks.html'],
|
|
|
|
|
[ 'faqs.rst', 'faq.html'],
|
|
|
|
|
[ 'features.rst', 'features.html'],
|
|
|
|
|
[ 'gestures.rst', 'gestures.html'],
|
|
|
|
|
[ 'middle-button-emulation.rst', 'middle_button_emulation.html'],
|
|
|
|
|
[ 'normalization-of-relative-motion.rst', 'motion_normalization.html'],
|
|
|
|
|
[ 'palm-detection.rst', 'palm_detection.html'],
|
|
|
|
|
[ 'pointer-acceleration.rst', 'pointer-acceleration.html'],
|
|
|
|
|
[ 'reporting-bugs.rst', 'reporting_bugs.html'],
|
|
|
|
|
[ 'scrolling.rst', 'scrolling.html'],
|
|
|
|
|
[ 'seats.rst', 'seats.html'],
|
|
|
|
|
[ 'switches.rst', 'switches.html'],
|
|
|
|
|
[ 't440-support.rst', 't440_support.html'],
|
|
|
|
|
[ 'tablet-support.rst', 'tablet-support.html'],
|
|
|
|
|
[ 'tapping.rst', 'tapping.html'],
|
|
|
|
|
[ 'test-suite.rst', 'test-suite.html'],
|
|
|
|
|
[ 'timestamps.rst', 'timestamps.html'],
|
|
|
|
|
[ 'tools.rst', 'tools.html'],
|
|
|
|
|
[ 'touchpad-jitter.rst', 'touchpad_jitter.html'],
|
|
|
|
|
[ 'touchpad-jumping-cursors.rst', 'touchpad_jumping_cursor.html'],
|
|
|
|
|
[ 'touchpad-pressure.rst', 'touchpad_pressure.html'],
|
|
|
|
|
[ 'touchpads.rst', 'touchpads.html'],
|
|
|
|
|
[ 'trackpoints.rst', 'trackpoints.html'],
|
|
|
|
|
[ 'troubleshooting.rst', 'troubleshooting.html'],
|
|
|
|
|
[ 'what-is-libinput.rst', 'what_is_libinput.html'],
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
dst_404s = []
|
|
|
|
|
foreach s404 : src_404s
|
|
|
|
|
target = s404[0]
|
|
|
|
|
oldpage = s404[1]
|
|
|
|
|
tname = target.split('.rst')[0]
|
|
|
|
|
oname = oldpage.split('.html')[0]
|
|
|
|
|
|
|
|
|
|
if tname != oname
|
|
|
|
|
config_404 = configuration_data()
|
|
|
|
|
config_404.set('TARGET', '@0@.html'.format(tname))
|
|
|
|
|
c = configure_file(input : '404.rst',
|
|
|
|
|
output : '@0@.rst'.format(oname),
|
2019-08-02 22:45:16 +10:00
|
|
|
configuration : config_404)
|
2018-08-03 11:04:18 +10:00
|
|
|
dst_404s += [c]
|
|
|
|
|
endif
|
|
|
|
|
endforeach
|
|
|
|
|
|
2018-08-08 11:18:20 +10:00
|
|
|
src_rst = files(
|
2018-07-10 17:32:35 +10:00
|
|
|
# dot drawings
|
|
|
|
|
'dot/seats-sketch.gv',
|
|
|
|
|
'dot/seats-sketch-libinput.gv',
|
|
|
|
|
'dot/libinput-stack-wayland.gv',
|
|
|
|
|
'dot/libinput-stack-xorg.gv',
|
|
|
|
|
'dot/libinput-stack-gnome.gv',
|
|
|
|
|
'dot/evemu.gv',
|
2018-07-31 16:03:49 +10:00
|
|
|
'dot/libinput-record.gv',
|
2018-07-10 17:32:35 +10:00
|
|
|
# svgs
|
|
|
|
|
'svg/button-debouncing-wave-diagram.svg',
|
|
|
|
|
'svg/button-scrolling.svg',
|
|
|
|
|
'svg/clickfinger.svg',
|
|
|
|
|
'svg/clickfinger-distance.svg',
|
|
|
|
|
'svg/edge-scrolling.svg',
|
|
|
|
|
'svg/gesture-2fg-ambiguity.svg',
|
|
|
|
|
'svg/palm-detection.svg',
|
|
|
|
|
'svg/pinch-gestures.svg',
|
|
|
|
|
'svg/pinch-gestures-softbuttons.svg',
|
|
|
|
|
'svg/ptraccel-linear.svg',
|
|
|
|
|
'svg/ptraccel-low-dpi.svg',
|
|
|
|
|
'svg/ptraccel-touchpad.svg',
|
|
|
|
|
'svg/ptraccel-trackpoint.svg',
|
|
|
|
|
'svg/software-buttons.svg',
|
2018-07-31 18:17:48 +10:00
|
|
|
'svg/software-buttons-conditions.svg',
|
|
|
|
|
'svg/software-buttons-thumbpress.svg',
|
|
|
|
|
'svg/software-buttons-visualized.svg',
|
2018-07-10 17:32:35 +10:00
|
|
|
'svg/swipe-gestures.svg',
|
|
|
|
|
'svg/tablet-axes.svg',
|
|
|
|
|
'svg/tablet-cintiq24hd-modes.svg',
|
|
|
|
|
'svg/tablet-interfaces.svg',
|
|
|
|
|
'svg/tablet-intuos-modes.svg',
|
|
|
|
|
'svg/tablet-left-handed.svg',
|
|
|
|
|
'svg/tablet-out-of-bounds.svg',
|
|
|
|
|
'svg/tablet.svg',
|
|
|
|
|
'svg/tap-n-drag.svg',
|
|
|
|
|
'svg/thumb-detection.svg',
|
|
|
|
|
'svg/top-software-buttons.svg',
|
|
|
|
|
'svg/touchscreen-gestures.svg',
|
|
|
|
|
'svg/trackpoint-delta-illustration.svg',
|
|
|
|
|
'svg/twofinger-scrolling.svg',
|
2018-08-08 11:18:20 +10:00
|
|
|
# rst files
|
2018-07-10 17:32:35 +10:00
|
|
|
'absolute-axes.rst',
|
|
|
|
|
'absolute-coordinate-ranges.rst',
|
|
|
|
|
'architecture.rst',
|
|
|
|
|
'building.rst',
|
2018-08-02 09:44:01 +10:00
|
|
|
'button-debouncing.rst',
|
2018-07-10 17:32:35 +10:00
|
|
|
'clickpad-softbuttons.rst',
|
|
|
|
|
'contributing.rst',
|
|
|
|
|
'device-configuration-via-udev.rst',
|
|
|
|
|
'device-quirks.rst',
|
|
|
|
|
'faqs.rst',
|
|
|
|
|
'gestures.rst',
|
|
|
|
|
'middle-button-emulation.rst',
|
|
|
|
|
'normalization-of-relative-motion.rst',
|
|
|
|
|
'palm-detection.rst',
|
|
|
|
|
'pointer-acceleration.rst',
|
|
|
|
|
'reporting-bugs.rst',
|
|
|
|
|
'scrolling.rst',
|
|
|
|
|
'seats.rst',
|
|
|
|
|
'switches.rst',
|
|
|
|
|
't440-support.rst',
|
|
|
|
|
'tablet-support.rst',
|
|
|
|
|
'tapping.rst',
|
|
|
|
|
'test-suite.rst',
|
|
|
|
|
'timestamps.rst',
|
2018-08-20 09:49:55 +10:00
|
|
|
'tablet-debugging.rst',
|
2018-07-10 17:32:35 +10:00
|
|
|
'tools.rst',
|
|
|
|
|
'touchpad-jumping-cursors.rst',
|
|
|
|
|
'touchpad-pressure.rst',
|
2018-08-06 13:37:30 +10:00
|
|
|
'touchpad-pressure-debugging.rst',
|
2018-07-10 17:32:35 +10:00
|
|
|
'touchpad-jitter.rst',
|
2019-07-10 14:06:07 +10:00
|
|
|
'touchpad-thumb-detection.rst',
|
2018-07-10 17:32:35 +10:00
|
|
|
'touchpads.rst',
|
|
|
|
|
'trackpoints.rst',
|
2018-08-16 12:39:15 +10:00
|
|
|
'trackpoint-configuration.rst',
|
2018-07-10 17:32:35 +10:00
|
|
|
'what-is-libinput.rst',
|
|
|
|
|
'features.rst',
|
|
|
|
|
'development.rst',
|
|
|
|
|
'troubleshooting.rst',
|
2018-07-28 19:35:36 +10:00
|
|
|
'configuration.rst',
|
2018-07-10 17:32:35 +10:00
|
|
|
)
|
|
|
|
|
|
2018-08-08 11:18:20 +10:00
|
|
|
config_noop = configuration_data()
|
|
|
|
|
# Set a dummy replacement to silence meson warnings:
|
|
|
|
|
# meson.build:487: WARNING: Got an empty configuration_data() object and
|
|
|
|
|
# found no substitutions in the input file 'foo'. If you
|
|
|
|
|
# want to copy a file to the build dir, use the 'copy:'
|
|
|
|
|
# keyword argument added in 0.47.0
|
|
|
|
|
config_noop.set('dummy', 'dummy')
|
|
|
|
|
src_sphinx = []
|
|
|
|
|
foreach f : src_rst
|
|
|
|
|
sf = configure_file(input: f,
|
|
|
|
|
output: '@PLAINNAME@',
|
2019-08-02 22:45:16 +10:00
|
|
|
configuration : config_noop)
|
2018-08-08 11:18:20 +10:00
|
|
|
src_sphinx += [ sf ]
|
|
|
|
|
endforeach
|
2018-07-10 17:32:35 +10:00
|
|
|
|
2019-10-17 13:53:07 +10:00
|
|
|
configure_file(input: 'index.rst',
|
|
|
|
|
output: 'index.rst',
|
|
|
|
|
configuration: sphinx_config)
|
|
|
|
|
|
2018-07-10 17:32:35 +10:00
|
|
|
|
|
|
|
|
# do not use -j, it breaks on Ubuntu
|
|
|
|
|
sphinx_output_dir = 'Documentation'
|
|
|
|
|
custom_target('sphinx',
|
2018-08-08 11:18:20 +10:00
|
|
|
input : [ sphinx_conf_py, git_version_page ] + src_sphinx + dst_404s,
|
2018-07-10 17:32:35 +10:00
|
|
|
output : [ sphinx_output_dir ],
|
2018-08-06 15:19:57 +10:00
|
|
|
command : [ sphinx, '-q', '-b', 'html',
|
2018-07-10 17:32:35 +10:00
|
|
|
meson.current_build_dir(), sphinx_output_dir],
|
|
|
|
|
build_by_default : true)
|