meson.build
ASCII text
1
project(
2
'materia-theme',
3
version: '20210322',
4
license: 'GPLv2+',
5
meson_version: '>= 0.47.0',
6
default_options: ['prefix=/usr'],
7
)
8
9
theme_base_name = get_option('theme_name')
10
theme_base_dir = join_paths(get_option('datadir'), 'themes', theme_base_name)
11
12
# Avoid printing 'Program sh found' multiple times
13
# if meson version is >= 0.55.0
14
if meson.version().version_compare('>= 0.55.0')
15
sh = find_program('sh')
16
else
17
sh = 'sh'
18
endif
19
20
sass = find_program('sass', required: false)
21
sass_opts = ['--no-source-map']
22
23
if sass.found()
24
sass_full_version = run_command(sass, '--version').stdout()
25
sass_is_ruby_sass = sass_full_version.contains('Ruby Sass')
26
sass_has_module_system = sass_full_version.version_compare('>= 1.23.0')
27
endif
28
29
if not sass.found() or sass_is_ruby_sass or not sass_has_module_system
30
message('dart-sass >= 1.23.0 not found, installing it locally via npm')
31
npm = find_program('npm')
32
run_command(npm, 'install')
33
sass = find_program('./node_modules/.bin/sass')
34
endif
35
36
themes = []
37
foreach color: get_option('colors')
38
foreach size: get_option('sizes')
39
color_suffix = color == 'default' ? '' : '-@0@'.format(color)
40
size_suffix = size == 'default' ? '' : '-@0@'.format(size)
41
42
scss_dark_theme = color == 'dark' ? 'true' : 'false'
43
scss_light_topbar = color == 'light' ? 'true' : 'false'
44
scss_compact = size == 'compact' ? 'true' : 'false'
45
46
themes += {
47
'name': theme_base_name + color_suffix + size_suffix,
48
'dir': theme_base_dir + color_suffix + size_suffix,
49
'color': color_suffix,
50
'size': size_suffix,
51
'scss_dark_theme': scss_dark_theme,
52
'scss_light_topbar': scss_light_topbar,
53
'scss_compact': scss_compact,
54
}
55
endforeach
56
endforeach
57
58
foreach theme: themes
59
install_data(
60
[
61
'COPYING',
62
'INSTALL_GDM_THEME.md',
63
],
64
install_dir: theme['dir'],
65
)
66
endforeach
67
68
if not get_option('flatpak')
69
subdir('src')
70
else
71
subdir('src/gtk-3.0')
72
subdir('src/gtk-4.0')
73
endif
74