Merge pull request #3720 from b4n/encodings-ui-improvements
[geany-mirror.git] / doc / meson.build
blob2fa8cab6d1941d99e82fd887c30c85472198f400
1 configure_file(
2         input: 'geany.1.in',
3         output: 'geany.1',
4         install: true,
5         install_dir: join_paths(join_paths(prefix, get_option('mandir'), 'man1')),
6         configuration: cdata
9 if rst2pdf.found()
10         custom_target('pdf-manual',
11                 input: ['geany.txt'],
12                 output: ['geany-@0@.pdf'.format(cdata.get('VERSION'))],
13                 command: [rst2pdf, '@INPUT@', '-o', '@OUTPUT@'],
14                 build_by_default: true
15         )
16 endif
18 tarball = run_command('test', '-f', 'geany.html', check: false)
19 if tarball.returncode() == 0 or rst2html.found()
20         install_data(
21                 'images/build_menu_commands_dialog.png',
22                 'images/edit_change_history.png',
23                 'images/find_dialog.png',
24                 'images/find_in_files_dialog.png',
25                 'images/main_window.png',
26                 'images/pref_dialog_edit_completions.png',
27                 'images/pref_dialog_edit_display.png',
28                 'images/pref_dialog_edit_features.png',
29                 'images/pref_dialog_edit_indentation.png',
30                 'images/pref_dialog_files.png',
31                 'images/pref_dialog_gen_misc.png',
32                 'images/pref_dialog_gen_startup.png',
33                 'images/pref_dialog_interface_interface.png',
34                 'images/pref_dialog_interface_notebook.png',
35                 'images/pref_dialog_interface_toolbar.png',
36                 'images/pref_dialog_keys.png',
37                 'images/pref_dialog_printing.png',
38                 'images/pref_dialog_templ.png',
39                 'images/pref_dialog_tools.png',
40                 'images/pref_dialog_various.png',
41                 'images/pref_dialog_vte.png',
42                 'images/replace_dialog.png',
43                 'images/sidebar_documents_only.png',
44                 'images/sidebar_show_paths.png',
45                 'images/sidebar_show_tree.png',
46                 install_dir: join_paths(cdata.get('GEANY_DOC_DIR'), 'html', 'images')
47         )
48         if tarball.returncode() == 0
49                 message('Building from tarball, installing prebuild html')
50                 geany_html = files('geany.html')
51         else
52                 cmd = [rst2html, '-stg', '--stylesheet=@INPUT0@', '@INPUT1@', '@OUTPUT@']
53                 geany_html = custom_target('geany.html',
54                         input: ['geany.css', 'geany.txt'],
55                         output: ['geany.html'],
56                         build_by_default: true,
57                         command: cmd
58                 )
59                 custom_target('hacking.html',
60                         input: ['geany.css', '../HACKING'],
61                         output: ['hacking.html'],
62                         build_by_default: true,
63                         command: cmd
64                 )
65         endif
66         # geany.html is installed as index.html
67         custom_target('index.html',
68                 input: [geany_html],
69                 output: ['index.html'],
70                 command: [ln, '-f', '@INPUT@', '@OUTPUT@'],
71                 install: true,
72                 install_dir: join_paths(cdata.get('GEANY_DOC_DIR'), 'html')
73         )
74 endif
76 install_data('geany.txt',
77         rename: 'manual.txt',
78         install_dir: cdata.get('GEANY_DOC_DIR')
81 # Normally, doxygen is required for the gtkdoc headers
82 # but it can be disabled if really needed (e.g. if plugins are also disabled),
83 # packagers must not disable this!
84 if doxygen.found()
85         doxcfg = configuration_data()
86         doxcfg.merge_from(cdata)
87         doxcfg.set('GIRONLY', '@internal')
88         doxcfg.set('HTML', 'YES')
89         doxcfg.set('XML', 'NO')
90         doxcfg.set('SORT', 'YES')
92         doxgicfg = doxcfg
93         doxgicfg.set('GIRONLY', '')
94         doxgicfg.set('HTML', 'NO')
95         doxgicfg.set('XML', 'YES')
96         doxgicfg.set('SORT', 'NO')
98         dep_doxygen = files([
99                 'plugins.dox',
100                 'pluginsignals.c',
101                 'pluginsymbols.c',
102                 'stash-example.c',
103                 'stash-gui-example.c'
104         ])
105         if python.found()
106                 doxyfile_gi = configure_file(
107                         input: 'Doxyfile.in',
108                         output: 'Doxyfile-gi',
109                         configuration: doxgicfg
110                 )
111                 doxygen_gi = custom_target('doxygen-gi',
112                         input: doxyfile_gi,
113                         # stamp file due https://github.com/mesonbuild/meson/issues/2320
114                         output: 'doxygen-gi.stamp',
115                         command: [sh, '-c', 'doxygen "$1" && touch "$2"', 'sh', '@INPUT@', '@OUTPUT@'],
116                         depends: libgeany,
117                         depend_files: dep_doxygen
118                 )
119                 gtkdoc_py = find_program('../scripts/gen-api-gtkdoc.py')
120                 custom_target('gtkdoc-headers',
121                         output: ['geany-gtkdoc.h', 'geany-sciwrappers-gtkdoc.h'],
122                         command: [gtkdoc_py, join_paths(meson.current_build_dir(), 'xml'), '-d', '.', '-o', '@OUTPUT0@', '--sci-output', '@OUTPUT1@'],
123                         depends: doxygen_gi,
124                         install: true,
125                         install_dir: join_paths(get_option('includedir'), 'geany', 'gtkdoc')
126                 )
127         endif
128         doxyfile = configure_file(
129                 input: 'Doxyfile.in',
130                 output: 'Doxyfile',
131                 configuration: doxcfg
132         )
133         custom_target('doxygen',
134                 input: doxyfile,
135                 # stamp file due https://github.com/mesonbuild/meson/issues/2320
136                 output: 'doxygen.stamp',
137                 command: [sh, '-c', 'doxygen "$1" && touch "$2"', 'sh', '@INPUT@', '@OUTPUT@'],
138                 depends: libgeany,
139                 depend_files: dep_doxygen,
140                 build_by_default: true
141         )
142 endif