-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathmeson.build
More file actions
135 lines (102 loc) · 2.82 KB
/
Copy pathmeson.build
File metadata and controls
135 lines (102 loc) · 2.82 KB
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
# Copyright © 2026 <https://github.com/technosf>
# SPDX-FileCopyrightText: © 2026 <https://github.com/technosf>
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
##
## Tuner main meson build file
##
## Project name, programming language and version
project (
'io.github.tuner_labs.tuner',
'vala', 'c',
version: '2.1.0-beta.3',
meson_version: '>= 1.3.2',
)
message('Starting build for project: ' + meson.project_name())
##
## Local debug build - let vala compiler know
##
message('opts: ' + get_option('debug').to_string() + ' prefix: ' + get_option('prefix')+ ' prefix check: ' + (get_option('prefix') != '/app').to_string() )
vala_args = []
debug_local = get_option('debug') and get_option('prefix') != '/app'
if debug_local
message('DEBUG_LOCAL')
vala_args += ['--define=DEBUG_LOCAL']
endif
##
##
message('Build type: ' + get_option('buildtype'))
## Imports
i18n = import ('i18n') # Translation module
gnome = import('gnome') # GNOME module
fs = import('fs') # Filesystem
##
## Translations and i18n handling
##
po_script = join_paths(meson.global_source_root(),'scripts','merge-po.sh')
if fs.exists(po_script)
message('Running PO merge hook...')
run_command(po_script, check: true)
endif
subdir ('po')
## Project arguments
add_project_arguments (
'-DGETTEXT_PACKAGE="@0@"'.format (meson.project_name ()),
language: 'c'
)
config_data = configuration_data()
#
# Enable local debug of translations if we're doing a local debug build
#
if debug_local
## Local debug build, install translations to build dir
config_data.set_quoted('LOCALEDIR', join_paths(meson.global_build_root(), 'po'))
else
## Everything else, install translations to prefix
config_data.set_quoted('LOCALEDIR', join_paths(get_option('prefix'), get_option('localedir')))
endif
config_data.set_quoted('GETTEXT_PACKAGE', meson.project_name())
config_data.set_quoted('VERSION', meson.project_version())
config_file = configure_file(
input: 'src/Config.vala.in',
output: '@BASENAME@',
configuration: config_data
)
##
## Compiling resources
##
asresources = gnome.compile_resources (
'as-resources',
join_paths ('data', meson.project_name ()) + '.gresource.xml',
source_dir: 'data',
c_name: 'as'
)
##
## Listing dependencies
##
dependencies = [
dependency ('glib-2.0'),
dependency ('gtk+-3.0'),
dependency ('gee-0.8'),
dependency ('gio-2.0'),
dependency ('gstreamer-1.0'),
dependency ('gstreamer-player-1.0'),
dependency ('libsoup-3.0'),
dependency ('json-glib-1.0')
]
subdir ('src')
##
## Executable
##
executable (
meson.project_name (),
asresources,
config_file,
sources,
dependencies: dependencies,
vala_args: vala_args + ['--pkg', 'posix'],
install: true
)
subdir ('data')
message('Build for project: ' + meson.project_name() + ' finished.\n')