diff --git a/.github/workflows/deb-packaging.yml b/.github/workflows/deb-packaging.yml index 7106ed49b3f..2d72e017649 100644 --- a/.github/workflows/deb-packaging.yml +++ b/.github/workflows/deb-packaging.yml @@ -119,7 +119,7 @@ jobs: path: artifacts - name: Build - uses: sillsdev/gha-ubuntu-packaging@4f3a013ec28f4defc2b3d6ecb04c98815cd9de25 # v0.9 + uses: sillsdev/gha-ubuntu-packaging@1f4b7e7eacb8c82a4d874ee2c371b9bfef7e16ea # v1.0 with: dist: "${{ matrix.dist }}" platform: "${{ matrix.arch }}" diff --git a/linux/debian/rules b/linux/debian/rules index 44d0cc6dbff..1abfbf004ae 100755 --- a/linux/debian/rules +++ b/linux/debian/rules @@ -30,17 +30,17 @@ override_dh_auto_configure: --wrap-mode=nodownload --prefix=/usr --sysconfdir=/etc \ --localstatedir=/var --libdir=lib/$(DEB_TARGET_MULTIARCH) \ --libexecdir=lib/$(DEB_TARGET_MULTIARCH) - linux/ibus-keyman/build.sh configure -- \ - --wrap-mode=nodownload --prefix=/usr --sysconfdir=/etc --localstatedir=/var linux/keyman-system-service/build.sh configure -- \ --wrap-mode=nodownload --prefix=/usr --sysconfdir=/etc --localstatedir=/var + linux/ibus-keyman/build.sh configure -- \ + --wrap-mode=nodownload --prefix=/usr --sysconfdir=/etc --localstatedir=/var linux/keyman-config/build.sh configure override_dh_auto_build: cp linux/keyman-config/resources/keyman.sharedmimeinfo debian/ core/build.sh --no-tests build:arch - linux/ibus-keyman/build.sh build linux/keyman-system-service/build.sh build + linux/ibus-keyman/build.sh build linux/keyman-config/build.sh build cd linux/keyman-config && \ sed -i -e "s/^__pkgversion__ = \"[^\"]*\"/__pkgversion__ = \"$(DEB_VERSION)\"/g" keyman_config/version.py && \ @@ -49,16 +49,16 @@ override_dh_auto_build: override_dh_auto_test: ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) core/build.sh --no-tests test:arch - linux/ibus-keyman/build.sh test linux/keyman-system-service/build.sh test + linux/ibus-keyman/build.sh test linux/keyman-config/build.sh test endif override_dh_auto_install: install -d $(CURDIR)/debian/tmp DESTDIR=$(CURDIR)/debian/tmp core/build.sh --no-tests install:arch - DESTDIR=$(CURDIR)/debian/tmp linux/ibus-keyman/build.sh install DESTDIR=$(CURDIR)/debian/tmp linux/keyman-system-service/build.sh install + DESTDIR=$(CURDIR)/debian/tmp linux/ibus-keyman/build.sh install # keyman-config install -d $(CURDIR)/debian/keyman/usr/share/ cp -r linux/keyman-config/locale/ $(CURDIR)/debian/keyman/usr/share/ @@ -76,8 +76,8 @@ override_dh_missing: override_dh_auto_clean: core/build.sh clean - linux/ibus-keyman/build.sh clean linux/keyman-system-service/build.sh clean + linux/ibus-keyman/build.sh clean linux/keyman-config/build.sh clean rm -rf .pybuild/ dh_auto_clean $@ diff --git a/linux/ibus-keyman/build.sh b/linux/ibus-keyman/build.sh index bc136546d63..c2c45deec15 100755 --- a/linux/ibus-keyman/build.sh +++ b/linux/ibus-keyman/build.sh @@ -20,6 +20,7 @@ builder_describe \ "install install artifacts" \ "uninstall uninstall artifacts" \ "@/core:arch" \ + "@../keyman-system-service:service" \ "--no-integration don't run integration tests" \ "--report create coverage report" \ "--coverage capture test coverage" diff --git a/linux/ibus-keyman/src/KeymanSystemServiceClient.cpp b/linux/ibus-keyman/src/KeymanSystemServiceClient.cpp index 90f459d1a21..635c3ff22dd 100644 --- a/linux/ibus-keyman/src/KeymanSystemServiceClient.cpp +++ b/linux/ibus-keyman/src/KeymanSystemServiceClient.cpp @@ -59,7 +59,7 @@ void KeymanSystemServiceClient::SetCapsLockIndicator(guint32 capsLock) { KEYMAN_INTERFACE_NAME, "SetCapsLockIndicator", error, &msg, "b", capsLock); if (result < 0) { g_error("%s: Failed to call method SetCapsLockIndicator: %s. %s. %s.", - __FUNCTION__, strerror(-result), error->name, error->message); + __FUNCTION__, strerror(-result), error ? error->name : "-", error ? error->message : "-"); return; } } @@ -78,7 +78,7 @@ gint32 KeymanSystemServiceClient::GetCapsLockIndicator() { KEYMAN_INTERFACE_NAME, "GetCapsLockIndicator", error, &msg, ""); if (result < 0) { g_error("%s: Failed to call method GetCapsLockIndicator: %s. %s. %s.", - __FUNCTION__, strerror(-result), error->name, error->message); + __FUNCTION__, strerror(-result), error ? error->name : "-", error ? error->message : "-"); return -1; } diff --git a/linux/ibus-keyman/tests/KmDbusTestServer.cpp b/linux/ibus-keyman/tests/KmDbusTestServer.cpp index 1d4746163d5..e64a9354d8b 100644 --- a/linux/ibus-keyman/tests/KmDbusTestServer.cpp +++ b/linux/ibus-keyman/tests/KmDbusTestServer.cpp @@ -139,6 +139,11 @@ void KmDbusTestServer::Loop() int main(int argc, char *argv[]) { + if (!g_file_test(KEYMAN_TEST_SERVICE_PATH, G_FILE_TEST_IS_DIR)) { + std::cerr << "ERROR: Directory " << KEYMAN_TEST_SERVICE_PATH << " doesn't exist! Exiting." << std::endl; + return 1; + } + KmDbusTestServer testServer; testServer.Loop(); diff --git a/linux/ibus-keyman/tests/README.md b/linux/ibus-keyman/tests/README.md index 046333be9d4..a97f85d443e 100644 --- a/linux/ibus-keyman/tests/README.md +++ b/linux/ibus-keyman/tests/README.md @@ -6,7 +6,7 @@ are stored in `~/.config/glib-2.0/settings/keyfile`. ## Running tests -The tests get run as part of building `ibus-keyman`, more specifically when running `make check`. +The tests get run as part of building `ibus-keyman`, more specifically when running `build.sh test`. ### Run all tests diff --git a/linux/ibus-keyman/tests/scripts/run-tests.sh b/linux/ibus-keyman/tests/scripts/run-tests.sh index ae58705f110..00f36475776 100755 --- a/linux/ibus-keyman/tests/scripts/run-tests.sh +++ b/linux/ibus-keyman/tests/scripts/run-tests.sh @@ -86,7 +86,7 @@ function run_tests() { #shellcheck disable=SC2086 "${G_TEST_BUILDDIR:-../../build/$(arch)/${CONFIG}/tests}/ibus-keyman-tests" ${ARG_K-} ${ARG_TAP-} \ ${ARG_VERBOSE-} ${ARG_DEBUG-} ${ARG_SURROUNDING_TEXT-} ${ARG_NO_SURROUNDING_TEXT-} \ - --directory "$TESTDIR" --"${DISPLAY_SERVER}" ${TESTFILES[@]} + --directory "$TESTDIR" "${DISPLAY_SERVER}" ${TESTFILES[@]} echo "# Finished tests." cleanup "$PID_FILE" @@ -136,9 +136,9 @@ echo > "$PID_FILE" trap local_cleanup EXIT SIGINT if [ "$USE_WAYLAND" == "1" ]; then - ( run_tests wayland "$@" ) + run_tests --wayland "$@" fi if [ "$USE_X11" == "1" ]; then - ( run_tests x11 "$@" ) + run_tests --x11 "$@" fi diff --git a/linux/ibus-keyman/tests/scripts/test-helper.inc.sh b/linux/ibus-keyman/tests/scripts/test-helper.inc.sh index 9ea5ffe3fc1..ef1baac8786 100755 --- a/linux/ibus-keyman/tests/scripts/test-helper.inc.sh +++ b/linux/ibus-keyman/tests/scripts/test-helper.inc.sh @@ -278,7 +278,7 @@ function cleanup() { if [ -f "$PID_FILE" ]; then echo echo "# Shutting down processes..." - bash "$PID_FILE" > /dev/null 2>&1 + bash "$PID_FILE" # > /dev/null 2>&1 rm "$PID_FILE" echo "# Finished shutdown of processes." fi diff --git a/linux/keyman-system-service/meson.build b/linux/keyman-system-service/meson.build index 596ba48bcd4..66da8f98914 100644 --- a/linux/keyman-system-service/meson.build +++ b/linux/keyman-system-service/meson.build @@ -1,7 +1,7 @@ project('keyman-system-service', 'c', 'cpp', version: run_command('cat', '../../VERSION.md', check: true).stdout().strip(), license: 'GPL-2+', - meson_version: '>=1.0') + meson_version: '>=0.61') evdev = dependency('libevdev', version: '>= 1.9') systemd = dependency('libsystemd') diff --git a/linux/scripts/reconf.sh b/linux/scripts/reconf.sh index 4e4f5c1b115..49dfe21b1d0 100755 --- a/linux/scripts/reconf.sh +++ b/linux/scripts/reconf.sh @@ -1,6 +1,6 @@ #!/bin/bash -set -e +set -eu ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary @@ -17,13 +17,14 @@ echo "Found tier ${TIER}, version ${VERSION}" cd ../core ./build.sh --no-tests clean:arch configure:arch build:arch +# Building ibus-keyman will also build dependency keyman-system-service cd "$BASEDIR/ibus-keyman" ./build.sh clean configure cd "$BASEDIR/keyman-config" ./build.sh clean -cd keyman_config +cd "$BASEDIR/keyman-config/keyman_config" sed \ -e "s/_VERSION_/${VERSION}/g" \ -e "s/_VERSIONWITHTAG_/${VERSION_WITH_TAG}/g" \