-
Notifications
You must be signed in to change notification settings - Fork 13
/
meson.build
115 lines (99 loc) · 3.42 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
project('vala-panel', 'vala', 'c',
version : '24.03',
meson_version: '>=0.62.0',
license: ['LGPL-3.0'],
default_options: [
'c_std=gnu11',
'buildtype=debugoptimized',
'warning_level=1'
])
library_name = 'valapanel'
##################
# Module imports #
##################
gnome = import('gnome')
i18n = import('i18n')
pkgconfig = import('pkgconfig')
###############
# Directories #
###############
prefix = get_option('prefix')
datadir = get_option('datadir')
includedir = get_option('includedir')
libdir = get_option('libdir')
localedir = get_option('localedir')
project_datadir = join_paths(prefix,datadir, meson.project_name())
applets_datadir = join_paths(prefix,datadir, meson.project_name(),'applets')
applets_libdir = join_paths(prefix,libdir, meson.project_name(),'applets')
profiles_dir = join_paths(prefix,get_option('sysconfdir'),'xdg',meson.project_name())
am_cflags = [
'-fstack-protector',
'-DGETTEXT_PACKAGE="@0@"'.format(meson.project_name()),
]
add_project_arguments(am_cflags, language: 'c')
################
# Dependencies #
################
glib_ver = '>=2.52'
glib = dependency('glib-2.0', version: glib_ver)
gio = dependency('gio-2.0', version: glib_ver)
giounix = dependency('gio-unix-2.0', version: glib_ver)
gmodule = dependency('gmodule-2.0', version: glib_ver)
gtk_ver = '>=3.22'
gtk = dependency('gtk+-3.0', version: gtk_ver)
platforms_opt = get_option('platforms')
auto_platforms = (get_option('platforms') == ['auto'])
gdk_x11 = dependency('gdk-x11-3.0', version: gtk_ver, required: platforms_opt.contains('x11'))
gdk_wayland = dependency('gdk-wayland-3.0', version: gtk_ver, required: platforms_opt.contains('wayland'))
gtk_layer_shell = dependency('gtk-layer-shell-0', required: platforms_opt.contains('wayland'))
platforms = {
'x11': platforms_opt.contains('x11') or (auto_platforms and gdk_x11.found()),
'wayland': platforms_opt.contains('wayland') or (auto_platforms and gdk_wayland.found() and gtk_layer_shell.found()),
}
assert(platforms['x11'] or platforms['wayland'], 'No platform available')
cc = meson.get_compiler('c')
m = cc.find_library('m', required : false)
core_inc = include_directories('.')
################
# Applet build #
################
plugin_conf_kwargs = {
'type': 'desktop',
'po_dir': join_paths(meson.current_source_dir(),'po'),
'args' : ['--keyword=Name','--keyword=Description','--keyword=Help'],
'install': true,
'install_dir': applets_datadir
}
#################
# Configuration #
#################
conf_data = configuration_data()
conf_data.set('GETTEXT_PACKAGE', meson.project_name())
conf_data.set('LOCALE_DIR', join_paths(prefix,localedir))
conf_data.set('PLUGINS_DIRECTORY', applets_libdir)
conf_data.set('PLUGINS_DATA', applets_datadir)
conf_data.set('DATADIR', project_datadir)
conf_data.set('PROFILES_DIR', profiles_dir)
conf_data.set('PLATFORM_X11',platforms['x11'])
conf_data.set('PLATFORM_WAYLAND',platforms['wayland'])
config = configure_file(input : join_paths('util','config.h.in'),
output : 'config.h',
configuration : conf_data)
version = vcs_tag(
command : ['git','describe','--tags'],
input: 'util/version.h.in',
output: 'version.h',
replace_string: '@VERSION@',
)
readmes = [
'README.md',
'LICENSE'
]
install_data(readmes, install_dir : join_paths(datadir, meson.project_name(), 'doc'))
subdir('po')
subdir('data')
subdir('util')
subdir('runner')
subdir('ui')
subdir('app')
subdir('applets')