-
Notifications
You must be signed in to change notification settings - Fork 8
/
meson.build
130 lines (112 loc) · 4.08 KB
/
meson.build
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
119
120
121
122
123
124
125
126
127
128
129
130
project('gnome-recipes', 'c',
version: '2.0.2',
meson_version : '>=0.36.0')
i18n = import('i18n')
gnome = import('gnome')
conf = configuration_data()
# Needed to find config.h
top_inc = include_directories('.')
libgd = subproject('libgd',
default_options: [
'with-tagged-entry=true',
'static=true'
])
libgd_dep = libgd.get_variable('libgd_dep')
# Extract LIBGD_INFO
libgd_path = join_paths([meson.source_root(), 'subprojects', 'libgd'])
conf.set_quoted('LIBGD_INFO', 'unknown')
git_command = find_program('git', required: false)
if not git_command.found()
message('Failed to extract git commit hash for libgd: git not found\n')
else
git_run = run_command('git', ['-C', libgd_path, 'log', '-1', '--pretty=%h'])
if git_run.returncode() == 0
conf.set_quoted('LIBGD_INFO', git_run.stdout().strip())
else
message('Failed to extract git commit hash for libgd:\n' + git_run.stderr())
endif
endif
conf.set_quoted('COMMIT_ID', 'unknown')
if not git_command.found()
message('Failed to extract git commit hash for libgd: git not found\n')
else
git_run = run_command('git', ['-C', meson.source_root(), 'describe'])
if git_run.returncode() == 0
conf.set_quoted('COMMIT_ID', git_run.stdout().strip())
else
message('Failed to extract git commit ID for recipes:\n' + git_run.stderr())
endif
endif
# Options + dependency checking is overly verbose and repetitive right now, but
# there is work ongoing to fix it: https://github.com/mesonbuild/meson/pull/1330
autoar_dep = []
if get_option('autoar') != 'no'
autoar_dep = dependency('gnome-autoar-0', required : false)
if autoar_dep.found()
conf.set('ENABLE_AUTOAR', true)
conf.set_quoted('AUTOAR_VERSION', autoar_dep.version())
elif get_option('autoar') == 'yes'
error('Support for gnome-autoar was requested but not found')
endif
endif
gspell_dep = []
if get_option('gspell') != 'no'
gspell_dep = dependency('gspell-1', required : false)
if gspell_dep.found()
conf.set('ENABLE_GSPELL', true)
conf.set_quoted('GSPELL_VERSION', gspell_dep.version())
elif get_option('gspell') == 'yes'
error('Support for gspell was requested but not found')
endif
endif
canberra_dep = []
if get_option('canberra') != 'no'
canberra_dep = dependency('libcanberra', required : false)
if canberra_dep.found()
conf.set('ENABLE_CANBERRA', true)
conf.set_quoted('CANBERRA_VERSION', canberra_dep.version())
elif get_option('canberra') == 'yes'
error('Support for canberra was requested but not found')
endif
endif
deps = [ dependency('gtk+-3.0', version : '>=3.22'),
dependency('gmodule-export-2.0'),
dependency('libsoup-2.4'),
dependency('goa-1.0'),
dependency('rest-0.7'),
dependency('json-glib-1.0'),
autoar_dep,
gspell_dep,
canberra_dep,
libgd_dep ]
datadir = join_paths([ get_option('prefix'),
get_option('datadir') ])
pkgdatadir = join_paths([ get_option('prefix'),
get_option('datadir'),
'gnome-recipes' ])
bindir = join_paths([ get_option('prefix'), 'bin' ])
schemadir = join_paths([ datadir, 'glib-2.0', 'schemas' ])
conf.set('G_LOG_USE_STRUCTURED', true)
conf.set_quoted('G_LOG_DOMAIN', 'org.gnome.Recipes')
conf.set_quoted('PACKAGE_NAME', 'gnome-recipes')
conf.set_quoted('PACKAGE_VERSION', meson.project_version())
conf.set_quoted('GETTEXT_PACKAGE', 'gnome-recipes')
conf.set_quoted('DATADIR', datadir)
conf.set_quoted('PKGDATADIR', pkgdatadir)
conf.set_quoted('LOCALEDIR', join_paths([ get_option('prefix'),
get_option('datadir'),
'locale' ]))
# Used while generating cuisine.css
conf.set_quoted('pkgdatadir', pkgdatadir)
conf.set_quoted('bindir', bindir)
# Must be unquoted for dbus service file
conf.set('BINDIR', bindir)
configure_file(output : 'config.h', configuration : conf)
subdir('src')
subdir('tools')
subdir('data')
subdir('po')
subdir('po-data')
subdir('tests')
subdir('help')
meson.add_install_script('meson_post_install.py')