-
Notifications
You must be signed in to change notification settings - Fork 0
/
meson.build
181 lines (160 loc) · 5.21 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
project(
'bonsai', 'c',
version : '0.1.0-dev',
license : 'GPL-3.0',
meson_version : '>=0.61.0',
default_options : [
'c_std=c17',
'warning_level=2',
'werror=false',
'buildtype=debug',
]
)
add_project_arguments(
'-DWLR_USE_UNSTABLE',
'-Wno-unused-parameter',
'-Wno-unused-result',
'-Wno-missing-braces',
'-Wundef',
'-Wvla',
language : 'c',
)
cc = meson.get_compiler('c')
### Defaults
prefix = get_option('prefix')
datadir = get_option('datadir')
sysconfdir = get_option('sysconfdir')
add_project_arguments(
'-DBSI_PREFIX="@0@"'.format(prefix),
'-DBSI_DATADIR="@0@"'.format(datadir),
'-DBSI_SYSCONFDIR="@0@"'.format(sysconfdir),
'-DBSI_USERCONFDIR=".config"',
language : 'c',
)
if get_option('bsi_software_cursor')
add_project_arguments('-DBSI_SOFTWARE_CURSOR', language : 'c')
endif
if get_option('bsi_verbose')
add_project_arguments('-DBSI_DEBUG', language : 'c')
endif
### Dependencies
dep_wlroots = dependency('wlroots', required : true)
dep_libinput = dependency('libinput', required : true)
dep_libevdev = dependency('libevdev', required : false)
dep_libudev = dependency('libudev', required : true)
dep_xkbcommon = dependency('xkbcommon', required : true)
dep_glesv2 = dependency('glesv2', required : true)
dep_drm = dependency('libdrm', required : false)
dep_wayland_server = dependency('wayland-server', required : true)
dep_wayland_client = dependency('wayland-client', required : true)
dep_wayland_cursor = dependency('wayland-cursor', required : true)
dep_wayland_egl = dependency('wayland-egl', required : true)
dep_wayland_protocols = dependency('wayland-protocols', required : true)
dep_xdpw = dependency('xdg-desktop-portal', required : true)
dep_pixman = dependency('pixman-1', required : true)
dep_cairo = dependency('cairo', required : true)
dep_math = cc.find_library('m', required : true)
### Optional extern
ext_swaybg = find_program('swaybg', required : false)
if not ext_swaybg.found()
warning('swaybg is needed for wallpaper support')
endif
ext_swaylock = find_program('swaylock', required : false)
if not ext_swaylock.found()
warning('swaylock is needed for session locking support')
endif
ext_bemenu = find_program('bemenu', required : false)
if not ext_bemenu.found()
warning('bemenu is needed for run menu support')
endif
ext_waybar = find_program('waybar', required : false)
if not ext_waybar.found()
warning('waybar is needed for status bar support')
endif
ext_slurp = find_program('slurp', required : false)
ext_grim = find_program('grim', required : false)
ext_wlclipboard = find_program('wl-copy', required : false)
if not ext_slurp.found() or not ext_grim.found() or not ext_wlclipboard.found()
warning('slurp, grim & wl_clipboard are needed for screenshot support')
endif
ext_brghtctl = find_program('brightnessctl', required : false)
if not ext_brghtctl.found()
warning('brightnessctl is needed for backlight control')
endif
### Include dirs
inc_default = include_directories('include')
inc_protocols = include_directories('include/protocols')
### Subdirs
subdir('bonsai')
### Installation
# Session
install_data(
'bonsai.desktop',
install_dir : join_paths(datadir, 'wayland-sessions')
)
# Default configs
config = configuration_data()
config.set('default_output', 'WL-1')
config.set('default_mode', '1280x720')
config.set('default_refresh', '60')
config.set('default_pointer', 'wayland-pointer-seat0')
config.set('default_accel_speed', '0.0')
config.set('default_accel_profile', 'flat')
config.set('default_scroll_natural', 'yes')
config.set('default_tap', 'yes')
config.set('default_keyboard', 'wayland-keyboard-seat0')
config.set('default_keyboard_layout', 'us')
config.set('default_keyboard_layout_toggle', 'grp:win_space_toggle')
config.set('default_keyboard_model', 'pc105')
config.set('default_repeat_rate', '20')
config.set('default_repeat_delay', '600')
config.set('default_workspace', '3')
config.set('default_wallpaper',
join_paths(prefix, datadir, 'backgrounds', 'bonsai', 'Wallpaper-Default.jpg'))
configure_file(
configuration : config,
input : 'extern/bonsai/config.in',
output : '@BASENAME@',
install_dir : join_paths(sysconfdir, 'bonsai'),
)
# Wallpapers
install_data(
'assets/Wallpaper-1.jpg',
'assets/Wallpaper-2.jpg',
'assets/Wallpaper-3.jpg',
'assets/Wallpaper-4.jpg',
'assets/Wallpaper-Default.jpg',
'assets/LICENSE',
install_dir : join_paths(datadir, 'backgrounds', 'bonsai'),
)
# Fonts
install_data(
'extern/fonts/Nerd-Font-Symbols-Complete.ttf',
'extern/fonts/LICENSE',
install_dir : join_paths(datadir, 'fonts', 'bonsai'),
)
# Extern configs
install_data(
'extern/swaylock/config',
install_dir : join_paths(sysconfdir, 'swaylock'),
)
install_data(
'extern/waybar/config',
'extern/waybar/style.css',
install_dir : join_paths(sysconfdir, 'waybar'),
)
install_data(
'extern/xdg-desktop-portal-wlr/config',
install_dir : join_paths(sysconfdir, 'xdg', 'xdg-desktop-portal-wlr'),
)
# User configs
if get_option('bsi_user_configs')
run_command(
'extern/install.sh',
capture : true,
check : true,
env : {
'SRCDIR': '@0@'.format(meson.global_source_root())
}
)
endif