File: meson.build

package info (click to toggle)
malcontent 0.13.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,756 kB
  • sloc: ansic: 7,418; python: 418; xml: 377; sh: 36; makefile: 14
file content (118 lines) | stat: -rw-r--r-- 2,982 bytes parent folder | download | duplicates (2)
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
109
110
111
112
113
114
115
116
117
118
application_id = 'org.freedesktop.MalcontentControl'

if not cc.has_function('atexit')
  error('atexit() needed for generated GResource files')
endif

resources = gnome.compile_resources(
  'resources',
  'malcontent-control.gresource.xml',
  source_dir: meson.current_source_dir(),
)

malcontent_control = executable('malcontent-control',
  [
    'application.c',
    'application.h',
    'carousel.c',
    'carousel.h',
    'main.c',
    'user-image.c',
    'user-image.h',
    'user-selector.c',
    'user-selector.h',
  ] + resources,
  dependencies: [
    dependency('accountsservice'),
    dependency('gio-2.0', version: '>= 2.44'),
    dependency('glib-2.0', version: '>= 2.54.2'),
    dependency('gobject-2.0', version: '>= 2.54'),
    gtk_dep,
    dependency('polkit-gobject-1'),
    libadwaita_dep,
    libmalcontent_dep,
    libmalcontent_ui_dep,
  ],
  include_directories: root_inc,
  install: true,
)

desktop_file = i18n.merge_file(
  type: 'desktop',
  input: '@0@.desktop.in'.format(application_id),
  output: '@0@.desktop'.format(application_id),
  po_dir: join_paths(meson.current_source_dir(), '..', 'po'),
  install: true,
  install_dir: join_paths(get_option('datadir'), 'applications'),
)

desktop_file_validate = find_program('desktop-file-validate', required: false)
if desktop_file_validate.found()
  test(
    'validate-desktop',
    desktop_file_validate,
    args: [
      desktop_file.full_path(),
    ],
    suite: ['malcontent-control'],
  )
endif

metainfo_file = i18n.merge_file(
  input: '@0@.metainfo.xml.in'.format(application_id),
  output: '@0@.metainfo.xml'.format(application_id),
  po_dir: join_paths(meson.current_source_dir(), '..', 'po'),
  install: true,
  install_dir: join_paths(get_option('datadir'), 'metainfo'),
)

appstreamcli = find_program('appstreamcli', required: false)
if appstreamcli.found()
  test(
    'validate-metainfo', appstreamcli,
    args: [
      'validate', '--no-net', metainfo_file.full_path(),
    ],
    suite: ['malcontent-control'],
  )
endif

xmllint = find_program('xmllint', required: false)
if xmllint.found()
  gtk_prefix = gtk_dep.get_variable(pkgconfig: 'prefix')
  test(
    'validate-ui', xmllint,
    args: [
      '--nonet', '--noblanks', '--noout',
      '--relaxng', join_paths(gtk_prefix, 'share', 'gtk-4.0', 'gtk4builder.rng'),
      files(
        'carousel.ui',
        'main.ui',
        'user-selector.ui',
      ),
    ],
    suite: ['malcontent-control'],
  )
endif

policy_file = i18n.merge_file(
  input: '@0@.policy.in'.format(application_id),
  output: '@0@.policy'.format(application_id),
  po_dir: join_paths(meson.current_source_dir(), '..', 'po'),
  install: true,
  install_dir: join_paths(get_option('datadir'), 'polkit-1', 'actions'),
)
if xmllint.found()
  test(
    'validate-policy', xmllint,
    args: [
      '--nonet', '--noblanks', '--noout',
      policy_file,
    ],
    suite: ['malcontent-control'],
  )
endif

# FIXME: Add tests
subdir('icons')
#subdir('tests')