Commit 3ab01aeb authored by Florian Müllner's avatar Florian Müllner

build: Support the meson build system

Meson is on track to replace autotools as the build system of choice,
so support it in addition to autotools.

Fixes #31
parent c6ecf2c0
sessions = [
['gnome-classic.session.desktop', sessiondir],
['gnome-classic.desktop', xsessiondir]
]
foreach s : sessions
i18n.merge_file('',
input: s[0] + '.in',
output: s[0],
po_dir: '../po',
install: true,
install_dir: s[1],
type: 'desktop'
)
endforeach
mode_conf = configuration_data()
mode_conf.set('CLASSIC_EXTENSIONS', ','.join(classic_extensions))
mode_file = 'classic.json'
configure_file(
input: mode_file + '.in',
output: mode_file,
configuration: mode_conf,
install_dir: modedir
)
theme_sources = files(
'gnome-shell-sass/_colors.scss',
'gnome-shell-sass/_common.scss',
'gnome-shell-sass/_drawing.scss',
'gnome-shell-sass/_high-contrast-colors.scss'
)
theme_data = [
'calendar-today.svg',
'classic-process-working.svg',
'classic-toggle-off-intl.svg',
'classic-toggle-off-us.svg',
'classic-toggle-on-intl.svg',
'classic-toggle-on-us.svg',
'gnome-classic.css',
'gnome-classic-high-contrast.css'
]
update_theme = files('update-theme.sh')
if sassc.found()
style = 'gnome-classic'
custom_target(style + '.css',
input: style + '.scss',
output: style + '.css',
depend_files: theme_sources + files(style + '.css'),
command: [update_theme, '@INPUT@', '@OUTPUT@'],
build_by_default: true
)
endif
install_data(theme_data, install_dir: themedir)
#!/bin/sh
INPUT=$1
OUTPUT=$2
if [ `which sassc` ]
then
sassc -a $INPUT | tee ${INPUT%%.scss}.css > $OUTPUT
fi
extension_data += configure_file(
input: metadata_name + '.in',
output: metadata_name,
configuration: metadata_conf
)
extension_sources += files('prefs.js')
extension_data += configure_file(
input: metadata_name + '.in',
output: metadata_name,
configuration: metadata_conf
)
extension_data += configure_file(
input: metadata_name + '.in',
output: metadata_name,
configuration: metadata_conf
)
extension_sources += files('prefs.js')
extension_schemas += files(metadata_conf.get('gschemaname') + '.gschema.xml')
extension_data += configure_file(
input: metadata_name + '.in',
output: metadata_name,
configuration: metadata_conf
)
extension_data += configure_file(
input: metadata_name + '.in',
output: metadata_name,
configuration: metadata_conf
)
extension_sources += files('prefs.js')
extension_schemas += files(metadata_conf.get('gschemaname') + '.gschema.xml')
extension_data += configure_file(
input: metadata_name + '.in',
output: metadata_name,
configuration: metadata_conf
)
extension_schemas = []
metadata_name = 'metadata.json'
foreach e : enabled_extensions
uuid = e + '@gnome-shell-extensions.gcampax.github.com'
metadata_conf = configuration_data()
metadata_conf.set('extension_id', e)
metadata_conf.set('uuid', uuid)
metadata_conf.set('gschemaname', 'org.gnome.shell.extensions.' + e)
metadata_conf.set('gettext_domain', gettext_domain)
metadata_conf.set('shell_current', shell_version)
metadata_conf.set('url', 'https://gitlab.gnome.org/GNOME/gnome-shell-extensions')
extension_sources = files(e + '/extension.js')
extension_data = files(e + '/stylesheet.css')
subdir(e)
install_data (extension_sources + extension_data + extensionlib,
install_dir: join_paths(extensiondir, uuid)
)
endforeach
install_data (extension_schemas,
install_dir: schemadir
)
extension_data += configure_file(
input: metadata_name + '.in',
output: metadata_name,
configuration: metadata_conf
)
extension_schemas += files(metadata_conf.get('gschemaname') + '.gschema.xml')
extension_data += configure_file(
input: metadata_name + '.in',
output: metadata_name,
configuration: metadata_conf
)
extension_sources += files('placeDisplay.js')
extension_data += configure_file(
input: metadata_name + '.in',
output: metadata_name,
configuration: metadata_conf
)
extension_schemas += files(metadata_conf.get('gschemaname') + '.gschema.xml')
extension_data += configure_file(
input: metadata_name + '.in',
output: metadata_name,
configuration: metadata_conf
)
extension_schemas += files(metadata_conf.get('gschemaname') + '.gschema.xml')
extension_data += configure_file(
input: metadata_name + '.in',
output: metadata_name,
configuration: metadata_conf
)
extension_sources += files('prefs.js')
extension_schemas += files(metadata_conf.get('gschemaname') + '.gschema.xml')
if classic_mode_enabled
extension_data += files('classic.css')
endif
extension_data += configure_file(
input: metadata_name + '.in',
output: metadata_name,
configuration: metadata_conf
)
extension_data += configure_file(
input: metadata_name + '.in',
output: metadata_name,
configuration: metadata_conf
)
extension_sources += files('prefs.js')
project('gnome-shell-extensions',
version: '3.27.1',
meson_version: '>= 0.37.0',
license: 'GPL2+'
)
gettext_domain = meson.project_name()
gnome = import('gnome')
i18n = import('i18n')
datadir = get_option('datadir')
shelldir = join_paths(datadir, 'gnome-shell')
extensiondir = join_paths(shelldir, 'extensions')
modedir = join_paths(shelldir, 'modes')
themedir = join_paths(shelldir, 'theme')
schemadir = join_paths(datadir, 'glib-2.0', 'schemas')
sessiondir = join_paths(datadir, 'gnome-session', 'sessions')
xsessiondir = join_paths(datadir, 'xsession')
extensionlib = files('lib/convenience.js')
sassc = find_program('sassc', required: false)
ver_arr = meson.project_version().split('.')
if ver_arr[1].to_int().is_even()
shell_version = '@0@.@1@'.format(ver_arr[0], ver_arr[1])
else
shell_version = '.'.join(ver_arr)
endif
classic_extensions = [
'alternate-tab',
'apps-menu',
'places-menu',
'launch-new-instance',
'window-list'
]
default_extensions = classic_extensions
default_extensions += [
'drive-menu',
'screenshot-window-sizer',
'windowsNavigator',
'workspace-indicator'
]
all_extensions = default_extensions
all_extensions += [
'auto-move-windows',
'example',
'native-window-placement',
'user-theme'
]
enabled_extensions = get_option('enable_extensions').split()
if enabled_extensions.length() == 0
set = get_option('extension_set')
if set == 'classic'
enabled_extensions += classic_extensions
elif set == 'default'
enabled_extensions += default_extensions
elif set == 'all'
enabled_extensions += all_extensions
endif
endif
classic_mode_enabled = get_option('classic_mode')
if classic_mode_enabled
# Sanity check: Make sure all classic extensions are enabled
foreach e : classic_extensions
if not enabled_extensions.contains(e)
error('Classic mode is enabled, ' +
'but the required extension @0@ is not.'.format(e))
endif
endforeach
endif
# Sanity check: Make sure enabled extensions are valid
foreach e : enabled_extensions
if not all_extensions.contains(e)
error('Invalid extension @0@.'.format(e))
endif
endforeach
if classic_mode_enabled
subdir('data')
endif
subdir('extensions')
subdir('po')
option('extension_set',
type: 'combo',
choices: ['classic', 'default', 'all'],
value: 'default',
description: 'Predefined sets of extensions'
)
option('enable_extensions',
type: 'string',
value: '',
description: 'Space separated list of extensions to enable instead of a predefined set.'
)
option('classic_mode',
type: 'boolean',
value: false,
description: 'Enable installing data files for classic mode.'
)
i18n.gettext(gettext_domain, preset: 'glib')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment