This repository has been archived by the owner on Jun 19, 2020. It is now read-only.
forked from elizeumarino/extend-panel-menu
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmeson.build
98 lines (85 loc) · 2.3 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
project('extend-panel-menu', version: '11', meson_version: '>= 0.50.0')
gnome = import('gnome')
i18n = import('i18n')
prefix = get_option('prefix')
data_dir = join_paths(prefix, get_option('datadir'))
app_id = 'org.gnome.shell.extensions.extend-panel-menu'
ext_uuid = 'extend-panel-menu@julio641742'
ext_data_dir = join_paths(data_dir, 'gnome-shell', 'extensions', ext_uuid)
locale_dir = join_paths(ext_data_dir,'locale')
# gsettings schema dir
if get_option('gsettings_schemadir') != ''
gschema_dir = get_option('gsettings_schemadir')
else
gschema_dir = join_paths(data_dir, 'glib-2.0', 'schemas')
endif
# configuration
ext_config = configuration_data()
ext_config.set('VERSION', meson.project_version())
ext_config.set('APP_ID', app_id)
ext_config.set('UUID', ext_uuid)
ext_config.set('LOCALE_DIR', locale_dir)
ext_config.set('EXT_DATA_DIR', ext_data_dir)
ext_config.set('GSCHEMA_DIR', gschema_dir)
# ZIP targets for user extension builds
run_target(
'make-zip',
command: [
find_program('env'),
'UUID=' + ext_uuid,
'DATADIR=' + data_dir,
'LOCALEDIR=' + locale_dir,
'GSCHEMADIR=' + gschema_dir,
join_paths('meson', 'package.sh')
]
)
run_target(
'install-zip',
command: [
find_program('env'),
'UUID=' + ext_uuid,
'DATADIR=' + data_dir,
'LOCALEDIR=' + locale_dir,
'GSCHEMADIR=' + gschema_dir,
'INSTALL=true',
join_paths('meson', 'package.sh')
]
)
# extension source
install_subdir(
'src',
install_dir: ext_data_dir,
strip_directory: true
)
# metadata.json
configure_file(
input: join_paths('data', 'metadata.json.in'),
output: 'metadata.json',
configuration: ext_config,
install_dir: ext_data_dir
)
# gsettings
install_data(
join_paths('data', app_id) + '.gschema.xml',
install_dir: gschema_dir
)
# gresources
gnome.compile_resources(
app_id,
join_paths('data', app_id) + '.gresource.xml',
source_dir: 'data',
gresource_bundle: true,
install: true,
install_dir: ext_data_dir
)
# resources
# gettext translations
subdir('po')
# post-install script for distributions without the hooks
if get_option('post_install')
meson.add_install_script(
find_program('env').path(),
'GSCHEMADIR=' + gschema_dir,
join_paths(meson.source_root(), 'meson', 'post-install.sh')
)
endif