meson.build 15 KB
Newer Older
1 2
fs = import('fs')

3
private_headers = [
Matthias Clasen's avatar
Matthias Clasen committed
4 5
  'imm-extra.h',
  'gtkbitmaskprivateimpl.h',
6 7 8
  'gdkpixbufutilsprivate.h',
  'gtkaccelgroupprivate.h',
  'gtkaccelmapprivate.h',
9 10 11 12
  'gtkaccessibleattributesetprivate.h',
  'gtkaccessibleattributevalueprivate.h',
  'gtkaccessibleprivate.h',
  'gtkaccessiblevalueprivate.h',
13 14
  'gtkactionhelperprivate.h',
  'gtkactionmuxerprivate.h',
15 16
  'gtkactionobservableprivate.h',
  'gtkactionobserverprivate.h',
17 18 19 20 21
  'gtkadjustmentprivate.h',
  'gtkallocatedbitmaskprivate.h',
  'gtkappchooserprivate.h',
  'gtkapplicationaccelsprivate.h',
  'gtkapplicationprivate.h',
22
  'gtkatcontextprivate.h',
23 24 25
  'gtkbindingsprivate.h',
  'gtkbitmaskprivate.h',
  'gtkbuilderprivate.h',
26
  'gtkbuilderscopeprivate.h',
27 28 29 30 31 32 33 34
  'gtkbuttonprivate.h',
  'gtkcellareaboxcontextprivate.h',
  'gtkcheckbuttonprivate.h',
  'gtkcolorchooserprivate.h',
  'gtkcoloreditorprivate.h',
  'gtkcolorplaneprivate.h',
  'gtkcolorscaleprivate.h',
  'gtkcolorswatchprivate.h',
35
  'gtkcolumnlistitemfactoryprivate.h',
36
  'gtkcolumnviewcellprivate.h',
37
  'gtkcolumnviewcolumnprivate.h',
38
  'gtkcolumnviewlayoutprivate.h',
39
  'gtkcolumnviewprivate.h',
Matthias Clasen's avatar
Matthias Clasen committed
40
  'gtkcolumnviewsorterprivate.h',
Benjamin Otte's avatar
Benjamin Otte committed
41
  'gtkcolumnviewtitleprivate.h',
42
  'gtkcomboboxprivate.h',
43 44 45 46 47 48 49
  'gtkconstraintexpressionprivate.h',
  'gtkconstraintguideprivate.h',
  'gtkconstraintlayoutprivate.h',
  'gtkconstraintprivate.h',
  'gtkconstraintsolverprivate.h',
  'gtkconstrainttypesprivate.h',
  'gtkconstraintvflparserprivate.h',
50 51 52 53 54
  'gtkcssanimatedstyleprivate.h',
  'gtkcssanimationprivate.h',
  'gtkcssarrayvalueprivate.h',
  'gtkcssbgsizevalueprivate.h',
  'gtkcssbordervalueprivate.h',
55
  'gtkcssboxesimplprivate.h',
Matthias Clasen's avatar
Matthias Clasen committed
56
  'gtkcssboxesprivate.h',
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 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150
  'gtkcsscalcvalueprivate.h',
  'gtkcsscolorvalueprivate.h',
  'gtkcsscornervalueprivate.h',
  'gtkcssdimensionvalueprivate.h',
  'gtkcssdynamicprivate.h',
  'gtkcsseasevalueprivate.h',
  'gtkcssenumvalueprivate.h',
  'gtkcssfiltervalueprivate.h',
  'gtkcssfontfeaturesvalueprivate.h',
  'gtkcssfontvariationsvalueprivate.h',
  'gtkcssiconthemevalueprivate.h',
  'gtkcssimagecrossfadeprivate.h',
  'gtkcssimagefallbackprivate.h',
  'gtkcssimageiconthemeprivate.h',
  'gtkcssimageinvalidprivate.h',
  'gtkcssimagelinearprivate.h',
  'gtkcssimagepaintableprivate.h',
  'gtkcssimageprivate.h',
  'gtkcssimageradialprivate.h',
  'gtkcssimagerecolorprivate.h',
  'gtkcssimagescaledprivate.h',
  'gtkcssimageurlprivate.h',
  'gtkcssimagevalueprivate.h',
  'gtkcssimagewin32private.h',
  'gtkcssinheritvalueprivate.h',
  'gtkcssinitialvalueprivate.h',
  'gtkcsskeyframesprivate.h',
  'gtkcsslookupprivate.h',
  'gtkcssmatcherprivate.h',
  'gtkcssnodedeclarationprivate.h',
  'gtkcssnodeprivate.h',
  'gtkcssnodestylecacheprivate.h',
  'gtkcssnumbervalueprivate.h',
  'gtkcsspalettevalueprivate.h',
  'gtkcssparserprivate.h',
  'gtkcsspathnodeprivate.h',
  'gtkcsspositionvalueprivate.h',
  'gtkcssproviderprivate.h',
  'gtkcssrepeatvalueprivate.h',
  'gtkcssrgbavalueprivate.h',
  'gtkcsssectionprivate.h',
  'gtkcssselectorprivate.h',
  'gtkcssshadowsvalueprivate.h',
  'gtkcssshadowvalueprivate.h',
  'gtkcssshorthandpropertyprivate.h',
  'gtkcssstaticstyleprivate.h',
  'gtkcssstringvalueprivate.h',
  'gtkcssstylechangeprivate.h',
  'gtkcssstyleprivate.h',
  'gtkcssstylepropertyprivate.h',
  'gtkcsstransformvalueprivate.h',
  'gtkcsstransientnodeprivate.h',
  'gtkcsstransitionprivate.h',
  'gtkcsstypesprivate.h',
  'gtkcssunsetvalueprivate.h',
  'gtkcssvalueprivate.h',
  'gtkcsswidgetnodeprivate.h',
  'gtkcsswin32sizevalueprivate.h',
  'gtkdialogprivate.h',
  'gtkentryprivate.h',
  'gtkeventcontrollerlegacyprivate.h',
  'gtkeventcontrollerprivate.h',
  'gtkfilechoosererrorstackprivate.h',
  'gtkfilechoosernativeprivate.h',
  'gtkfilechooserprivate.h',
  'gtkfilechooserwidgetprivate.h',
  'gtkfilefilterprivate.h',
  'gtkfontchooserprivate.h',
  'gtkfontchooserwidgetprivate.h',
  'gtkgesturedragprivate.h',
  'gtkgesturelongpressprivate.h',
  'gtkgesturemultipressprivate.h',
  'gtkgesturepanprivate.h',
  'gtkgestureprivate.h',
  'gtkgesturerotateprivate.h',
  'gtkgesturesingleprivate.h',
  'gtkgesturestylusprivate.h',
  'gtkgestureswipeprivate.h',
  'gtkgesturezoomprivate.h',
  'gtkgizmoprivate.h',
  'gtkheaderbarprivate.h',
  'gtkhslaprivate.h',
  'gtkiconcacheprivate.h',
  'gtkiconcachevalidatorprivate.h',
  'gtkiconhelperprivate.h',
  'gtkiconprivate.h',
  'gtkiconthemeprivate.h',
  'gtkiconviewprivate.h',
  'gtkimagedefinitionprivate.h',
  'gtkimageprivate.h',
  'gtkimcontextsimpleprivate.h',
  'gtkimmoduleprivate.h',
  'gtkkineticscrollingprivate.h',
  'gtklabelprivate.h',
Benjamin Otte's avatar
Benjamin Otte committed
151
  'gtklistbaseprivate.h',
Benjamin Otte's avatar
Benjamin Otte committed
152
  'gtklistitemprivate.h',
153
  'gtklistitemfactoryprivate.h',
154
  'gtklistitemmanagerprivate.h',
Benjamin Otte's avatar
Benjamin Otte committed
155
  'gtklistitemwidgetprivate.h',
156 157 158 159
  'gtklockbuttonprivate.h',
  'gtkmagnifierprivate.h',
  'gtkmediafileprivate.h',
  'gtkmenubuttonprivate.h',
Matthias Clasen's avatar
Matthias Clasen committed
160 161 162
  'gtkmenusectionboxprivate.h',
  'gtkmenutrackeritemprivate.h',
  'gtkmenutrackerprivate.h',
163 164 165 166
  'gtkmodulesprivate.h',
  'gtkmountoperationprivate.h',
  'gtknativedialogprivate.h',
  'gtknomediafileprivate.h',
Matthias Clasen's avatar
Matthias Clasen committed
167
  'gtkpango.h',
168 169 170 171 172
  'gtkplacessidebarprivate.h',
  'gtkplacesviewprivate.h',
  'gtkplacesviewrowprivate.h',
  'gtkpointerfocusprivate.h',
  'gtkpopoverprivate.h',
Matthias Clasen's avatar
Matthias Clasen committed
173
  'gtkprinterprivate.h',
174 175 176
  'gtkprintoperation-private.h',
  'gtkprivate.h',
  'gtkprogresstrackerprivate.h',
Matthias Clasen's avatar
Matthias Clasen committed
177
  'gtkquery.h',
178 179 180 181 182 183 184 185 186 187
  'gtkrangeprivate.h',
  'gtkrbtreeprivate.h',
  'gtkrenderbackgroundprivate.h',
  'gtkrenderborderprivate.h',
  'gtkrendericonprivate.h',
  'gtkrendernodepaintableprivate.h',
  'gtkroundedboxprivate.h',
  'gtkscalerprivate.h',
  'gtksearchentryprivate.h',
  'gtksettingsprivate.h',
Matthias Clasen's avatar
Matthias Clasen committed
188
  'gtkshortcutcontrollerprivate.h',
189 190 191 192 193 194 195 196 197 198 199 200 201 202 203
  'gtkshortcutsshortcutprivate.h',
  'gtkshortcutswindowprivate.h',
  'gtksidebarrowprivate.h',
  'gtksizegroup-private.h',
  'gtksizerequestcacheprivate.h',
  'gtksnapshotprivate.h',
  'gtkstyleanimationprivate.h',
  'gtkstylecascadeprivate.h',
  'gtkstylecontextprivate.h',
  'gtkstylepropertyprivate.h',
  'gtkstyleproviderprivate.h',
  'gtktextbufferprivate.h',
  'gtktextchildprivate.h',
  'gtktextdisplayprivate.h',
  'gtktexthandleprivate.h',
204
  'gtktexthistoryprivate.h',
205 206
  'gtktextiterprivate.h',
  'gtktextlayoutprivate.h',
207
  'gtktextlinedisplaycacheprivate.h',
208 209 210 211 212 213 214
  'gtktextmarkprivate.h',
  'gtktexttagprivate.h',
  'gtktextviewprivate.h',
  'gtktogglebuttonprivate.h',
  'gtktoolbarprivate.h',
  'gtktooltipprivate.h',
  'gtktooltipwindowprivate.h',
Matthias Clasen's avatar
Matthias Clasen committed
215
  'gtktreepopoverprivate.h',
216
  'gtktreeprivate.h',
Matthias Clasen's avatar
Matthias Clasen committed
217
  'gtktreerbtreeprivate.h',
218 219 220 221 222 223 224 225
  'gtkutilsprivate.h',
  'gtkwidgetpaintableprivate.h',
  'gtkwidgetpathprivate.h',
  'gtkwidgetprivate.h',
  'gtkwin32drawprivate.h',
  'gtkwin32themeprivate.h',
  'gtkwindowprivate.h',
  'gtk-text-input-client-protocol.h',
226
  'roaring.h',
227 228 229
]

