Skip to content

Commit d26dab8

Browse files
committed
build: introduce meson build system
1 parent c14ffc7 commit d26dab8

16 files changed

+576
-25
lines changed

.github/workflows/ci.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,30 @@ jobs:
3535
weston --no-config --socket=wl-headless --backend=headless &
3636
WAYLAND_DISPLAY=wl-headless ctest --test-dir build --verbose
3737
38+
build-meson:
39+
runs-on: ubuntu-latest
40+
container: quay.io/fedora/fedora:43
41+
42+
steps:
43+
- uses: actions/checkout@v5
44+
45+
- name: Install build dependencies
46+
run: sudo dnf -y install gcc meson gtk4-devel ibus-devel libadwaita-devel libchewing-devel ibus gettext weston
47+
48+
- name: Build
49+
run: |
50+
meson setup build
51+
meson compile -C build
52+
meson install -n -C build
53+
54+
- name: Test
55+
env:
56+
XDG_RUNTIME_DIR: /tmp
57+
GSETTINGS_BACKEND: keyfile
58+
run: |
59+
weston --no-config --socket=wl-headless --backend=headless &
60+
WAYLAND_DISPLAY=wl-headless meson test -C build --print-errorlogs
61+
3862
coverage:
3963
runs-on: ubuntu-latest
4064
container: quay.io/fedora/fedora:43
@@ -81,6 +105,35 @@ jobs:
81105
env:
82106
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
83107

108+
coverage-meson:
109+
runs-on: ubuntu-latest
110+
container: quay.io/fedora/fedora:43
111+
112+
steps:
113+
- uses: actions/checkout@v5
114+
115+
- name: Install build dependencies
116+
run: sudo dnf -y install gcc gcovr meson gtk4-devel ibus-devel libadwaita-devel libchewing-devel ibus gettext weston git
117+
118+
- name: Build
119+
run: |
120+
meson setup -Db_coverage=true build
121+
meson compile -C build
122+
123+
- name: Test
124+
env:
125+
XDG_RUNTIME_DIR: /tmp
126+
GSETTINGS_BACKEND: keyfile
127+
run: |
128+
weston --no-config --socket=wl-headless --backend=headless &
129+
WAYLAND_DISPLAY=wl-headless meson test -C build --print-errorlogs
130+
ninja -C build coverage-xml
131+
132+
- name: Upload coverage reports to Codecov
133+
uses: codecov/codecov-action@v5
134+
env:
135+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
136+
84137
# https://github.com/orgs/community/discussions/26822
85138
results:
86139
if: ${{ always() }}

