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