images = [
Matthias Clasen's avatar
Matthias Clasen committed
230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247
  'images/aboutdialog.png',
  'images/accel-label.png',
  'images/action-bar.png',
  'images/appchooserbutton.png',
  'images/appchooserdialog.png',
  'images/arrows.png',
  'images/assistant.png',
  'images/background.png',
  'images/bloatpad-gnome.png',
  'images/bloatpad-osx.png',
  'images/bloatpad-xfce.png',
  'images/border1.png',
  'images/border2.png',
  'images/border3.png',
  'images/box-expand.png',
  'images/box-packing.png',
  'images/builder-shortcuts.png',
  'images/button.png',
248
  'images/capture-bubble.png',
Matthias Clasen's avatar
Matthias Clasen committed
249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324
  'images/check-button.png',
  'images/checks.png',
  'images/clocks-shortcuts.png',
  'images/color-button.png',
  'images/colorchooser.png',
  'images/combo-box-entry.png',
  'images/combo-box.png',
  'images/combo-box-text.png',
  'images/down-center.png',
  'images/down-end.png',
  'images/down-start.png',
  'images/drawing.png',
  'images/ease-in-out.png',
  'images/ease-in.png',
  'images/ease-out.png',
  'images/ease.png',
  'images/entry.png',
  'images/exampleapp.png',
  'images/expanders.png',
  'images/extensions.png',
  'images/figure-hierarchical-drawing.png',
  'images/figure-windowed-label.png',
  'images/file-button.png',
  'images/filechooser.png',
  'images/flow-box.png',
  'images/focus.png',
  'images/font-button.png',
  'images/fontchooser.png',
  'images/frame-gap.png',
  'images/frame.png',
  'images/frames.png',
  'images/gedit-shortcuts.png',
  'images/getting-started-app10.png',
  'images/getting-started-app1.png',
  'images/getting-started-app2.png',
  'images/getting-started-app3.png',
  'images/getting-started-app4.png',
  'images/getting-started-app6.png',
  'images/getting-started-app7.png',
  'images/getting-started-app8.png',
  'images/getting-started-app9.png',
  'images/glarea.png',
  'images/gradient1.png',
  'images/gradient2.png',
  'images/gradient3.png',
  'images/gradient4.png',
  'images/grid-packing.png',
  'images/handles.png',
  'images/headerbar.png',
  'images/hello-world.png',
  'images/icon-view.png',
  'images/image.png',
  'images/info-bar.png',
  'images/inspector.png',
  'images/label.png',
  'images/layout-btlr.png',
  'images/layout-btrl.png',
  'images/layout-lrbt.png',
  'images/layout-lrtb.png',
  'images/layout-rlbt.png',
  'images/layout-rltb.png',
  'images/layout-tblr.png',
  'images/layout-tbrl.png',
  'images/left-center.png',
  'images/left-end.png',
  'images/left-start.png',
  'images/levelbar.png',
  'images/linear.png',
  'images/link-button.png',
  'images/list-and-tree.png',
  'images/list-box.png',
  'images/lockbutton-locked.png',
  'images/lock-button.png',
  'images/lockbutton.png',
  'images/lockbutton-sorry.png',
  'images/lockbutton-unlocked.png',
325
  'images/media-controls.png',
Matthias Clasen's avatar
Matthias Clasen committed
326 327 328 329 330 331 332 333
  'images/menubar.png',
  'images/menu-button.png',
  'images/messagedialog.png',
  'images/multiline-text.png',
  'images/notebook.png',
  'images/options.png',
  'images/pagesetupdialog.png',
  'images/panes.png',
334
  'images/password-entry.png',
335
  'images/picture.png',
Matthias Clasen's avatar
Matthias Clasen committed
336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367
  'images/placessidebar.png',
  'images/popup-anchors.png',
  'images/popup-at.svg',
  'images/popup-flip.png',
  'images/popup-slide.png',
  'images/printdialog.png',
  'images/progressbar.png',
  'images/radio-group.png',
  'images/right-center.png',
  'images/right-end.png',
  'images/right-start.png',
  'images/scales.png',
  'images/scrollbar.png',
  'images/scrolledwindow.png',
  'images/search-bar.png',
  'images/search-entry.png',
  'images/separator.png',
  'images/sidebar.png',
  'images/slices.png',
  'images/sliders.png',
  'images/spinbutton.png',
  'images/spinner.png',
  'images/stack.png',
  'images/stackswitcher.png',
  'images/statusbar.png',
  'images/switch.png',
  'images/toggle-button.png',
  'images/toolbar.png',
  'images/tree-view-coordinates.png',
  'images/up-center.png',
  'images/up-end.png',
  'images/up-start.png',
368
  'images/video.png',
Matthias Clasen's avatar
Matthias Clasen committed
369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389
  'images/volumebutton.png',
  'images/widget-hvalign.png',
  'images/window-default.png',
  'images/window.png',
]

