summaryrefslogtreecommitdiff
path: root/docs/meson.build
blob: 0311e01d2f67e4c541374a119eb17bd5b4920baf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
version_xml = configuration_data()
version_xml.set('GDK_PIXBUF_VERSION', meson.project_version())
configure_file(input: 'version.xml.in',
               output: 'version.xml',
               configuration: version_xml)

if gobject_dep.type_name() == 'pkgconfig'
  glib_prefix = gobject_dep.get_pkgconfig_variable('prefix')
else
  glib_prefix = get_option('prefix')
endif
glib_docpath = join_paths(glib_prefix, 'share', 'gtk-doc', 'html')
docpath = join_paths(gdk_pixbuf_datadir, 'gtk-doc', 'html')

private_headers = [
  'pixops',
  'gdk-pixbuf.h',
  'gdk-pixbuf-alias.h',
  'gdk-pixbuf-autocleanups.h',
  'gdk-pixbuf-buffer-queue-private.h',
  'gdk-pixbuf-marshal.h',
  'gdk-pixbuf-private.h',
  'gdk-pixbuf-scaled-anim.h',
  'io-ani-animation.h',
  'io-gdip-animation.h',
  'io-gdip-native.h',
  'io-gdip-propertytags.h',
  'io-gdip-utils.h',
  'io-gif-animation.h',
  'xpm-color-table.h',
  'test-images.h',
  'lzw.h',
]

if not get_option('x11')
  private_headers += 'contrib'
endif

if get_option('docs')
  gnome.gtkdoc('gdk-pixbuf',
               main_xml: 'gdk-pixbuf.xml',
               src_dir: [ gdk_pixbuf_inc ],
               dependencies: gdkpixbuf_dep,
               gobject_typesfile: 'gdk-pixbuf.types',
               scan_args: [
                 '--rebuild-types',
                 '--deprecated-guards="GDK_PIXBUF_ENABLE_BROKEN|GDK_PIXBUF_DISABLE_DEPRECATED"',
                 '--ignore-headers=' + ' '.join(private_headers),
               ],
               fixxref_args: [
                 '--html-dir=@0@'.format(docpath),
                 '--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')),
                 '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gobject')),
                 '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gio')),
               ],
               html_assets: [
                 'composite.png',
               ],
               content_files: [
                 'gdk-pixbuf-from-drawables.xml',
                 'gdk-pixbuf-rendering.xml',
                 'gdk-pixbuf.xml',
                 'gdk-pixbuf-csource.xml',
                 'gdk-pixbuf-query-loaders.xml',
               ],
               install: true)
endif

xsltproc = find_program('xsltproc', required: false)
if get_option('man') and xsltproc.found()
  xlstproc_flags = [
    '--nonet',
    '--stringparam', 'man.output.quietly', '1',
    '--stringparam', 'funcsynopsis.style', 'ansi',
    '--stringparam', 'man.th.extra1.suppress', '1',
    '--stringparam', 'man.authors.section.enabled', '0',
    '--stringparam', 'man.copyright.section.enabled', '0',
  ]

  man_files = [
    'gdk-pixbuf-csource',
    'gdk-pixbuf-query-loaders',
  ]

  foreach m: man_files
    custom_target(m + '-man',
                  input: '@0@.xml'.format(m),
                  output: '@0@.1'.format(m),
                  command: [
                    xsltproc,
                    xlstproc_flags,
                    '-o', '@OUTPUT@',
                    'http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl',
                    '@INPUT@',
                  ],
                  install: true,
                  install_dir: join_paths(gdk_pixbuf_mandir, 'man1'))
  endforeach
endif