Skip to content

Commit

Permalink
Merge pull request #9602 from keymanapp/chore/linux/fixbug
Browse files Browse the repository at this point in the history
chore(linux): Fix bugs, add dependency and update documentation
  • Loading branch information
ermshiperete authored Sep 21, 2023
2 parents b7314f1 + 9062742 commit 7de6472
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deb-packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand Down
12 changes: 6 additions & 6 deletions linux/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
Expand All @@ -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/
Expand All @@ -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 $@
1 change: 1 addition & 0 deletions linux/ibus-keyman/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions linux/ibus-keyman/src/KeymanSystemServiceClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand All @@ -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;
}

Expand Down
5 changes: 5 additions & 0 deletions linux/ibus-keyman/tests/KmDbusTestServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion linux/ibus-keyman/tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions linux/ibus-keyman/tests/scripts/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion linux/ibus-keyman/tests/scripts/test-helper.inc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion linux/keyman-system-service/meson.build
Original file line number Diff line number Diff line change
@@ -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')
Expand Down
5 changes: 3 additions & 2 deletions linux/scripts/reconf.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

set -e
set -eu

## START STANDARD BUILD SCRIPT INCLUDE
# adjust relative paths as necessary
Expand All @@ -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" \
Expand Down

0 comments on commit 7de6472

Please sign in to comment.