File: meson.build

package info (click to toggle)
gimp 3.0.4-3
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 210,076 kB
  • sloc: ansic: 842,287; lisp: 10,761; python: 10,318; cpp: 7,238; perl: 4,355; sh: 1,043; xml: 963; yacc: 609; lex: 348; javascript: 150; makefile: 43
file content (108 lines) | stat: -rw-r--r-- 3,042 bytes parent folder | download
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
100
101
102
103
104
105
106
107
108
menus_dir = prefix / gimpdatadir / 'menus'

ui_menus_files = files(
  'app-menu.ui',
  'brush-editor-menu.ui',
  'brushes-menu.ui',
  'buffers-menu.ui',
  'channels-menu.ui',
  'colormap-menu.ui',
  'cursor-info-menu.ui',
  'dashboard-menu.ui',
  'documents-menu.ui',
  'dynamics-editor-menu.ui',
  'dynamics-menu.ui',
  'error-console-menu.ui',
  'fonts-menu.ui',
  'gradient-editor-menu.ui',
  'gradients-menu.ui',
  'images-menu.ui',
  'layers-menu.ui',
  'mypaint-brushes-menu.ui',
  'palette-editor-menu.ui',
  'palettes-menu.ui',
  'paths-menu.ui',
  'patterns-menu.ui',
  'quick-mask-menu.ui',
  'sample-points-menu.ui',
  'selection-menu.ui',
  'templates-menu.ui',
  'text-editor-toolbar.ui',
  'text-tool-menu.ui',
  'tool-options-menu.ui',
  'tool-preset-editor-menu.ui',
  'tool-presets-menu.ui',
  'undo-menu.ui',
  'vector-toolpath-menu.ui',
)

install_data(ui_menus_files,
  install_dir: menus_dir,
)

unstable_menus_args = stable ? [] : [ '--stringparam', 'unstable-menus', 'yes' ]

menus_ui_built_files = []
foreach menu_filegen : [ 'dockable-menu.ui', 'image-menu.ui', ]
  # This does look a bit overly complicated, but I encountered 2 issues:
  # 1. The simpler solution was to do first the custom_target() then a single
  #    configure_file() per file. It didn't work out because of meson complex
  #    dependency logic (see https://github.com/mesonbuild/meson/issues/8123).
  # 2. So I inverted, but now xsltproc was the one acting up by adding the
  #    'xml:base' attribute when the included and including XML files are in
  #    different folders. This is why I added a second configure_file() to have
  #    both XML files in the same folder.
  conf = configuration_data()
  if menu_filegen == 'dockable-menu.ui'
    group = 'dockable'
  else
    group = 'app'
  endif
  conf.set('GROUP', group)
  included_file = configure_file(
    input: 'dialogs-menuitems.ui.in',
    output: group + '-dialogs-menuitems.ui',
    configuration: conf,
  )

  pre_built_file = configure_file(
    input: menu_filegen + '.in.in',
    output: menu_filegen + '.in',
    configuration: conf,
  )

  menus_ui_built_files += custom_target(menu_filegen,
    input : [ pre_built_file, 'menus.xsl', included_file],
    output: [ menu_filegen ],
    command: [
      xsltproc,
      '--xinclude',
      unstable_menus_args,
      '--path',
      meson.current_build_dir(),
      '--output', '@OUTPUT@',
      '@INPUT1@',
      '@INPUT0@',
    ],
    install: true,
    install_dir: menus_dir,
  )
endforeach

if xmllint.found()
  # XXX: no DTD validation as GtkBuilder UI format does not have a DTD (as far as
  # we could find).
  custom_target('validate_ui_menus',
    command: [
      xmllint,
      '--output', '@OUTPUT@',
      '--path', meson.current_source_dir(),
      ui_menus_files, menus_ui_built_files
    ],
    # The output file is only useful as a flag file, so that the command
    # knows if it has been run already.
    output: [ 'validate_ui_menus-output.xml' ],
    build_by_default: true,
    install: false
  )
endif