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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
|
sources = files(
'egg-color.c',
'egg-color.h',
'egg-precision.h',
'egg-precision.c',
'egg-array-float.c',
'egg-array-float.h',
'egg-idletime.h',
'egg-idletime.c',
'egg-discrete.h',
'egg-discrete.c',
'egg-console-kit.h',
'egg-console-kit.c',
'gpm-common.h',
'gpm-common.c',
'gpm-brightness.h',
'gpm-brightness.c',
'gpm-upower.c',
'gpm-upower.h'
)
cflags = [
'-DMATELOCALEDIR="@0@"'.format(matelocaledir),
'-DG_LOG_DOMAIN="PowerManager"',
'-DGPM_ICONS_DATA="@0@"'.format(mateicons),
'-DINHIBIT_MENU_UI_DIR="@0@"'.format(mateui),
'-DSBINDIR="@0@"'.format(matesbindir),
'-DBINDIR="@0@"'.format(matebindir),
'-DGTKBUILDERDIR="@0@"'.format(pkgdatadir),
'-DEGG_VERBOSE="GPM_VERBOSE"',
'-DEGG_LOGGING="GPM_LOGGING"',
'-DUP_DISABLE_DEPRECATED',
'-DI_KNOW_THE_DEVICEKIT_POWER_API_IS_SUBJECT_TO_CHANGE',
'-DEGG_CONSOLE="GPM_CONSOLE"'
]
marshal_files = gnome.genmarshal('gpm-marshal', prefix : 'gpm_marshal', sources : 'gpm-marshal.list')
dbus_binding_tool = find_program('dbus-binding-tool')
dbus_Backlight = custom_target('org.mate.PowerManager.Backlight',
input: 'org.mate.PowerManager.Backlight.xml',
output: 'org.mate.PowerManager.Backlight.h',
command: [dbus_binding_tool, '--prefix=gpm_backlight', '--mode=glib-server',
'--output=@OUTPUT@', '@INPUT@']
)
dbus_KbdBacklight = custom_target('org.mate.PowerManager.KbdBacklight',
input: 'org.mate.PowerManager.KbdBacklight.xml',
output: 'org.mate.PowerManager.KbdBacklight.h',
command: [dbus_binding_tool, '--prefix=gpm_kbd_backlight', '--mode=glib-server',
'--output=@OUTPUT@', '@INPUT@']
)
dbus_Manager = custom_target('org.mate.PowerManager',
input: 'org.mate.PowerManager.xml',
output: 'org.mate.PowerManager.h',
command: [dbus_binding_tool, '--prefix=gpm_manager', '--mode=glib-server',
'--output=@OUTPUT@', '@INPUT@']
)
deps = [
glib,
gtk,
dbusglib,
cairo,
upower,
keyring,
libsecret,
notify,
]
libmpm_shared = static_library(
'libmpmstatic',
sources: [
sources,
marshal_files
],
include_directories: config_inc,
dependencies: deps,
c_args: cflags,
#link_args: ldflags,
install: false,
)
executable(
'mate-power-backlight-helper',
sources : 'gpm-backlight-helper.c',
include_directories: config_inc,
dependencies : deps,
link_with :libmpm_shared,
c_args : cflags,
install : true,
install_dir : get_option('sbindir')
)
mate_power_statistics_resources = gnome.compile_resources(
'mate-power-statistics-resources',
join_paths(data_dir,'org.mate.power-manager.statistics.gresource.xml'),
source_dir : data_dir,
c_name : 'statistics'
)
executable(
'mate-power-statistics',
mate_power_statistics_resources,
sources : [
'gpm-point-obj.c',
'gpm-statistics.c',
'gpm-graph-widget.c',
],
include_directories : [
include_directories('..'),
],
dependencies : [
libm,
deps
],
link_with :libmpm_shared,
c_args : cflags,
install : true,
install_dir : get_option('bindir')
)
mate_power_preferences_resources = gnome.compile_resources(
'mate-power-preferences-resources',
join_paths(data_dir,'org.mate.power-manager.preferences.gresource.xml'),
source_dir : data_dir,
c_name : 'preferences'
)
executable(
'mate-power-preferences',
mate_power_preferences_resources,
sources : [
'gpm-prefs.c',
'gpm-prefs-core.c',
],
include_directories : [
include_directories('..'),
],
dependencies : [
libm,
x11,
xrandr,
deps
],
link_with :libmpm_shared,
c_args : cflags,
install : true,
install_dir : get_option('bindir')
)
mate_power_manager_resources = gnome.compile_resources(
'mate-power-manager-resources',
join_paths(data_dir,'org.mate.power-manager.manager.gresource.xml'),
source_dir : data_dir,
c_name : 'manager'
)
executable(
'mate-power-manager',
mate_power_manager_resources,
sources : [
'gpm-dpms.c',
'gpm-phone.c',
'gpm-backlight.c',
'gpm-idle.c',
'gpm-load.c',
'gpm-control.c',
'gpm-button.c',
'gpm-kbd-backlight.c',
'gpm-main.c',
'gpm-manager.c',
'gpm-tray-icon.c',
'gpm-screensaver.c',
'gpm-session.c',
'gpm-networkmanager.c',
'gsd-media-keys-window.c',
'msd-osd-window.c',
'gpm-engine.c',
dbus_Backlight,
dbus_KbdBacklight,
dbus_Manager,
],
include_directories : [
include_directories('..'),
],
dependencies : [
libm,
md,
x11,
xext,
xrandr,
canberra,
deps
],
link_with :libmpm_shared,
c_args : cflags,
install : true,
install_dir : get_option('bindir')
)
if get_option('enable-tests')
e = executable(
'mate-power-self-test',
sources : [
'gpm-self-test.c',
'egg-color.c',
'egg-test.c',
'egg-precision.c',
'egg-precision.c',
'egg-idletime.c',
'egg-discrete.c',
'egg-array-float.c',
'egg-console-kit.c',
'gpm-control.c',
'gpm-networkmanager.c',
'gpm-dpms.c',
'gpm-button.c',
'gpm-screensaver.c',
'gpm-engine.c',
'gpm-phone.c',
'gpm-idle.c',
'gpm-session.c',
'gpm-load.c',
'gpm-common.c',
'gpm-upower.c',
marshal_files,
],
include_directories : [
include_directories('..'),
],
dependencies : [
libm,
x11,
xext,
xrandr,
deps
],
link_with :libmpm_shared,
c_args : [
test_args,
'-DEGG_TEST'
]
)
test('mate-power-self-test', e)
endif
|