forked from GSConnect/gnome-shell-extension-gsconnect
-
Notifications
You must be signed in to change notification settings - Fork 0
/
meson.build
126 lines (102 loc) · 3.18 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
project('gsconnect',
'c',
version: '50',
meson_version: '>= 0.46.0'
)
gnome = import('gnome')
i18n = import('i18n')
app_id = 'org.gnome.Shell.Extensions.GSConnect'
app_path = '/org/gnome/Shell/Extensions/GSConnect'
extuuid = 'gsconnect@andyholmes.github.io'
prefix = get_option('prefix')
datadir = join_paths(prefix, get_option('datadir'))
extdatadir = join_paths(datadir, 'gnome-shell', 'extensions', extuuid)
libdir = join_paths(prefix, get_option('libdir'))
libexecdir = join_paths(prefix, get_option('libexecdir'))
localedir = join_paths(prefix, get_option('localedir'))
sysconfdir = get_option('sysconfdir')
# GSettings schema dir
if get_option('gsettings_schemadir') != ''
gschemadir = get_option('gsettings_schemadir')
else
gschemadir = join_paths(datadir, 'glib-2.0', 'schemas')
endif
# GNOME Shell LIBDIR
if get_option('gnome_shell_libdir') != ''
gnome_shell_libdir = get_option('gnome_shell_libdir')
else
gnome_shell_libdir = libdir
endif
# Configuration
extconfig = configuration_data()
extconfig.set('PACKAGE_VERSION', meson.project_version())
extconfig.set('PACKAGE_URL', 'https://github.com/GSConnect/gnome-shell-extension-gsconnect')
extconfig.set('PACKAGE_BUGREPORT', 'https://github.com/GSConnect/gnome-shell-extension-gsconnect/issues/new')
extconfig.set('PACKAGE_DATADIR', extdatadir)
extconfig.set('PACKAGE_LOCALEDIR', localedir)
extconfig.set('GSETTINGS_SCHEMA_DIR', gschemadir)
extconfig.set('APPLICATION_ID', app_id)
extconfig.set('APPLICATION_PATH', app_path)
extconfig.set('GNOME_SHELL_LIBDIR', gnome_shell_libdir)
extconfig.set('FFMPEG_PATH', get_option('ffmpeg_path'))
extconfig.set('OPENSSL_PATH', get_option('openssl_path'))
extconfig.set('SSHADD_PATH', get_option('sshadd_path'))
extconfig.set('SSHKEYGEN_PATH', get_option('sshkeygen_path'))
# ZIP targets for user extension builds
env_util = find_program('env')
run_target(
'make-zip',
command: [
env_util,
'UUID=' + extuuid,
'DATADIR=' + datadir,
'LOCALEDIR=' + localedir,
'GSCHEMADIR=' + gschemadir,
join_paths(meson.source_root(), 'build-aux', 'ego', 'mkzip.sh')
]
)
run_target(
'install-zip',
command: [
env_util,
'UUID=' + extuuid,
'DATADIR=' + datadir,
'LOCALEDIR=' + localedir,
'GSCHEMADIR=' + gschemadir,
'INSTALL=true',
join_paths(meson.source_root(), 'build-aux', 'ego', 'mkzip.sh')
]
)
# Post-Install script for distributions without the hooks
if get_option('post_install')
meson.add_install_script(
env_util.path(),
'GSCHEMADIR=' + gschemadir,
join_paths(meson.source_root(), 'build-aux', 'meson', 'post-install.sh')
)
endif
# Extension Source
install_subdir(
'src',
install_dir: extdatadir,
strip_directory: true
)
eslint = find_program('eslint', required: false)
if eslint.found()
test('ESLint (Source)', eslint,
args: join_paths(meson.source_root(), 'src'),
suite: 'lint',
)
test('ESLint (Installed Tests)', eslint,
args: join_paths(meson.source_root(), 'installed-tests'),
suite: 'lint',
)
test('ESLint (WebExtension)', eslint,
args: join_paths(meson.source_root(), 'webextension'),
suite: 'lint',
)
endif
subdir('data')
subdir('installed-tests')
subdir('nautilus-extension')
subdir('po')