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