-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathmeson.build
More file actions
132 lines (102 loc) · 3 KB
/
meson.build
File metadata and controls
132 lines (102 loc) · 3 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
# Name our project
project(
'io.github.elly_code.jorts',
'vala', 'c',
version: '4.0.2'
)
app_name = 'Jorts'
correct_app_id = 'io.github.elly_code.jorts'
legacy_app_id = 'io.github.ellie_commons.jorts'
if get_option('legacy-rdnn')
app_id = legacy_app_id
alternate_app_id = correct_app_id
else
app_id = correct_app_id
alternate_app_id = legacy_app_id
endif
app_version = meson.project_version()
vala_flags = []
if get_option('development')
app_id += '.devel'
name_prefix = '(devel) '
vcs_tag = run_command('git', 'rev-parse', '--short', 'HEAD').stdout().strip()
version_suffix = '-@0@'.format (vcs_tag)
vala_flags += ['--define', 'DEVEL']
else
name_prefix = ''
version_suffix = ''
endif
gnome = import('gnome')
i18n = import('i18n')
add_global_arguments('-DGETTEXT_PACKAGE="@0@"'.format (app_id), language:'c')
windows_build = build_machine.system() == 'windows'
#================================
# Cool icon variants
variant = get_option('variant')[0]
if variant == 'pride'
vala_flags = ['--define', 'PRIDE']
elif variant == 'halloween'
vala_flags = ['--define', 'HALLOWEEN']
elif variant == 'classic'
vala_flags = ['--define', 'CLASSIC']
else
vala_flags = ['--define', 'DEFAULT']
endif
# Windows needs icons, special arguments, and skip libportal
if windows_build
vala_flags += ['--define', 'WINDOWS']
endif
# Hot fixes for flathub builds
flathub = get_option('flathub')
if flathub
vala_flags += ['--define', 'FLATHUB']
endif
#================================
# Import the stylesheet
## Set de config data
config_data = configuration_data()
config_data.set_quoted('LOCALEDIR', get_option('prefix') / get_option('localedir'))
config_data.set_quoted('GETTEXT_PACKAGE', app_id)
config_data.set_quoted('APP_NAME', app_name)
config_data.set_quoted('APP_ID', app_id)
config_data.set_quoted('APP_VERSION', app_version)
config_file = configure_file(
input: 'src/Config.vala.in',
output: '@BASENAME@',
configuration: config_data
)
# Le stylesheet
gresource = gnome.compile_resources(
'gresource',
'data' / 'jorts.gresource.xml',
source_dir: 'data'
)
#================================
# dependencies
add_project_arguments(vala_flags, language: 'vala')
dependencies = [
dependency('granite-7'),
dependency('gobject-2.0'),
dependency('json-glib-1.0'),
dependency('gee-0.8'),
dependency('gtk4')
]
# We need to compile an icon into the exe to avoid "missing icon" icon at every turn
# Libportal is not available in MSYS2, built the file only on linuxes
if windows_build
dependencies += dependency('gio-windows-2.0')
ico_src = import('windows').compile_resources('windows/icons/ico.rc')
else
dependencies += dependency('gio-unix-2.0')
dependencies += dependency('libportal')
endif
#================================
# Add subfolders for Meson to look
subdir('data')
subdir('po')
subdir('src')
gnome.post_install(
glib_compile_schemas: true,
gtk_update_icon_cache: true,
update_desktop_database: true
)