Skip to content

Commit 7de6472

Browse files
authored
Merge pull request #9602 from keymanapp/chore/linux/fixbug
chore(linux): Fix bugs, add dependency and update documentation
2 parents b7314f1 + 9062742 commit 7de6472

File tree

10 files changed

+24
-17
lines changed

10 files changed

+24
-17
lines changed

.github/workflows/deb-packaging.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ jobs:
119119
path: artifacts
120120

121121
- name: Build
122-
uses: sillsdev/gha-ubuntu-packaging@4f3a013ec28f4defc2b3d6ecb04c98815cd9de25 # v0.9
122+
uses: sillsdev/gha-ubuntu-packaging@1f4b7e7eacb8c82a4d874ee2c371b9bfef7e16ea # v1.0
123123
with:
124124
dist: "${{ matrix.dist }}"
125125
platform: "${{ matrix.arch }}"

linux/debian/rules

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,17 @@ override_dh_auto_configure:
3030
--wrap-mode=nodownload --prefix=/usr --sysconfdir=/etc \
3131
--localstatedir=/var --libdir=lib/$(DEB_TARGET_MULTIARCH) \
3232
--libexecdir=lib/$(DEB_TARGET_MULTIARCH)
33-
linux/ibus-keyman/build.sh configure -- \
34-
--wrap-mode=nodownload --prefix=/usr --sysconfdir=/etc --localstatedir=/var
3533
linux/keyman-system-service/build.sh configure -- \
3634
--wrap-mode=nodownload --prefix=/usr --sysconfdir=/etc --localstatedir=/var
35+
linux/ibus-keyman/build.sh configure -- \
36+
--wrap-mode=nodownload --prefix=/usr --sysconfdir=/etc --localstatedir=/var
3737
linux/keyman-config/build.sh configure
3838

3939
override_dh_auto_build:
4040
cp linux/keyman-config/resources/keyman.sharedmimeinfo debian/
4141
core/build.sh --no-tests build:arch
42-
linux/ibus-keyman/build.sh build
4342
linux/keyman-system-service/build.sh build
43+
linux/ibus-keyman/build.sh build
4444
linux/keyman-config/build.sh build
4545
cd linux/keyman-config && \
4646
sed -i -e "s/^__pkgversion__ = \"[^\"]*\"/__pkgversion__ = \"$(DEB_VERSION)\"/g" keyman_config/version.py && \
@@ -49,16 +49,16 @@ override_dh_auto_build:
4949
override_dh_auto_test:
5050
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
5151
core/build.sh --no-tests test:arch
52-
linux/ibus-keyman/build.sh test
5352
linux/keyman-system-service/build.sh test
53+
linux/ibus-keyman/build.sh test
5454
linux/keyman-config/build.sh test
5555
endif
5656

5757
override_dh_auto_install:
5858
install -d $(CURDIR)/debian/tmp
5959
DESTDIR=$(CURDIR)/debian/tmp core/build.sh --no-tests install:arch
60-
DESTDIR=$(CURDIR)/debian/tmp linux/ibus-keyman/build.sh install
6160
DESTDIR=$(CURDIR)/debian/tmp linux/keyman-system-service/build.sh install
61+
DESTDIR=$(CURDIR)/debian/tmp linux/ibus-keyman/build.sh install
6262
# keyman-config
6363
install -d $(CURDIR)/debian/keyman/usr/share/
6464
cp -r linux/keyman-config/locale/ $(CURDIR)/debian/keyman/usr/share/
@@ -76,8 +76,8 @@ override_dh_missing:
7676

7777
override_dh_auto_clean:
7878
core/build.sh clean
79-
linux/ibus-keyman/build.sh clean
8079
linux/keyman-system-service/build.sh clean
80+
linux/ibus-keyman/build.sh clean
8181
linux/keyman-config/build.sh clean
8282
rm -rf .pybuild/
8383
dh_auto_clean $@

linux/ibus-keyman/build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ builder_describe \
2020
"install install artifacts" \
2121
"uninstall uninstall artifacts" \
2222
"@/core:arch" \
23+
"@../keyman-system-service:service" \
2324
"--no-integration don't run integration tests" \
2425
"--report create coverage report" \
2526
"--coverage capture test coverage"

