This repository has been archived by the owner on Mar 11, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
/
meson.build
94 lines (81 loc) · 2.45 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
project(
'gnome-shell-extension-mconnect',
'c',
version: '17',
meson_version: '>= 0.40.1',
)
# User Definable Variables
Name = 'MConnect'
Description = 'KDE Connect/MConnect integration for Gnome Shell'
ExtensionId = meson.project_name().split('gnome-shell-extension-')[1]
UUID = ExtensionId + '@' + 'andyholmes.github.io'
URL = 'https://github.com/andyholmes/gnome-shell-extension-mconnect'
Shell = [ '3.18', '3.20', '3.22', '3.24', '3.26' ]
# A list of files to be copied to the extension directory without modification.
Files = files(
# standard files
'src/extension.js',
'src/prefs.js',
'data/stylesheet.css',
# non-standard files
'src/lib.js',
'src/kdeconnect.js',
'src/mconnect.js',
'src/share.js',
'src/sms.js',
# non-GJS files
'src/nautilus-send-mconnect.py',
'src/folks.py'
)
# You shouldn't need to edit anything below.
#------------------------------------------------------------------------------
gnome = import('gnome')
extdatadir = join_paths(get_option('datadir'), 'gnome-shell/extensions', UUID)
# ZIP targets
run_target('make-zip', command: ['meson/zip.sh', UUID])
run_target('install-zip', command: ['meson/zip.sh', UUID, 'install'])
# Extension Source
install_data(
Files,
install_dir: extdatadir,
install_mode: 'rw-r--r--'
)
# metadata.json
ext_metadata = configuration_data()
ext_metadata.set('NAME', Name)
ext_metadata.set('DESCRIPTION', Description)
ext_metadata.set('EXTENSION_ID', ExtensionId)
ext_metadata.set('UUID', UUID)
ext_metadata.set('VERSION', meson.project_version())
ext_metadata.set('URL', URL)
ext_metadata.set('SHELL_VERSION', '[ "' + '", "'.join(Shell) + '" ]')
ext_metadata.set('GSCHEMA_ID', 'org.gnome.shell.extensions.' + ExtensionId)
ext_metadata.set('GETTEXT_DOMAIN', meson.project_name())
metadata_json = configure_file(
input: 'data/metadata.json.in',
output: 'metadata.json',
configuration: ext_metadata
)
install_data(
metadata_json,
install_dir: extdatadir,
install_mode: 'rw-r--r--'
)
# GSettings
install_data(
join_paths('data', ext_metadata.get('GSCHEMA_ID') + '.gschema.xml'),
install_dir: join_paths(extdatadir, 'schemas')
)
# GResource
gnome.compile_resources(
ext_metadata.get('GSCHEMA_ID'),
join_paths('data', ext_metadata.get('GSCHEMA_ID') + '.gresource.xml'),
source_dir: 'data',
gresource_bundle: true,
install: true,
install_dir : extdatadir
)
# Gettext Translations
if run_command('[', '-e', 'po/meson.build', ']').returncode() == 0
subdir('po')
endif