-
Notifications
You must be signed in to change notification settings - Fork 3
/
meson.build
232 lines (202 loc) · 6.8 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
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
project(
'QtGreet',
'c',
'cpp',
version: '2.0.0',
license: 'MIT',
meson_version: '>=0.60.0',
default_options: [
'cpp_std=c++17',
'c_std=c11',
'warning_level=2',
'werror=false',
],
)
add_global_arguments( '-DPROJECT_VERSION="v@0@"'.format( meson.project_version() ), language : 'cpp' )
add_project_link_arguments( ['-rdynamic','-fPIC'], language:'cpp' )
if get_option( 'nodynpath' ) == false
add_global_arguments( '-DDYNPATH="@0@"'.format( get_option( 'dynpath' ) ), language : 'cpp' )
else
add_global_arguments( '-DDYNPATH=""', language : 'cpp' )
endif
add_global_arguments( '-DLOGPATH="@0@"'.format( get_option( 'logpath' ) ), language : 'cpp' )
# If use_qt_version is 'auto', we will first search for Qt6.
# If all Qt6 packages are available, we'll use it. Otherwise,
# we'll switch to Qt5.
if get_option('use_qt_version') == 'auto'
# Check if Qt6 is available
QtDeps = dependency( 'qt6', modules: [ 'Core', 'Gui', 'Widgets', 'DBus', 'OpenGLWidgets' ], required: false )
wayqt = dependency( 'wayqt-qt6', required: false )
DFApp = dependency( 'df6application', required: false )
DFIpc = dependency( 'df6ipc', required: false )
DFUtl = dependency( 'df6utils', required: false )
DFLgn = dependency( 'df6login1', required: false )
Qt6_is_Found = QtDeps.found() and wayqt.found() and DFApp.found() and DFIpc.found() and DFUtl.found() and DFLgn.found()
if Qt6_is_Found
Qt = import( 'qt6' )
else
QtDeps = dependency( 'qt5', modules: [ 'Core', 'Gui', 'Widgets', 'DBus' ], required: true )
Qt = import( 'qt5' )
wayqt = dependency( 'wayqt', required: true )
DFApp = dependency( 'df5application', required: true )
DFIpc = dependency( 'df5ipc', required: true )
DFUtl = dependency( 'df5utils', required: true )
DFLgn = dependency( 'df5login1', required: true )
endif
# User specifically wants to user Qt5
elif get_option('use_qt_version') == 'qt5'
QtDeps = dependency( 'qt5', modules: [ 'Core', 'Gui', 'Widgets', 'DBus' ], required: true )
Qt = import( 'qt5' )
wayqt = dependency( 'wayqt', required: true )
DFApp = dependency( 'df5application', required: true )
DFIpc = dependency( 'df5ipc', required: true )
DFUtl = dependency( 'df5utils', required: true )
DFLgn = dependency( 'df5login1', required: true )
# User specifically wants to user Qt6
elif get_option('use_qt_version') == 'qt6'
QtDeps = dependency( 'qt6', modules: [ 'Core', 'Gui', 'Widgets', 'DBus', 'OpenGLWidgets' ], required: false )
Qt = import( 'qt6' )
wayqt = dependency( 'wayqt-qt6', required: true )
DFApp = dependency( 'df6application', required: true )
DFIpc = dependency( 'df6ipc', required: true )
DFUtl = dependency( 'df6utils', required: true )
DFLgn = dependency( 'df6login1', required: true )
endif
# MPV for video bg
Mpv = dependency( 'mpv' )
Includes = [
'src',
'src/backends',
'src/backends/greetd',
'src/layoutmanager',
'src/layoutmanager/parser',
'src/thememanager',
'src/ui',
'src/widgets',
'src/widgets/buttons',
'src/widgets/clock',
'src/widgets/container',
'src/widgets/labels',
'src/widgets/power',
'src/widgets/session',
'src/widgets/user',
'src/widgets/videobg',
'src/widgets/factory',
]
Headers = [
'src/Global.hpp',
'src/backends/LoginManager.hpp',
'src/backends/greetd/GreetdManager.hpp',
'src/layoutmanager/parser/hjson.h',
'src/layoutmanager/LayoutManager.hpp',
'src/layoutmanager/LayoutUtils.hpp',
'src/thememanager/ThemeManager.hpp',
'src/ui/QtGreet.hpp',
'src/ui/ScreenManager.hpp',
'src/widgets/factory/WidgetFactory.hpp',
'src/widgets/buttons/buttons.hpp',
'src/widgets/clock/ClockWidget.hpp',
'src/widgets/container/Container.hpp',
'src/widgets/labels/labels.hpp',
'src/widgets/power/power.hpp',
'src/widgets/session/session.hpp',
'src/widgets/user/user.hpp',
'src/widgets/videobg/MpvWidget.hpp',
'src/widgets/videobg/MpvHelper.hpp',
]
Sources = [
'src/backends/LoginManager.cpp',
'src/backends/greetd/GreetdManager.cpp',
'src/layoutmanager/LayoutManager.cpp',
'src/layoutmanager/LayoutUtils.cpp',
'src/layoutmanager/parser/hjson_decode.cpp',
'src/layoutmanager/parser/hjson_encode.cpp',
'src/layoutmanager/parser/hjson_parsenumber.cpp',
'src/layoutmanager/parser/hjson_value.cpp',
'src/thememanager/ThemeManager.cpp',
'src/Main.cpp',
'src/ui/QtGreet.cpp',
'src/ui/ScreenManager.cpp',
'src/widgets/factory/WidgetFactory.cpp',
'src/widgets/buttons/buttons.cpp',
'src/widgets/clock/ClockWidget.cpp',
'src/widgets/container/Container.cpp',
'src/widgets/labels/labels.cpp',
'src/widgets/power/power.cpp',
'src/widgets/session/session.cpp',
'src/widgets/user/user.cpp',
'src/widgets/videobg/MpvWidget.cpp',
]
Mocs = Qt.compile_moc(
headers : Headers,
dependencies: QtDeps
)
Resources = Qt.compile_resources(
name: 'QtGreetRes',
sources: 'src/QtGreet.qrc'
)
qtgreet = executable(
'qtgreet', [ Sources, Mocs, Resources ],
dependencies: [ QtDeps, wayqt, DFApp, DFIpc, DFUtl, DFLgn, Mpv ],
include_directories: [ Includes ],
install: true
)
if ( get_option( 'build_greetwl' ) == true )
# Required for greetwl
wlr = dependency( 'wlroots', version: '>= 0.17.0' )
wayland_server = dependency( 'wayland-server' )
wayland_client = dependency( 'wayland-client' )
xkbcommon = dependency( 'xkbcommon' )
rt = meson.get_compiler( 'cpp' ).find_library( 'rt' )
subdir( 'src/protocols' )
greetwl = executable(
'greetwl', [ 'src/compositor/main.cpp', 'src/compositor/tinywl.c' ],
dependencies: [ QtDeps, wlr, wayland_server, wayland_client, xkbcommon, rt, protos ],
include_directories: [ 'src/compositor' ],
install: true
)
endif
# Backgrounds
install_subdir(
'backgrounds',
install_dir : get_option( 'datadir' ) / 'qtgreet'
)
# Backgrounds
install_subdir(
'themes',
install_dir : get_option( 'datadir' ) / 'qtgreet'
)
# Readme, Changelog, etc
install_data(
[ 'README.md', 'Changelog', 'ReleaseNotes' ],
install_dir : get_option( 'datadir' ) / 'qtgreet'
)
# Configuration files
install_data(
[ 'configs/config.ini', 'configs/wayfire.ini', 'configs/users.conf', 'configs/sway.cfg' ],
install_dir : join_paths( get_option( 'sysconfdir' ), 'qtgreet' )
)
# Icons
install_data(
'src/icons/QtGreet.svg',
install_dir : join_paths(get_option('prefix'), 'share', 'icons', 'hicolor', 'scalable', 'apps'),
)
install_data(
'src/icons/QtGreet.png',
install_dir : join_paths(get_option('prefix'), 'share', 'icons', 'hicolor', '512x512', 'apps'),
)
# Configuration file path: create it only if it's not disabled
if get_option( 'nodynpath' ) == false
install_emptydir(
get_option( 'dynpath' ),
install_mode: [ 'rwxr-xr-x', get_option( 'username' ), get_option( 'username' ) ],
)
endif
summary = [
'',
'--------------',
'QtGreet v@0@'.format( meson.project_version() ),
'--------------',
''
]
message( '\n'.join( summary ) )