meson.build 3.36 KB
Newer Older
1
2
3
4
5
6
7
8
9
# 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())
10
11
12
13
14
15
16
sphinx_config.set('BUILDDIR', meson.current_build_dir())

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__')
17
18
19
20
21
22
23
24
25
26
27
28
29
30

sphinx_conf_py = configure_file(input : 'conf.py.in',
				output : 'conf.py',
				configuration : sphinx_config,
				install : false)

src_extra = [
	# 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',
31
	'dot/libinput-record.gv',
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
	# 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',
47
48
49
	'svg/software-buttons-conditions.svg',
	'svg/software-buttons-thumbpress.svg',
	'svg/software-buttons-visualized.svg',
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
	'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',
]

src_rst = files(
	'absolute-axes.rst',
	'absolute-coordinate-ranges.rst',
	'architecture.rst',
	'building.rst',
71
	'button-debouncing.rst',
72
73
74
75
76
77
	'clickpad-softbuttons.rst',
	'contributing.rst',
	'device-configuration-via-udev.rst',
	'device-quirks.rst',
	'faqs.rst',
	'gestures.rst',
78
	'index.rst',
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
	'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',
	'tools.rst',
	'touchpad-jumping-cursors.rst',
	'touchpad-pressure.rst',
	'touchpad-jitter.rst',
	'touchpads.rst',
	'trackpoints.rst',
	'what-is-libinput.rst',
	'features.rst',
	'development.rst',
	'troubleshooting.rst',
102
	'configuration.rst',
103
104
105
106
107
108
109
110
111
112
113
114
115
)

src_sphinx = custom_target('sphinx-sources',
			   input : [src_rst, src_extra],
			   output : '.',
			   command : [prg_install, '-t', '@OUTDIR@', '@INPUT@'],
			   build_by_default: true)


# drop '-a' once we are happy with all this
# do not use -j, it breaks on Ubuntu
sphinx_output_dir = 'Documentation'
custom_target('sphinx',
116
	      input : [ sphinx_conf_py, git_version_page ] + src_rst + src_extra,
117
118
119
120
121
	      output : [ sphinx_output_dir ],
	      command : [ sphinx, '-q', '-b', 'html', '-a',
			  meson.current_build_dir(), sphinx_output_dir],
	      depends: [ src_sphinx ],
	      build_by_default : true)