This change adds a new GitHub action that verifies that Keyman can build
from the source package. Also check that source package used for Launchpad
and Debian/Ubuntu packaging doesn't produce lintian errors. Previously
lintian errors did go unnoticed because they didn't stop the build.
Also refactor `launchpad.sh` script to be a proper builder script, and add
some new parameters to allow skipping some steps in the script.
Build-bot: skip
Test-bot: skip
This change allows to collect data for a diagnostic report. This can be
done either from the command line through the new `km-diag-report` tool,
or in `km-config` from the new `Support` tab that allows to generate the
report and then copy it to the clipboard or save as a file.
The diagnostic report contains installed browsers and their versions and
installation methods as well as the default browser. It checks for
browsers installed through apt (Ubuntu/Debian), snap, and flatpak.
The change also has an implementation for pacman (Arch Linux) and
dnf/yum (Fedora), although these have not been tested.
Fixes: #7784
Under some circumstances it's possible that the user manages to select
a directory instead of a kmp file, or manually enters a non-existing file.
Is used to throw an error that we caught on Sentry; the user was able to
continue to use the app. This change now checks for a valid file before
trying to install the kmp file.
Fixes: #15572
Fixes: KEYMAN-LINUX-99
This change adds a manual test that allows to see if all strings are
localizable. It also fixes the `update-template` target in the
`Makefile`.
Build-bot: skip
Test-bot: skip
chore(linux): replace deprecated `parse_version`
`pkg_resources` which contains `parse_version` is deprecated. Latest versions output a warning. This change uses the suggested replacement, `package.version.parse` which is available in all supported Ubuntu versions.
Fixes: #14957
fix(linux): use `ibus` command to restart ibus
When using Kubuntu exiting ibus sometimes used to hang (#10178). This was because ibus' `bus.exit()` doesn't shutdown properly (see https://github.com/ibus/ibus/issues/2816#issuecomment-3410473708). The recommended way is to use the `ibus exit` command. Since we no longer use the API we can directly use the `ibus restart` command, which this PR implements.
Fixes: #10178
`pkg_resources` which contains `parse_version` is deprecated. Latest
versions output a warning. This change uses the suggested replacement,
`package.version.parse` which is available in all supported Ubuntu
versions.
Fixes: #14957
fix(linux): install schema during `keyman-config/build.sh install`
- improve documentation for installing km-config
- install schema during `keyman-config/build.sh install`
- remove schema during `keyman-config/build.sh uninstall`
- improve two scenarios when running `keyman-config/build.sh install`:
- on newer Ubuntu versions it's no longer possible to directly install Python packages, so we have to use a virtual environment. This change detects a virtual environment and installs into that.
- detect if we're running directly as `root` user instead of `sudo` and explicitly install into `/usr/local`.
- remove obsolete targets from Makefile. `make deb` no longer worked, so this change removes it. The other removed targets in the Makefile were just calling `./build.sh` and so are not really necessary and not used.
- update packaging documentation
Fixes: #14943
When using Kubuntu exiting ibus sometimes used to hang (#10178). This
was because ibus' `bus.exit()` doesn't shutdown properly
(see https://github.com/ibus/ibus/issues/2816#issuecomment-3410473708).
The recommended way is to use the `ibus exit` command. Since we no longer
use the API we can directly use the `ibus restart` command, which this
PR implements.
Fixes: #10178
fix(linux): fix installing keyboard in shared area 🍲
Installing into the shared area (`/usr/local/share`) requires `root` permissions, so in order to install into the shared area the user has to call `km-package-install` with `sudo`. But we also want to add the keyboard to the user's list of available keyboards so that he can switch to it. That needs to be done in the user context. However, when `sudo` ran the command in the user context, the environment variables to connect to the user's session dbus were not set.
This change fixes this by passing `DBUS_SESSION_BUS_ADDRESS` along with the `sudo -u <user>` call. Since `root` doesn't have this variable set (or at least not pointing to the user's dbus), we construct the dbus address based on the user's uid.
On newer Ubuntu versions (>=25.04) we also have to set `XDG_RUNTIME_DIR`, at least when running the autopkgtests.
Fixes: #14911
refactor(linux): remove no-longer-needed Python 3.7 code
Our oldest supported Ubuntu version is 22.04 which comes with Python 3.10, so we can remove the code for Python 3.7.
This improves two scenarios when running `keyman-config/build.sh install`:
- on newer Ubuntu versions it's no longer possible to directly install
Python packages, so we have to use a virtual environment. This change
detects a virtual environment and installs into that.
- detect if we're running directly as `root` user instead of `sudo`
and explicitly install into `/usr/local`.
Test-bot: skip
Installing into the shared area (`/usr/local/share`) requires `root`
permissions, so in order to install into the shared area the user has
to call `km-package-install` with `sudo`. But we also want to add the
keyboard to the user's list of available keyboards so that he can
switch to it. That needs to be done in the user context. However,
when `sudo` ran the command in the user context, the environment
variables to connect to the user's session dbus were not set.
This change fixes this by passing `DBUS_SESSION_BUS_ADDRESS` along
with the `sudo -u <user>` call. Since `root` doesn't have this variable
set (or at least not pointing to the user's dbus), we construct the
dbus address based on the user's uid.
On newer Ubuntu versions (>=25.04) we also have to set `XDG_RUNTIME_DIR`,
at least when running the autopkgtests.
Fixes: #14911
When running `km-package-install` with `sudo`, cache files owned by
root get created in the users directory. This makes it harder to
replace, and if the user tries to install the keyboard again under his
user account, installation will fail. This change prevents the use
of the cache when running with `sudo`.
Test-bot: skip
When using a different DBus implementation `dbus-launch` might not exist,
but instantiating a `SessionBus` object might start a session dbus if
it's not already running. This change also replaces the `dbus-x11`
dependency with `default-dbus-session-bus | dbus-session-bus` and changes
the way we detect if dbus is already running.
Also remove `DBUS_SESSION_BUS_ADDRESS` from `sudo gsettings` call. It
turns out we don't need this since we execute the `gsettings` command
in the context of the user anyway which connects to the user's session
dbus.
Fixes: #14888
- add breadcrumbs with keyboard details
- add some more information about system
- mark files in `km_config` as to the app belonging
- some refactorings
Test-bot: skip
Using `if var := func():` syntax outputs a warning
`FutureWarning: The behavior of this method will change in future
versions. Use specific 'len(elem)' or 'elem is not None' test instead.`
in Python 3.12. This change works around this warning.
Test-bot: skip
Some keyboards seem to be missing the `keyboards` section in the
`kmp.json` file. This change prevents a crash and instead returns `None`
and thus we don't create a .ldml file and so onboard will show the
default keyboard instead. The alternative would be to create an empty
.ldml file, but that causes onboard to show a keyboard with all key caps
being empty.
Fixes: #14707
Fixes: KEYMAN-LINUX-8P
Test-bot: skip
This fixes a bug where a keyboard didn't show up in the language dropdown if the first language it specified wasn't a normalized language tag. Previously in that case we added a custom keyboard with whatever language tag the keyboard specified. With this change we now continue to use the first language of the first keyboard but normalize it. Since the selection of the language now happens a little earlier it is slightly possible that there will be unexpected side effects that didn't show up in my testing.
Fixes: #14465
This fixes a bug where a keyboard didn't show up in the language dropdown
if the first language it specified wasn't a normalized language tag.
Previously in that case we added a custom keyboard with whatever language
tag the keyboard specified. With this change we now continue to use
the first language of the first keyboard but normalize it. Since the
selection of the language now happens a little earlier it is slightly
possible that there will be unexpected side effects that didn't show up
in my testing.
Fixes: #14465
Clarifies the confusing builder.inc.sh / build-utils.sh distinction by
giving the scripts more appropriate names. Most build scripts should use
builder-full.inc.sh; some helper scripts can use builder-basic.inc.sh.
Documented in resources/build/README.md.
Renames:
* resources/build/builder.inc.sh to resources/build/builder-full.inc.sh
* resources/build/build-utils.sh to resources/build/builder-basic.inc.sh
Other changes:
* Moves Android-specific functions out of builder-basic.inc.sh and into
android/build.sh.
* Renames functions in builder-basic.inc.sh
More functions may be moved from builder-basic.inc.sh into utils.inc.sh
or other scripts in the future.
Fixes: #14065
Build-bot: build all
Test-bot: skip
This adds a modified version of JetBrains' TeamCity test runner that
makes use of the `parent` property in the service messages and thus
allows to properly indent and fold the block that contains the test
output.
Test-bot: skip
This fixes the version numbers in `km-config` which broke with #13854.
This also fixes opening the download page in `km-config` because that
uses a version number in the URL.
Fixes: #14031
Follow-up-of: #13854
Previously the builder scripts defined a readonly `VERSION` environment
variable for the Keyman version. That caused problems when another
(external) script tried to define a `VERSION` variable. We encountered
this problem when trying to move the TC build steps of a configuration
into a single script (#13399) when we tried to source `~/.nvm/nvm.sh`.
This change uses a Keyman specific prefix for the version variables and
renames `VERSION` → `KEYMAN_VERSION` etc. Unfortunately these variables
are used in a lot of places, so this turned out to be a bit of a yak
shave.
Test-bot: skip
This change overrides a check added in Ubuntu 24.04+ that prevents mixing Python packages installed through apt and through pip. This allows to install the necessary Python package for TC which isn't available as Debian package. This change allows builds on Ubuntu 24.04 based TC agents.
This changes the shebang at the top of the file to allow use Python
from a virtual environment instead of hard-coding the path. This might
not be strictly necessary, but reduces confusion and doesn't hurt.
This change overrides a check added in Ubuntu 24.04+ that prevents
mixing Python packages installed through apt and through pip. This
allows to install the necessary Python package for TC which isn't
available as Debian package. This change allows builds on Ubuntu 24.04
based TC agents.