content_files = [
  'gtk4-broadwayd.xml',
  'gtk4-builder-tool.xml',
  'gtk4-demo-application.xml',
  'gtk4-demo.xml',
  'gtk4-encode-symbolic-svg.xml',
  'gtk4-icon-browser.xml',
  'gtk4-launch.xml',
  'gtk4-query-settings.xml',
  'gtk4-update-icon-cache.xml',
  'gtk4-widget-factory.xml',
  'overview.xml',
  'visual_index.xml',
]

390
expand_content_md_files = [
391 392 393 394
  'broadway.md',
  'osx.md',
  'wayland.md',
  'windows.md',
395
  'x11.md',
396
  'getting_started.md',
397
  'resources.md',
398 399 400
  'building.md',
  'compiling.md',
  'running.md',
401 402 403 404
  'migrating-2to4.md',
  'migrating-3to4.md',
  'actions.md',
  'input-handling.md',
405 406
  'drawing-model.md',
  'css-overview.md',
407
  'css-properties.md',
408
  'section-accessibility.md',
409 410
  'section-text-widget.md',
  'section-tree-widget.md',
411
  'section-list-widget.md',
412
  'question_index.md',
413 414
]

415 416 417 418 419 420 421 422 423 424 425 426 427
types_conf = configuration_data()
if os_win32
  types_conf.set('DISABLE_ON_W32', '%')
