forked from linuxmint/cinnamon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
meson.build
151 lines (128 loc) · 4.3 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
project('Cinnamon', 'c', version : '4.8.4', meson_version : '>=0.46.0')
gnome = import('gnome')
i18n = import('i18n')
version = meson.project_version()
# directories
prefix = get_option('prefix')
bindir = get_option('bindir')
datadir = get_option('datadir')
libdir = get_option('libdir')
includedir = get_option('includedir')
libexecdir = get_option('libexecdir')
desktopdir = join_paths(datadir, 'applications')
schemadir = join_paths(datadir, 'glib-2.0', 'schemas')
pkglibdir = join_paths(libdir, meson.project_name().to_lower())
servicedir = join_paths(datadir, 'dbus-1', 'services')
pkgdatadir = join_paths(datadir, meson.project_name().to_lower())
po_dir = join_paths(meson.source_root(), 'po')
# dependencies
cjs = dependency('cjs-1.0', version: '>= 4.8.0')
clutter = dependency('muffin-clutter-0')
cmenu = dependency('libcinnamon-menu-3.0', version: '>= 4.8.0')
cogl = dependency('muffin-cogl-0')
cogl_path = dependency('muffin-cogl-path-0')
dbus = dependency('dbus-1')
gdkx11 = dependency('gdk-x11-3.0')
gi = dependency('gobject-introspection-1.0', version: '>= 0.9.2')
polkit = dependency('polkit-agent-1', version: '>= 0.100')
xfixes = dependency('xfixes')
atk = dependency('atk-bridge-2.0')
gio = dependency('gio-2.0', version: '>= 2.36.0')
gio_unix = dependency('gio-unix-2.0')
gl = dependency('gl')
glib_version = '2.52.0'
glib = dependency('glib-2.0', version: '>= ' + glib_version)
gstreamer = dependency('gstreamer-1.0')
gstreamer_base = dependency('gstreamer-base-1.0')
gtk = dependency('gtk+-3.0', version: '>= 3.12.0')
muffin = dependency('libmuffin', version: '>= 4.0.3')
muffinlibdir = muffin.get_pkgconfig_variable('typelibdir')
pango = dependency('muffin-cogl-pango-0')
sn = dependency('libstartup-notification-1.0')
soup = dependency('libsoup-2.4')
X11 = dependency('x11')
xml = dependency('libxml-2.0')
has_nm = not get_option('disable_networkmanager')
if has_nm
# only ever used in *.js via gi import
dependency('libnm')
endif
# on some systems we need to find the math lib to make sure it builds
cc = meson.get_compiler('c')
math = cc.find_library('m', required: false)
intltool_merge = find_program('intltool-merge')
python = find_program('python3')
# generate config.h
cinnamon_conf = configuration_data()
cinnamon_conf.set_quoted('VERSION', version)
cinnamon_conf.set_quoted('GETTEXT_PACKAGE', meson.project_name().to_lower())
config_h_file = configure_file(
output : 'config.h',
configuration : cinnamon_conf
)
config_h = declare_dependency(
sources: config_h_file
)
# includes
include_root = include_directories('.')
# compiler flags
c_args = [
'-DDATADIR="@0@"'.format(join_paths(prefix, datadir)),
'-DLIBDIR="@0@"'.format(join_paths(prefix, libdir)),
'-DBINDIR="@0@"'.format(join_paths(prefix, bindir)),
'-DCINNAMON_DATADIR="@0@"'.format(join_paths(prefix, pkgdatadir)),
'-DJSDIR="@0@/js"'.format(join_paths(prefix, pkgdatadir)),
'-DMUFFIN_TYPELIB_DIR="@0@"'.format(muffinlibdir),
]
if not get_option('deprecated_warnings')
c_args += [
'-Wno-deprecated-declarations',
'-Wno-deprecated',
'-Wno-declaration-after-statement',
]
endif
add_global_arguments(c_args, language: 'c')
subdir('data')
subdir('src')
# tests are not currently functional
# subdir('tests')
subdir('docs/reference')
install_subdir(
'js',
exclude_files: ['misc/config.js.in'],
install_dir: join_paths(datadir, meson.project_name().to_lower()),
)
config_js_conf = configuration_data()
config_js_conf.set('PACKAGE_NAME', meson.project_name().to_lower())
config_js_conf.set('PACKAGE_VERSION', version)
configure_file(
input: 'js/misc/config.js.in',
output: 'config.js',
configuration: config_js_conf,
install_dir: 'share/cinnamon/js/misc/'
)
install_subdir(
'files',
install_dir: '/',
strip_directory: true,
)
session_conf = configuration_data()
if has_nm
session_conf.set('REQUIRED', 'nm-applet;')
else
session_conf.set('REQUIRED', '')
endif
foreach file : ['cinnamon.session', 'cinnamon2d.session']
configure_file(
input: file + '.in',
output: file,
configuration: session_conf,
install_dir: join_paths(prefix, datadir, 'cinnamon-session', 'sessions'),
)
endforeach
install_subdir(
'man',
install_dir: join_paths(prefix, get_option('mandir'), 'man1'),
strip_directory: true,
)
subdir('install-scripts')