This repository has been archived by the owner on May 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
/
meson.build
120 lines (102 loc) · 2.82 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
# SPDX-FileCopyrightText: 2021 Gleb Smirnov <glebsmirnov0708@gmail.com>
#
# SPDX-License-Identifier: GPL-3.0-or-later
project('textpieces', 'vala',
version: '3.4.1',
meson_version: '>= 0.59.0',
default_options: [ 'warning_level=2',
],
)
# Get package data directory (usually /usr/share/textpieces)
pkgdata_dir = get_option('prefix') / get_option('datadir') / meson.project_name()
textpieces_sources = []
cc = meson.get_compiler('c')
valac = meson.get_compiler('vala')
vapi_dir = join_paths (meson.project_source_root(), 'src', 'vapi')
add_project_arguments(
[
'--target-glib=2.50',
'--enable-experimental',
'--vapidir', vapi_dir,
],
language: 'vala'
)
# Dependencies {
libadwaita_dep = dependency('libadwaita-1', version: '>= 1.0.0-alpha.2', required: false)
if not libadwaita_dep.found()
libadwaita = subproject(
'libadwaita',
default_options: [
'examples=false',
'package_subdir=@0@'.format(meson.project_name()),
'tests=false'
]
)
libadwaita_dep = declare_dependency(
dependencies: [
libadwaita.get_variable('libadwaita_dep'),
libadwaita.get_variable('libadwaita_vapi')
]
)
endif
gtksourceview_dep = dependency('gtksourceview-5', version: '>= 5.3.0', required: false)
if not gtksourceview_dep.found()
gtksourceview = subproject(
'gtksourceview',
default_options: [
'package_subdir=@0@'.format(meson.project_name()),
'tests=false'
]
)
gtksourceview_dep = declare_dependency(
dependencies: [
gtksourceview.get_variable('gtksource_dep'),
gtksourceview.get_variable('gtksource_vapi')
]
)
endif
json_glib_dep = dependency('json-glib-1.0', version: '>= 1.6.0', required: false)
if not json_glib_dep.found()
json_glib = subproject(
'json-glib',
default_options: [
'package_subdir=@0@'.format(meson.project_name()),
'tests=false',
'gtk_doc=disabled',
'introspection=enabled'
]
)
json_glib_dep = declare_dependency(
dependencies: [
json_glib.get_variable('json_glib_dep'),
json_glib.get_variable('json_glib_gir')
]
)
endif
libm_dep = cc.find_library('m')
textpieces_deps = [
dependency('gio-2.0', version: '>= 2.50'),
dependency('gio-unix-2.0', version: '>= 2.50'),
dependency('gtk4', version: '>= 4.2'),
dependency('gee-0.8', version: '>= 0.8'),
dependency('libportal', version: '>= 0.6'),
dependency('libportal-gtk4', version: '>= 0.6'),
json_glib_dep,
gtksourceview_dep,
libadwaita_dep,
libm_dep,
valac.find_library('config', dirs: vapi_dir),
]
# }
i18n = import('i18n')
gnome = import('gnome')
subdir('data')
subdir('resources')
subdir('src')
subdir('po')
install_subdir('scripts', install_dir: pkgdata_dir)
gnome.post_install(
glib_compile_schemas: true,
gtk_update_icon_cache: true,
update_desktop_database: true
)