-
Notifications
You must be signed in to change notification settings - Fork 37
/
meson.build
116 lines (94 loc) · 2.93 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
project(
'com.github.parnold_x.nasc',
'vala', 'c', 'cpp',
version: '0.8.0',
default_options: ['cpp_std=c++11']
)
gettext_name = 'nasc'
# check vala compiler version
if meson.get_compiler('vala').version().version_compare('<0.28.0')
error('vala compiler version 0.28.0 or newer is required.')
endif
pkg_data_dir = join_paths(
get_option('prefix'),
get_option('datadir'),
'nasc'
)
style_dir = join_paths(
get_option('prefix'),
get_option('datadir'),
'nasc',
'styles'
)
# Translation module
i18n = import ('i18n')
add_project_arguments(
'-DGETTEXT_PACKAGE="@0@"'.format(gettext_name),
language: ['c', 'cpp']
)
conf_data = configuration_data()
conf_data.set('DATADIR', join_paths(get_option('prefix'), get_option('datadir')))
conf_data.set('STYLEDIR', style_dir)
conf_data.set('PKGDATADIR', pkg_data_dir)
conf_data.set('GETTEXT_PACKAGE', gettext_name)
conf_data.set('RELEASE_NAME', meson.project_name())
conf_data.set('VERSION', meson.project_version())
conf_data.set('VERSION_INFO', 'Release')
config_header = configure_file(
input: 'src/config.vala.in',
output: 'config.vala',
configuration: conf_data
)
# build libqalculate static library
libqalculate = subproject('libqalculate')
libqalculate_dep_static = libqalculate.get_variable('libqalculate_lib_static')
# build com.github.parnold_x.nasc binary
executable(
meson.project_name(),
'src/Calculator.vala',
'src/Controller.vala',
'src/HelpBox.vala',
'src/InputView.vala',
'src/ListFooter.vala',
'src/MainWindow.vala',
'src/Nasc.vala',
'src/NascSettings.vala',
'src/OpenBox.vala',
'src/MathBinDialog.vala',
'src/PeriodicTable.vala',
'src/ResultBoxWidget.vala',
'src/ResultLine.vala',
'src/ResultView.vala',
'src/Tutorial.vala',
config_header,
libqalculate.get_variable('definition_resource'),
include_directories: [
include_directories('subprojects/libqalculate/libqalculate')
],
dependencies: [
dependency('gee-0.8'),
dependency('glib-2.0'),
dependency('granite', version: '>=5.4.0'),
dependency('gtk+-3.0'),
dependency('gtksourceview-3.0', version: '>=3.10'),
dependency('webkit2gtk-4.0'),
#dependency('cln'),
meson.get_compiler('vala').find_library('posix'),
meson.get_compiler('vala').find_library('QalculateNasc', dirs: [join_paths(meson.current_source_dir(), 'vapi')])
],
link_with: libqalculate_dep_static,
install: true
)
# set up post-install script
python3 = find_program('python3')
schemadir = join_paths(get_option('prefix'), get_option('datadir'), 'glib-2.0', 'schemas')
iconsdir = join_paths(get_option('prefix'), get_option('datadir'), 'icons')
meson.add_install_script(
python3.path(),
join_paths(meson.current_source_dir(), 'meson', 'post_install.py'),
'--schemadir', schemadir,
'--iconsdir', iconsdir,
)
subdir('data')
subdir('icons')
subdir('po')