else
  types_conf.set('DISABLE_ON_W32', '')
endif

if os_darwin
  types_conf.set('DISABLE_ON_QUARTZ', '%')
else
  types_conf.set('DISABLE_ON_QUARTZ', '')
endif

428
if get_option('gtk_doc')
429 430
  configure_file(input: 'version.xml.in', output: 'version.xml', configuration: version_conf)

Matthias Clasen's avatar
Matthias Clasen committed
431 432
  # gtk-markdown-to-docbook uses pandoc
  pandoc = find_program('pandoc', required: true)
433 434 435 436 437 438 439 440 441
  expand_md = find_program('gtk-markdown-to-docbook')
  expand_md_targets = []
  foreach t : expand_content_md_files
    expand_md_targets += custom_target(t,
                                       input: [ t ],
                                       output: [ fs.replace_suffix(t, '.xml') ],
                                       command: [ expand_md, '@INPUT@', '@OUTPUT@'])
  endforeach

442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470
  gnome.gtkdoc('gtk4',
               mode: 'none',
               main_xml: 'gtk4-docs.xml',
               src_dir: [
                 gtkinc,
               ],
               dependencies: libgtk_dep,
               gobject_typesfile: configure_file(
                 input: 'gtk4.types.in',
                 output: 'gtk4.types',
                 configuration: types_conf,
               ),
               scan_args: [
                 '--ignore-decorators=_GDK_EXTERN|G_GNUC_WARN_UNUSED_RESULT',
                 '--ignore-headers=' + ' '.join(private_headers),
               ],
               mkdb_args: [
                 '--default-includes=gtk/gtk.h',
               ],
               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')),
                 '--extra-dir=@0@'.format(cairo_docpath),
                 '--extra-dir=@0@'.format(gdkpixbuf_docpath),
                 '--extra-dir=../gdk',
                 '--extra-dir=../gsk',
               ],
471
               content_files: content_files + expand_md_targets,
472 473 474
               html_assets: images,
               install: true)
endif
475 476

xsltproc = find_program('xsltproc', required: false)
477
if get_option('man-pages') and not xsltproc.found()
478 479 480
  error('No xsltproc found, but man pages were explicitly enabled')
endif

481
if get_option('man-pages') and xsltproc.found()
482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520
  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 = [
    [ 'gtk4-broadwayd', '1', ],
    [ 'gtk4-builder-tool', '1', ],
    [ 'gtk4-demo', '1', ],
    [ 'gtk4-demo-application', '1', ],
    [ 'gtk4-encode-symbolic-svg', '1', ],
    [ 'gtk4-icon-browser', '1', ],
    [ 'gtk4-launch', '1', ],
    [ 'gtk4-query-settings', '1', ],
    [ 'gtk4-update-icon-cache', '1', ],
    [ 'gtk4-widget-factory', '1', ],
  ]

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