forked from GSConnect/gnome-shell-extension-gsconnect
-
Notifications
You must be signed in to change notification settings - Fork 0
/
meson.build
156 lines (128 loc) · 3.86 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# SPDX-FileCopyrightText: GSConnect Developers https://github.com/GSConnect
#
# SPDX-License-Identifier: GPL-2.0-or-later
project('gsconnect',
'c',
version: '56',
meson_version: '>= 0.59.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')
gschemadir = join_paths(datadir, 'glib-2.0', 'schemas')
# 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-pkgdir',
command: [
env_util,
'UUID=' + extuuid,
'DATADIR=' + datadir,
'LOCALEDIR=' + localedir,
'GSCHEMADIR=' + gschemadir,
'NOZIP=true',
join_paths(meson.project_source_root(), 'build-aux', 'ego', 'mkzip.sh')
]
)
run_target(
'make-zip',
command: [
env_util,
'UUID=' + extuuid,
'DATADIR=' + datadir,
'LOCALEDIR=' + localedir,
'GSCHEMADIR=' + gschemadir,
join_paths(meson.project_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.project_source_root(), 'build-aux', 'ego', 'mkzip.sh')
]
)
# Post-Install script for distributions without the hooks
gnome.post_install(
glib_compile_schemas: true,
gtk_update_icon_cache: true,
update_desktop_database: true,
)
# 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.project_source_root(), 'src'),
suite: 'lint',
)
test('ESLint (Installed Tests)', eslint,
args: join_paths(meson.project_source_root(), 'installed-tests'),
suite: 'lint',
)
test('ESLint (WebExtension)', eslint,
args: join_paths(meson.project_source_root(), 'webextension'),
suite: 'lint',
)
endif
black = find_program('black', required: false)
if black.found()
test('Python Black (Nautilus Extension)', black,
args: [
'--check',
'--diff',
join_paths(meson.project_source_root(), 'nautilus-extension')
],
suite: 'lint',
)
endif
flake8 = find_program('flake8', required: false)
if flake8.found()
test('Python Flake8 (Nautilus Extension)', flake8,
args: join_paths(meson.project_source_root(), 'nautilus-extension'),
suite: 'lint',
)
endif
subdir('data')
subdir('installed-tests')
subdir('nautilus-extension')
subdir('po')