File: meson.build

package info (click to toggle)
cinnamon 6.4.13-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 13,304 kB
  • sloc: javascript: 54,298; ansic: 51,499; python: 21,971; xml: 2,803; sh: 96; makefile: 27; perl: 13
file content (194 lines) | stat: -rw-r--r-- 5,702 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
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
project('Cinnamon', 'c', version : '6.4.13', meson_version : '>=0.56.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 = join_paths(prefix, get_option('libdir'))
includedir = get_option('includedir')
libexecdir = get_option('libexecdir')
desktopdir = join_paths(datadir, 'applications')
x_sessiondir = join_paths(datadir, 'xsessions')
wayland_sessiondir = join_paths(datadir, 'wayland-sessions')
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.project_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')
gcr = dependency('gcr-base-3', version:'>=3.7.5')
gdkx11 = dependency('gdk-x11-3.0')
gi = dependency('gobject-introspection-1.0', version: '>= 0.9.2')
polkit = dependency('polkit-agent-1', version: '>= 0.100')
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)
gtk = dependency('gtk+-3.0', version: '>= 3.12.0')
muffin = dependency('libmuffin-0', version: '>= 5.2.0')
muffin_typelibdir = muffin.get_variable(pkgconfig: 'typelibdir')
pango = dependency('muffin-cogl-pango-0')
xapp = dependency('xapp', version: '>= 2.6.0')
X11 = dependency('x11')
xml = dependency('libxml-2.0')

nm_deps = []
have_networkmanager = not get_option('disable_networkmanager')
if have_networkmanager
    nm_deps += dependency('libnm', version: '>= 1.10.4')
    nm_deps += dependency('libsecret-1', version: '>= 0.18')
endif

if get_option('build_recorder')
	gstreamer = dependency('gstreamer-1.0')
	gstreamer_base = dependency('gstreamer-base-1.0')
else
	gstreamer = dependency('', required: false)
	gstreamer_base = dependency('', required: false)
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())
cinnamon_conf.set('HAVE_NETWORKMANAGER', have_networkmanager)

have_mallinfo = cc.has_function('mallinfo', prefix: '#include <malloc.h>')
if have_mallinfo
    cinnamon_conf.set10('HAVE_MALLINFO', true)
endif

langinfo_test = '''
#include <langinfo.h>
int main () {
    nl_langinfo(_NL_TIME_FIRST_WEEKDAY);
}
'''
have_nl_time_first_weekday = cc.compiles(
    langinfo_test,
    name : 'langinfo _NL_TIME_FIRST_WEEKDAY check')

if have_nl_time_first_weekday
    cinnamon_conf.set10('HAVE__NL_TIME_FIRST_WEEKDAY', true)
endif

config_h_file = configure_file(
    output : 'config.h',
    configuration : cinnamon_conf
)

config_h = declare_dependency(
    sources: config_h_file
)

# includes
include_root = include_directories('.')

if polkit.version()[0] == '0'  # older versions '0.105' ...
    pkv = 1
else
    pkv = polkit.version().to_int()
endif

# 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(muffin_typelibdir),
    '-DPOLKIT_VERSION=@0@'.format(pkv),
]

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)
config_js_conf.set10('HAVE_NETWORKMANAGER', have_networkmanager)

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 have_networkmanager
    session_conf.set('REQUIRED', '')
else
    session_conf.set('REQUIRED', '')
endif

session_files = ['cinnamon.session', 'cinnamon2d.session']
if get_option('wayland')
    session_files += ['cinnamon-wayland.session']
endif

foreach session_file : session_files
    configure_file(
        input: session_file + '.in',
        output: session_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('calendar-server')
subdir('python3')
subdir('install-scripts')