-
-
Notifications
You must be signed in to change notification settings - Fork 67
Expand file tree
/
Copy pathmeson.build
More file actions
133 lines (111 loc) · 4.72 KB
/
Copy pathmeson.build
File metadata and controls
133 lines (111 loc) · 4.72 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
133
project('GPaste', 'c',
version: '50.5',
meson_version: '>=1.1',
default_options: [ 'warning_level=2', 'c_std=gnu17' ],
)
cc = meson.get_compiler('c')
gnome = import('gnome')
i18n = import('i18n')
apiversion = '2'
adwaita_req_version = '1.9'
gcr_req_version = '3.90.0'
glib_req_version = '2.84.0'
gtk4_req_version = '4.18.0'
gcr_dep = dependency('gcr-4', version: '>= ' + gcr_req_version)
gio_dep = dependency('gio-2.0', version: '>= ' + glib_req_version)
glib_dep = dependency('glib-2.0', version: '>= ' + glib_req_version)
gobject_dep = dependency('gobject-2.0', version: '>= ' + glib_req_version)
gtk4_dep = dependency('gtk4', version: '>= ' + gtk4_req_version)
gtk4x11_dep = dependency('gtk4-x11', version: '>= ' + gtk4_req_version)
libadwaita_dep = dependency('libadwaita-1', version: '>= ' + adwaita_req_version)
pango_dep = dependency('pango')
glib_major = glib_req_version.split('.')[0].to_int()
glib_minor = glib_req_version.split('.')[1].to_int()
gtk4_major = gtk4_req_version.split('.')[0].to_int()
gtk4_minor = gtk4_req_version.split('.')[1].to_int()
if glib_minor % 2 == 1
glib_minor = glib_minor + 1
endif
if gtk4_minor % 2 == 1
gtk4_minor = gtk4_minor + 1
endif
# Don't make dbus/gnome-control-center a build dependency if so desired.
# They're still required at runtime though.
dbus_service_dir = get_option('dbus-services-dir')
if dbus_service_dir == ''
dbus_service_dir = dependency('dbus-1').get_variable(pkgconfig: 'session_bus_services_dir')
endif
keybindings_dir = get_option('control-center-keybindings-dir')
if keybindings_dir == ''
keybindings_dir = dependency('gnome-keybindings').get_variable(pkgconfig: 'keysdir')
endif
libgpaste_deps = [ gio_dep, glib_dep, gobject_dep ]
# Optional libsodium-based history encryption (used by the daemon's storage backend).
libsodium_dep = dependency('libsodium', required: get_option('encryption'))
if libsodium_dep.found()
add_project_arguments('-DG_PASTE_ENABLE_ENCRYPTION', language: 'c')
endif
# Optional libsecret support to remember the encryption passphrase in the
# keyring. Only useful alongside encryption.
libsecret_dep = dependency('libsecret-1', required: get_option('libsecret'))
if libsodium_dep.found() and libsecret_dep.found()
add_project_arguments('-DG_PASTE_ENABLE_LIBSECRET', language: 'c')
endif
# Optional libpwquality support to rate the passphrase strength (GNOME-style) in
# the new-encrypted-history prompt. Only useful alongside encryption.
libpwquality_dep = dependency('pwquality', required: get_option('pwquality'))
if libsodium_dep.found() and libpwquality_dep.found()
add_project_arguments('-DG_PASTE_ENABLE_PWQUALITY', language: 'c')
endif
# The mutter (MetaSelection) clipboard backend is built alongside the extension;
# this lets the daemon expose g_paste_daemon_new_meta () for the in-shell glue.
if get_option('gnome-shell')
add_project_arguments('-DG_PASTE_ENABLE_GNOME_SHELL', language: 'c')
endif
userunit_dir = get_option('systemd-user-unit-dir')
if userunit_dir == ''
if get_option('systemd')
userunit_dir = dependency('systemd').get_variable(pkgconfig: 'systemduserunitdir')
endif
endif
if get_option('vapi') and not get_option('introspection')
error('GIR generation has to be enabled via -Dintrospection=true to build vala bindings!')
endif
pkglibexecdir = get_option('prefix') / get_option('libexecdir') / 'gpaste'
add_project_arguments(
'-DG_LOG_DOMAIN="GPaste"',
'-DG_LOG_USE_STRUCTURED=1',
'-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_@0@_@1@'.format(glib_major, glib_minor),
'-DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_@0@_@1@'.format(glib_major, glib_minor),
'-DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_@0@_@1@'.format(gtk4_major, gtk4_minor),
'-DGDK_VERSION_MAX_ALLOWED=GDK_VERSION_@0@_@1@'.format(gtk4_major, gtk4_minor),
'-DG_PASTE_COMPILATION',
'-DG_PASTE_DEFAULT_HISTORY="history"',
'-DG_PASTE_EXTENSION_NAME="GPaste@gnome-shell-extensions.gnome.org"',
'-DG_PASTE_ICON_NAME="edit-paste"',
'-DGETTEXT_PACKAGE="GPaste"',
'-DLOCALEDIR="' + (get_option('prefix') / get_option('datadir') / 'locale') + '"',
'-DPACKAGE="gpaste"',
'-DPACKAGE_NAME="GPaste"',
'-DPACKAGE_STRING="GPaste ' + meson.project_version() +'"',
'-DPACKAGE_VERSION="' + meson.project_version() + '"',
'-DPKGLIBEXECDIR="' + pkglibexecdir + '"',
'-DVERSION="' + meson.project_version() + '"',
language: 'c',
)
conf = configuration_data()
# Used later on to configure services&gnome-shell extension
conf.set('GETTEXT_PACKAGE', 'GPaste')
conf.set('pkglibexecdir', pkglibexecdir)
conf.set('version', meson.project_version())
conf.set('gettext_domain', 'GPaste')
gpaste_po_dir = meson.current_source_dir() / 'po'
subdir('man')
subdir('po')
subdir('src')
subdir('data')
subdir('tests')
gnome.post_install(
glib_compile_schemas: true,
update_desktop_database: true,
)