linux/ibus-keyman/src/KeymanSystemServiceClient.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ void KeymanSystemServiceClient::SetCapsLockIndicator(guint32 capsLock) {
5959
KEYMAN_INTERFACE_NAME, "SetCapsLockIndicator", error, &msg, "b", capsLock);
6060
if (result < 0) {
6161
g_error("%s: Failed to call method SetCapsLockIndicator: %s. %s. %s.",
62-
__FUNCTION__, strerror(-result), error->name, error->message);
62+
__FUNCTION__, strerror(-result), error ? error->name : "-", error ? error->message : "-");
6363
return;
6464
}
6565
}
@@ -78,7 +78,7 @@ gint32 KeymanSystemServiceClient::GetCapsLockIndicator() {
7878
KEYMAN_INTERFACE_NAME, "GetCapsLockIndicator", error, &msg, "");
7979
if (result < 0) {
8080
g_error("%s: Failed to call method GetCapsLockIndicator: %s. %s. %s.",
81-
__FUNCTION__, strerror(-result), error->name, error->message);
81+
__FUNCTION__, strerror(-result), error ? error->name : "-", error ? error->message : "-");
8282
return -1;
8383
}
8484

linux/ibus-keyman/tests/KmDbusTestServer.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,11 @@ void KmDbusTestServer::Loop()
139139

140140
int
141141
main(int argc, char *argv[]) {
142+
if (!g_file_test(KEYMAN_TEST_SERVICE_PATH, G_FILE_TEST_IS_DIR)) {
143+
std::cerr << "ERROR: Directory " << KEYMAN_TEST_SERVICE_PATH << " doesn't exist! Exiting." << std::endl;
144+
return 1;
145+
}
146+
142147
KmDbusTestServer testServer;
143148
testServer.Loop();
144149

linux/ibus-keyman/tests/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ are stored in `~/.config/glib-2.0/settings/keyfile`.
66

77
## Running tests
88

9-
The tests get run as part of building `ibus-keyman`, more specifically when running `make check`.
9+
The tests get run as part of building `ibus-keyman`, more specifically when running `build.sh test`.
1010

1111
### Run all tests
1212

linux/ibus-keyman/tests/scripts/run-tests.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ function run_tests() {
8686
#shellcheck disable=SC2086
8787
"${G_TEST_BUILDDIR:-../../build/$(arch)/${CONFIG}/tests}/ibus-keyman-tests" ${ARG_K-} ${ARG_TAP-} \
8888
${ARG_VERBOSE-} ${ARG_DEBUG-} ${ARG_SURROUNDING_TEXT-} ${ARG_NO_SURROUNDING_TEXT-} \
89-
--directory "$TESTDIR" --"${DISPLAY_SERVER}" ${TESTFILES[@]}
89+
--directory "$TESTDIR" "${DISPLAY_SERVER}" ${TESTFILES[@]}
9090
echo "# Finished tests."
9191

9292
cleanup "$PID_FILE"
@@ -136,9 +136,9 @@ echo > "$PID_FILE"
136136
trap local_cleanup EXIT SIGINT
137137

138138
if [ "$USE_WAYLAND" == "1" ]; then
139-
( run_tests wayland "$@" )
139+
run_tests --wayland "$@"
140140
fi
141141

142142
if [ "$USE_X11" == "1" ]; then
143-
( run_tests x11 "$@" )
143+
run_tests --x11 "$@"
144144
fi

linux/ibus-keyman/tests/scripts/test-helper.inc.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ function cleanup() {
278278
if [ -f "$PID_FILE" ]; then
279279
echo
280280
echo "# Shutting down processes..."
281-
bash "$PID_FILE" > /dev/null 2>&1
281+
bash "$PID_FILE" # > /dev/null 2>&1
282282
rm "$PID_FILE"
283283
echo "# Finished shutdown of processes."
284284
fi

linux/keyman-system-service/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
project('keyman-system-service', 'c', 'cpp',
22
version: run_command('cat', '../../VERSION.md', check: true).stdout().strip(),
33
license: 'GPL-2+',
4-
meson_version: '>=1.0')
4+
meson_version: '>=0.61')
55

66
evdev = dependency('libevdev', version: '>= 1.9')
77
systemd = dependency('libsystemd')

linux/scripts/reconf.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
set -e
3+
set -eu
44

55
## START STANDARD BUILD SCRIPT INCLUDE
66
# adjust relative paths as necessary
@@ -17,13 +17,14 @@ echo "Found tier ${TIER}, version ${VERSION}"
1717
cd ../core
1818
./build.sh --no-tests clean:arch configure:arch build:arch
1919

20+
# Building ibus-keyman will also build dependency keyman-system-service
2021
cd "$BASEDIR/ibus-keyman"
2122
./build.sh clean configure
2223

2324
cd "$BASEDIR/keyman-config"
2425
./build.sh clean
2526

26-
cd keyman_config
27+
cd "$BASEDIR/keyman-config/keyman_config"
2728
sed \
2829
-e "s/_VERSION_/${VERSION}/g" \
2930
-e "s/_VERSIONWITHTAG_/${VERSION_WITH_TAG}/g" \

0 commit comments

Comments
 (0)