-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathmeson.build
167 lines (129 loc) · 4.51 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
156
157
158
159
160
161
162
163
164
165
166
167
# project name and programming language
project('com.github.aggalex.contacts', 'vala', 'c', version: '0.1.0')
message ('project name and programming language')
# Adds project arguments
message ('Adds project arguments')
add_project_arguments([
'-DGETTEXT_PACKAGE=\"@0@\"'.format(meson.project_name())
],
language: 'c',
)
# Include the translations module
message('Include the translations module')
i18n = import('i18n')
# Set our translation domain
message ('Set our translation domain')
add_global_arguments('-DGETTEXT_PACKAGE="@0@"'.format (meson.project_name()), language:'c')
# Adding deps
message ('Listing dependencies')
dependencies = [
dependency('gio-unix-2.0', version: '>=2.20'),
dependency('granite'),
dependency('json-glib-1.0'),
dependency('folks'),
]
# Adds subfolders specific build system
message ('Adds subfolders specific build system')
icon_sizes = ['16','24','32','48', '64', '128', '256']
foreach i : icon_sizes
install_data(
join_paths('data/icons', i, meson.project_name() + '.svg'),
install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor', i + 'x' + i, 'apps')
)
install_data(
join_paths('data/icons', i, meson.project_name() + '.svg'),
install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor', i + 'x' + i + '@2', 'apps')
)
endforeach
avatar_sizes = ['32', '64']
foreach i : avatar_sizes
install_data(
join_paths('data/icons', i, 'contacts-avatar-default.svg'),
install_dir: join_paths(get_option('datadir'), 'contacts', 'avatars', i)
)
endforeach
install_data(
'data/css/style.css',
install_dir: join_paths(get_option('datadir'), 'contacts', 'css')
)
config_data = configuration_data()
config_data.set('EXEC_NAME', meson.project_name())
# Src build
message ('Src build')
conf_data = configuration_data()
conf_data.set_quoted('PROJECT_NAME', meson.project_name())
conf_data.set_quoted('GETTEXT_PACKAGE', meson.project_name())
conf_data.set_quoted('VERSION', meson.project_version())
conf_data.set_quoted('PREFIX', get_option('prefix'))
message ('Configuring desktop entry: ' + meson.project_name() + '.desktop')
desktop_in_file = configure_file(
input: join_paths('data', meson.project_name() + '.desktop.in.in'),
output: '@BASENAME@',
configuration: config_data
)
config_file = configure_file(
input: 'config.vala.in',
output: '@BASENAME@',
configuration: conf_data
)
desktop_file = i18n.merge_file(
input: desktop_in_file,
output: meson.project_name() + '.desktop',
po_dir: join_paths(meson.source_root(), 'po'),
type: 'desktop',
install: true,
install_dir: join_paths(get_option('datadir'), 'applications')
)
appstream_file = i18n.merge_file(
input: join_paths (meson.source_root(), 'data', meson.project_name() + '.appdata.xml.in'),
output: '@BASENAME@',
po_dir: join_paths(meson.source_root(), 'po'),
install: true,
install_dir: join_paths(get_option('datadir'), 'metainfo')
)
message ('Adds files to build')
subdir('po')
code_files = files(
'src/DataHelper/DataTypes.vala',
'src/DataHelper/Address.vala',
'src/FileHelper/FileHelper.vala',
'src/FolksHelper/FolksLoader.vala',
'src/JsonHelper/JsonParser.vala',
'src/JsonHelper/JsonBuilder.vala',
'src/QuotedPrintableHelper/QuotedPrintableParser.vala',
'src/VCardHelper/VCardBuilder.vala',
'src/VCardHelper/VCardParser.vala',
'src/Model/ContactList.vala',
'src/Model/Contact.vala',
'src/ViewModel/ContactListHandler.vala',
'src/ViewModel/ContactHandler.vala',
'src/View/ContactList.vala',
'src/View/Headerbar.vala',
'src/View/Contact.vala',
'src/View/Css.vala',
'src/View/Widgets/InfoSectionMisc.vala',
'src/View/Widgets/LightStack.vala',
'src/View/Widgets/EditableWidget.vala',
'src/View/Widgets/Popover.vala',
'src/View/Widgets/EditableLabelDate.vala',
'src/View/Widgets/SidebarRow.vala',
'src/View/Widgets/EditableTitle.vala',
'src/View/Widgets/ErrorBar.vala',
'src/View/Widgets/EditableLabel.vala',
'src/View/Widgets/SimpleMenu.vala',
'src/View/Widgets/EditableLabelNoType.vala',
'src/View/Widgets/InfoSectionSegmented.vala',
'src/View/Widgets/InfoSection.vala',
'src/View/Widgets/Sidebar.vala',
'src/View/Widgets/EditableLabelSegmented.vala',
'src/View/Widgets/IconPopup.vala',
'src/Application.vala'
)
message ('Defines executable')
executable(
meson.project_name(),
config_file,
code_files,
dependencies: dependencies,
install: true
)