-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmeson.build
More file actions
135 lines (107 loc) · 2.48 KB
/
Copy pathmeson.build
File metadata and controls
135 lines (107 loc) · 2.48 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 tuner-labs
# SPDX-License-Identifier: GPL-3.0-or-later
##
## tuner-pak - Cross-platform radio player (Flatpak-ready)
##
project(
'io.github.tuner_labs.tuner',
'vala', 'c', 'rust',
version: '2.1.0',
meson_version: '>= 1.3.2',
)
message('Starting build for: ' + meson.project_name())
##
## Configuration
##
i18n = import('i18n')
gnome = import('gnome')
fs = import('fs')
rust = import('unstable-rust')
##
## Build Rust core library
##
message('Building Rust core library...')
tuner_core = rust.bindgen(
input: 'vapi/tuner-core.h',
output: 'tuner_core_rs.rs'
)
# Build tuner-core as a C-compatible library
tuner_core_lib = rust.build(
'tuner-core',
build_dir: meson.current_build_dir() / 'tuner-core-build'
)
##
## Translations
##
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: false)
endif
subdir('po')
##
## Configuration data
##
config_data = configuration_data()
config_data.set_quoted('GETTEXT_PACKAGE', meson.project_name())
config_data.set_quoted('VERSION', meson.project_version())
debug_local = get_option('debug') and get_option('prefix') != '/app'
if debug_local
message('DEBUG_LOCAL build')
config_data.set_quoted('LOCALEDIR', join_paths(meson.global_build_root(), 'po'))
else
config_data.set_quoted('LOCALEDIR', join_paths(get_option('prefix'), get_option('localedir')))
endif
config_file = configure_file(
input: 'src/Config.vala.in',
output: 'Config.vala',
configuration: config_data
)
add_project_arguments(
'-DGETTEXT_PACKAGE="@0@"'.format(meson.project_name()),
language: 'c'
)
##
## Compile resources
##
resources = gnome.compile_resources(
'as-resources',
'data' / meson.project_name() + '.gresource.xml',
source_dir: 'data',
c_name: 'as'
)
##
## Dependencies
##
deps = [
dependency('glib-2.0'),
dependency('gtk+-3.0'),
dependency('gio-2.0'),
dependency('gee-0.8'),
dependency('gstreamer-1.0'),
dependency('gstreamer-player-1.0'),
dependency('libsoup-3.0'),
dependency('json-glib-1.0'),
]
##
## Source files
##
subdir('src')
##
## Executable
##
executable(
meson.project_name(),
sources,
resources,
config_file,
dependencies: deps,
link_with: tuner_core_lib,
vala_args: ['--pkg', 'posix'],
install: true
)
##
## Data files (desktop, icons, etc.)
##
subdir('data')
message('Build complete: ' + meson.project_name())