-
Notifications
You must be signed in to change notification settings - Fork 43
/
meson.build
134 lines (116 loc) · 4.76 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
project('font-manager', ['c', 'vala'], license: 'GPL3', version: '0.8.9')
if meson.version().version_compare('< 0.53')
error('Meson version is @0@ but project requires >= 0.53'.format(meson.version()))
endif
cc = meson.get_compiler('c')
# There has to be a better way to require a specific vala version, right?
valac = meson.get_compiler('vala')
if not valac.version().version_compare('>= 0.42')
error('Vala compiler version is @0@ but project requires >= 0.42'.format(valac.version()))
endif
if valac.version().version_compare('>= 0.56.17')
add_global_arguments('-D', 'VALA_0_56_17', language: 'vala')
endif
m_dep = cc.find_library('m', required: false)
fontconfig = dependency('fontconfig', version: '>= 2.12')
freetype = dependency('freetype2', version: '>= 2.5')
json = dependency('json-glib-1.0', version: '>= 0.15')
gio = dependency('gio-2.0', version: '>= 2.44')
gio_unix = dependency('gio-unix-2.0', version: '>= 2.44')
glib = dependency('glib-2.0', version: '>= 2.62')
gmodule = dependency('gmodule-2.0', version: '>= 2.44')
gobject = dependency('gobject-2.0', version: '>= 2.44')
gtk = dependency('gtk+-3.0', version: '>= 3.22')
harfbuzz = dependency('harfbuzz', version: '>= 2.0')
pango = dependency('pango', version: '>= 1.4')
pangoft2 = dependency('pangoft2', version: '>= 1.4')
sqlite = dependency('sqlite3', version: '>= 3.8')
xml = dependency('libxml-2.0', version: '>= 2.9')
if get_option('webkit')
soup = dependency('libsoup-3.0', version: '>= 3.0')
webkit = dependency('webkit2gtk-4.1', version: '>= 2.42')
add_global_arguments('-D', 'HAVE_WEBKIT', language: 'vala')
endif
base_deps = declare_dependency(
dependencies: [m_dep, json, gio, gio_unix, glib, gmodule, gobject, gtk, pango, sqlite, xml],
include_directories: include_directories('.', 'lib/common', 'lib/orthographies', 'lib/unicode')
)
# This dependency cannot be used for vala targets
project_deps = declare_dependency(
dependencies: [ base_deps, fontconfig, freetype, harfbuzz, pangoft2 ]
)
i18n = import('i18n')
gnome= import('gnome')
python = import('python').find_installation('python3')
reproducible = get_option('reproducible') ? '-DREPRODUCIBLE' : '-DNOT_REPRODUCIBLE'
use_deprecated_gtk_api = get_option('webkit') or get_option('thunar') ? '-DGTK_ENABLE_DEPRECATED' : '-DGTK_DISABLE_DEPRECATED'
add_global_arguments(
'-DG_LOG_DOMAIN="[@0@]"'.format(meson.project_name()),
'-DGETTEXT_PACKAGE="@0@"'.format(meson.project_name()),
reproducible,
'-DGDK_DISABLE_DEPRECATED',
use_deprecated_gtk_api,
language: 'c'
)
config_vapi_file = files('config.vapi')
prefix = get_option('prefix')
datadir = get_option('datadir')
pkglib_dir = join_paths(prefix, get_option('libdir'), meson.project_name())
pkglibexec_dir = join_paths(prefix, get_option('libexecdir'), meson.project_name())
config = configuration_data()
config.set('PACKAGE_NAME', meson.project_name())
config.set('PACKAGE_VERSION', meson.project_version())
config.set('PACKAGE_URL', 'http://fontmanager.github.io/')
config.set('PACKAGE_BUGREPORT', 'https://github.com/FontManager/master/issues')
config.set('GETTEXT_PACKAGE', meson.project_name())
config.set('PKGLIBEXECDIR', pkglibexec_dir)
config.set('prefix', prefix)
config.set('abs_top_srcdir', meson.current_build_dir())
configure_file(input: 'config.h.meson', output: 'config.h', configuration: config)
file_list_template = '''
from glob import glob
for f in sorted(glob('**/*.@0@', recursive=True)):
print(f)
'''
list_sources = file_list_template.format('c')
list_headers = file_list_template.format('h')
list_vala_sources = file_list_template.format('vala')
if get_option('enable-nls')
subdir('po')
endif
subdir('help')
subdir('lib')
subdir('src')
subdir('data')
subdir('extensions')
meson.add_install_script('meson_post_install.py')
meson.add_dist_script('meson_dist.py')
summary(
{
'Font Manager': get_option('manager'),
'Font Viewer': get_option('viewer'),
'Help Documents': get_option('yelp-doc'),
'GNOME search provider': get_option('search-provider'),
'Google Fonts Integration ': get_option('webkit'),
'Nautilus extension': get_option('nautilus'),
'Nemo extension': get_option('nemo'),
'Thunar extension': get_option('thunar'),
'Translations': get_option('enable-nls'),
'API Documentation': get_option('gtk-doc'),
'Reproducible build': get_option('reproducible')
},
section: '''Project options
''',
bool_yn: true
)
summary(
{
'prefix': prefix,
'bindir': join_paths(prefix, get_option('bindir')),
'libdir': join_paths(prefix, get_option('libdir'), meson.project_name()),
'libexecdir': join_paths(prefix, get_option('libexecdir'), meson.project_name()),
'datadir': join_paths(prefix, datadir)
},
section: '''Directories
'''
)