gio-autocleanups.h.gcov

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
-: 0:Source:/usr/include/glib-2.0/gio/gio-autocleanups.h
2+
-: 0:Graph:_build/src/ibus-engine-chewing.p/ibus-chewing-engine.c.gcno
3+
-: 0:Data:-
4+
-: 0:Runs:0
5+
-: 1:/*
6+
-: 2: * Copyright © 2015 Canonical Limited
7+
-: 3: *
8+
-: 4: * SPDX-License-Identifier: LGPL-2.1-or-later
9+
-: 5: *
10+
-: 6: * This library is free software; you can redistribute it and/or
11+
-: 7: * modify it under the terms of the GNU Lesser General Public
12+
-: 8: * License as published by the Free Software Foundation; either
13+
-: 9: * version 2.1 of the License, or (at your option) any later version.
14+
-: 10: *
15+
-: 11: * This library is distributed in the hope that it will be useful,
16+
-: 12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
17+
-: 13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18+
-: 14: * Lesser General Public License for more details.
19+
-: 15: *
20+
-: 16: * You should have received a copy of the GNU Lesser General Public
21+
-: 17: * License along with this library; if not, see <http://www.gnu.org/licenses/>.
22+
-: 18: *
23+
-: 19: * Author: Ryan Lortie <desrt@desrt.ca>
24+
-: 20: */
25+
-: 21:
26+
-: 22:#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
27+
-: 23:#error "Only <gio/gio.h> can be included directly."
28+
-: 24:#endif
29+
-: 25:
30+
-: 26:#ifndef __GI_SCANNER__
31+
-: 27:
32+
-: 28:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GAction, g_object_unref)
33+
-: 29:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GActionMap, g_object_unref)
34+
-: 30:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GAppInfo, g_object_unref)
35+
-: 31:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GAppLaunchContext, g_object_unref)
36+
-: 32:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GAppInfoMonitor, g_object_unref)
37+
-: 33:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GApplicationCommandLine, g_object_unref)
38+
-: 34:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GApplication, g_object_unref)
39+
-: 35:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GAsyncInitable, g_object_unref)
40+
-: 36:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GAsyncResult, g_object_unref)
41+
-: 37:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GBufferedInputStream, g_object_unref)
42+
-: 38:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GBufferedOutputStream, g_object_unref)
43+
-: 39:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GBytesIcon, g_object_unref)
44+
-: 40:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GCancellable, g_object_unref)
45+
-: 41:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GCharsetConverter, g_object_unref)
46+
-: 42:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GConverter, g_object_unref)
47+
-: 43:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GConverterInputStream, g_object_unref)
48+
-: 44:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GConverterOutputStream, g_object_unref)
49+
-: 45:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GCredentials, g_object_unref)
50+
-: 46:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDatagramBased, g_object_unref)
51+
-: 47:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDataInputStream, g_object_unref)
52+
-: 48:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDataOutputStream, g_object_unref)
53+
-: 49:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDBusActionGroup, g_object_unref)
54+
-: 50:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDBusAuthObserver, g_object_unref)
55+
-: 51:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDBusConnection, g_object_unref)
56+
-: 52:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDBusInterface, g_object_unref)
57+
-: 53:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDBusInterfaceSkeleton, g_object_unref)
58+
-: 54:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDBusMenuModel, g_object_unref)
59+
-: 55:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDBusMessage, g_object_unref)
60+
-: 56:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDBusMethodInvocation, g_object_unref)
61+
-: 57:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDBusNodeInfo, g_dbus_node_info_unref)
62+
-: 58:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDBusObject, g_object_unref)
63+
-: 59:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDBusObjectManagerClient, g_object_unref)
64+
-: 60:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDBusObjectManager, g_object_unref)
65+
-: 61:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDBusObjectManagerServer, g_object_unref)
66+
-: 62:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDBusObjectProxy, g_object_unref)
67+
-: 63:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDBusObjectSkeleton, g_object_unref)
68+
-: 64:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDBusProxy, g_object_unref)
69+
-: 65:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDBusServer, g_object_unref)
70+
-: 66:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDrive, g_object_unref)
71+
-: 67:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GEmblemedIcon, g_object_unref)
72+
-: 68:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GEmblem, g_object_unref)
73+
-: 69:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GFileEnumerator, g_object_unref)
74+
-: 70:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GFile, g_object_unref)
75+
-: 71:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GFileAttributeInfoList, g_file_attribute_info_list_unref)
76+
-: 72:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GFileIcon, g_object_unref)
77+
-: 73:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GFileInfo, g_object_unref)
78+
-: 74:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GFileInputStream, g_object_unref)
79+
-: 75:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GFileIOStream, g_object_unref)
80+
-: 76:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GFileMonitor, g_object_unref)
81+
-: 77:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GFilenameCompleter, g_object_unref)
82+
-: 78:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GFileOutputStream, g_object_unref)
83+
-: 79:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GFilterInputStream, g_object_unref)
84+
-: 80:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GFilterOutputStream, g_object_unref)
85+
-: 81:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GIcon, g_object_unref)
86+
-: 82:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GInetAddress, g_object_unref)
87+
-: 83:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GInetAddressMask, g_object_unref)
88+
-: 84:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GInetSocketAddress, g_object_unref)
89+
-: 85:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GInitable, g_object_unref)
90+
-: 86:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GInputStream, g_object_unref)
91+
-: 87:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GIOModule, g_object_unref)
92+
-: 88:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GIOStream, g_object_unref)
93+
-: 89:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GLoadableIcon, g_object_unref)
94+
-: 90:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMemoryInputStream, g_object_unref)
95+
-: 91:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMemoryOutputStream, g_object_unref)
96+
-: 92:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMenu, g_object_unref)
97+
-: 93:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMenuItem, g_object_unref)
98+
-: 94:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMenuModel, g_object_unref)
99+
-: 95:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMenuAttributeIter, g_object_unref)
100+
-: 96:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMenuLinkIter, g_object_unref)
101+
-: 97:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMount, g_object_unref)
102+
-: 98:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMountOperation, g_object_unref)
103+
-: 99:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GNativeVolumeMonitor, g_object_unref)
104+
-: 100:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GNetworkAddress, g_object_unref)
105+
-: 101:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GNetworkMonitor, g_object_unref)
106+
-: 102:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GNetworkService, g_object_unref)
107+
-: 103:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GNotification, g_object_unref)
108+
-: 104:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GOutputStream, g_object_unref)
109+
-: 105:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GPermission, g_object_unref)
110+
-: 106:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GPollableInputStream, g_object_unref)
111+
-: 107:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GPollableOutputStream, g_object_unref)
112+
-: 108:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GPropertyAction, g_object_unref)
113+
-: 109:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GProxyAddressEnumerator, g_object_unref)
114+
-: 110:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GProxyAddress, g_object_unref)
115+
-: 111:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GProxy, g_object_unref)
116+
-: 112:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GProxyResolver, g_object_unref)
117+
-: 113:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GRemoteActionGroup, g_object_unref)
118+
-: 114:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GResolver, g_object_unref)
119+
-: 115:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GResource, g_resource_unref)
120+
-: 116:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSeekable, g_object_unref)
121+
-: 117:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSettingsBackend, g_object_unref)
122+
-: 118:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSettingsSchema, g_settings_schema_unref)
123+
-: 119:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSettingsSchemaKey, g_settings_schema_key_unref)
124+
-: 120:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSettingsSchemaSource, g_settings_schema_source_unref)
125+
#####: 121:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSettings, g_object_unref)
126+
------------------
127+
glib_autoptr_cleanup_GSettings:
128+
#####: 121:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSettings, g_object_unref)
129+
------------------
130+
glib_autoptr_clear_GSettings:
131+
#####: 121:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSettings, g_object_unref)
132+
------------------
133+
-: 122:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSimpleActionGroup, g_object_unref)
134+
-: 123:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSimpleAction, g_object_unref)
135+
-: 124:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSimpleAsyncResult, g_object_unref)
136+
-: 125:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSimplePermission, g_object_unref)
137+
-: 126:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSimpleProxyResolver, g_object_unref)
138+
-: 127:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSocketAddressEnumerator, g_object_unref)
139+
-: 128:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSocketAddress, g_object_unref)
140+
-: 129:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSocketClient, g_object_unref)
141+
-: 130:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSocketConnectable, g_object_unref)
142+
-: 131:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSocketConnection, g_object_unref)
143+
-: 132:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSocketControlMessage, g_object_unref)
144+
-: 133:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSocket, g_object_unref)
145+
-: 134:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSocketListener, g_object_unref)
146+
-: 135:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSocketService, g_object_unref)
147+
-: 136:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSubprocess, g_object_unref)
148+
-: 137:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSubprocessLauncher, g_object_unref)
149+
-: 138:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GTask, g_object_unref)
150+
-: 139:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GTcpConnection, g_object_unref)
151+
-: 140:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GTcpWrapperConnection, g_object_unref)
152+
-: 141:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GTestDBus, g_object_unref)
153+
-: 142:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GThemedIcon, g_object_unref)
154+
-: 143:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GThreadedSocketService, g_object_unref)
155+
-: 144:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GTlsBackend, g_object_unref)
156+
-: 145:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GTlsCertificate, g_object_unref)
157+
-: 146:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GTlsClientConnection, g_object_unref)
158+
-: 147:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GTlsConnection, g_object_unref)
159+
-: 148:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GTlsDatabase, g_object_unref)
160+
-: 149:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GTlsFileDatabase, g_object_unref)
161+
-: 150:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GTlsInteraction, g_object_unref)
162+
-: 151:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GTlsPassword, g_object_unref)
163+
-: 152:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GTlsServerConnection, g_object_unref)
164+
-: 153:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GVfs, g_object_unref)
165+
-: 154:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GVolume, g_object_unref)
166+
-: 155:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GVolumeMonitor, g_object_unref)
167+
-: 156:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GZlibCompressor, g_object_unref)
168+
-: 157:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GZlibDecompressor, g_object_unref)
169+
-: 158:
170+
-: 159:#endif /* __GI_SCANNER__ */

ibus-chewing-engine.c.gcov

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-: 0:Source:../src/ibus-chewing-engine.c
2+
-: 0:Graph:_build/src/ibus-engine-chewing.p/ibus-chewing-engine.c.gcno
3+
-: 0:Data:-
4+
-: 0:Runs:0

ibus-chewing-engine.h.gcov

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-: 0:Source:../src/ibus-chewing-engine.h
2+
-: 0:Graph:_build/src/ibus-engine-chewing.p/ibus-chewing-engine.c.gcno
3+
-: 0:Data:-
4+
-: 0:Runs:0

meson.build

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
project(
2+
'ibus-chewing',
3+
'c',
4+
version: '2.1.7',
5+
meson_version: '>= 0.57.0',
6+
default_options: ['c_std=c23'],
7+
)
8+
9+
add_project_arguments('-D_XOPEN_SOURCE', language: 'c')
10+
11+
gnome = import('gnome')
12+
i18n = import('i18n')
13+
14+
ibus_chewing_prefix = get_option('prefix')
15+
ibus_chewing_datadir = ibus_chewing_prefix / get_option('datadir')
16+
ibus_chewing_libexecdir = ibus_chewing_prefix / get_option('libexecdir')
17+
ibus_chewing_localedir = ibus_chewing_prefix / get_option('localedir')
18+
ibus_chewing_docdir = ibus_chewing_datadir / 'doc' / 'ibus-chewing'
19+
20+
ibus_component_dir = ibus_chewing_datadir / 'ibus' / 'component'
21+
ibus_chewing_icondir = ibus_chewing_datadir / 'ibus-chewing' / 'icons'
22+
gschema_dir = ibus_chewing_datadir / 'glib-2.0' / 'schemas'
23+
24+
project_id = 'org.freedesktop.IBus.Chewing'
25+
26+
conf = configuration_data()
27+
conf.set('GETTEXT_PACKAGE', 'ibus-chewing')
28+
conf.set('LOCALEDIR', ibus_chewing_localedir)
29+
conf.set('PROJECT_NAME', meson.project_name())
30+
conf.set('PROJECT_SCHEMA_ID', project_id)
31+
conf.set('PROJECT_SCHEMA_DIR', '/desktop/ibus/engine/chewing')
32+
conf.set('PRJ_DATA_DIR', ibus_chewing_datadir / 'ibus-chewing')
33+
conf.set('PRJ_VER', meson.project_version())
34+
conf.set('PRJ_URL', 'https://github.com/chewing/ibus-chewing')
35+
conf.set('LIBEXEC_DIR', ibus_chewing_libexecdir)
36+
conf.set('LICENSE', 'GPLv2+')
37+
38+
ibus_dep = dependency('ibus-1.0', version: '>= 1.3')
39+
chewing_dep = dependency('chewing', version: '>= 0.9.0')
40+
glib_dep = dependency('glib-2.0')
41+
gtk_dep = dependency('gtk4')
42+
libadwaita_dep = dependency('libadwaita-1')
43+
44+
chewing_datadir_real = chewing_dep.get_variable(pkgconfig: 'datadir')
45+
conf.set('CHEWING_DATADIR_REAL', chewing_datadir_real)
46+
47+
if ibus_dep.version().version_compare('>= 1.5.11')
48+
conf.set('ICON_PROP_KEY', '<icon_prop_key>InputMode</icon_prop_key>')
49+
else
50+
conf.set(
51+
'ICON_PROP_KEY',
52+
'<!-- <icon_prop_key>InputMode</icon_prop_key> -->',
53+
)
54+
endif
55+
56+
if ibus_dep.version().version_compare('>= 1.3.99')
57+
conf.set('SYMBOL_XML', '<symbol>&#x9177;</symbol>')
58+
conf.set('HOTKEYS_XML', '<hotkeys>Super+space</hotkeys>')
59+
conf.set(
60+
'SETUP_PROGRAM_XML',
61+
'<setup>' + ibus_chewing_libexecdir / 'ibus-setup-chewing' + '</setup>',
62+
)
63+
else
64+
conf.set('SYMBOL_XML', '<!-- <symbol>&#x9177;</symbol> -->')
65+
conf.set('HOTKEYS_XML', '<!-- <hotkeys>Super+space</hotkeys> -->')
66+
conf.set(
67+
'SETUP_PROGRAM_XML',
68+
'<!-- <setup>' + ibus_chewing_libexecdir / 'ibus-setup-chewing' + '</setup> -->',
69+
)
70+
endif
71+
72+
add_project_arguments(
73+
'-DPROJECT_NAME=' + conf.get('PROJECT_NAME'),
74+
'-DPROJECT_SCHEMA_ID=' + conf.get('PROJECT_SCHEMA_ID'),
75+
# TODO path deprecated
76+
'-DPROJECT_SCHEMA_BASE=/desktop/ibus/engine',
77+
'-DPROJECT_SCHEMA_SECTION=chewing',
78+
'-DPROJECT_SCHEMA_DIR=/desktop/ibus/engine/chewing',
79+
'-DPROJECT_SCHEMA_PATH=/desktop/ibus/engine/chewing',
80+
'-DDATA_DIR=' + ibus_chewing_datadir,
81+
'-DPRJ_DATA_DIR=' + conf.get('PRJ_DATA_DIR'),
82+
'-DPRJ_VER=' + conf.get('PRJ_VER'),
83+
'-DPRJ_URL=' + conf.get('PRJ_URL'),
84+
'-DIBUS_VERSION=' + ibus_dep.version(),
85+
'-DCHEWING_VERSION=' + chewing_dep.version(),
86+
'-DLIBEXEC_DIR=' + conf.get('LIBEXEC_DIR'),
87+
'-DCHEWING_DATADIR_REAL=' + conf.get('CHEWING_DATADIR_REAL'),
88+
language: 'c',
89+
)
90+
91+
configure_file(
92+
input: 'data/chewing.xml.in',
93+
output: 'chewing.xml',
94+
configuration: conf,
95+
install: true,
96+
install_dir: ibus_component_dir,
97+
)
98+
99+
configure_file(
100+
input: 'data/ibus-setup-chewing.desktop.in',
101+
output: 'ibus-setup-chewing.desktop',
102+
configuration: conf,
103+
install: true,
104+
install_dir: ibus_chewing_datadir / 'applications',
105+
)
106+
107+
install_data(
108+
'AUTHORS',
109+
'README.md',
110+
'CHANGELOG.md',
111+
'ChangeLog-1.x',
112+
'COPYING',
113+
'USER-GUIDE',
114+
install_dir: ibus_chewing_docdir,
115+
)
116+
117+
install_data(
118+
'icons/ibus-chewing.png',
119+
'icons/ibus-setup-chewing.png',
120+
'icons/org.freedesktop.IBus.Chewing.Setup.svg',
121+
install_dir: ibus_chewing_icondir,
122+
)
123+
124+
install_data(
125+
'icons/org.freedesktop.IBus.Chewing.Setup.svg',
126+
install_dir: ibus_chewing_datadir / 'icons' / 'hicolor' / 'scalable' / 'apps',
127+
)
128+
129+
subdir('po')
130+
subdir('src')
131+
subdir('test')

po/LINGUAS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ca cs de es fr it ja ko pa pl pt_BR uk zh_CN zh_TW

po/POTFILES

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
src/setup/ibus-setup-chewing-window.ui
2+
src/setup/ibus-setup-chewing-about.c
3+
src/setup/ibus-setup-chewing-application.c
4+
src/setup/ibus-setup-chewing-window.c
5+
src/setup/main.c
6+
src/ibus-chewing-engine.c
7+
src/ibus-chewing-lookup-table.c
8+
src/ibus-chewing-preedit.c
9+
src/ibus-chewing-util.c
10+
src/main.c
11+
src/maker-dialog-util.c

0 commit comments

Comments
 (0)