The recommended replacement for `setup.py build` is to use the `build`
module, so we have to add this as additional build dependency.
This change also removes the `devdist` target from the makefile - it
isn't referenced in any script, so I think we can do without.
Unfortunately the `python3-build` package available on Ubuntu 22.04 Jammy
is buggy and looks for `/usr/local/bin/python` so we can't use that.
Instead we continue to use `setup.py` for building on Jammy.
Now that we no longer support Focal we can move to more modern ways of
installing `km-config`. This change removes the deprecated use of
`setup.py` and replaces it with `pip3 install`.
Fixes: #13319
The 2025-02-18 release of langtags.json includes tag data for sa-Latn
and he-Latn, so tests related to those tags now need to account for
region.
Fixes: #13288
The `xdg` module got renamed to `xdg_base_dirs`. However, Ubuntu still
ships the `python3-xdg` package with the old module, so we'll have to
support both so that it'll work with both Ubuntu packages and in a
virtual environment.
This change rename the test files for Linux according to the discussion
at the Keyman conference in November 2024.
Python is pretty opinionated about the naming of files, so we have to
use `*_tests.py` as test filename instead of the usual `*.tests.py`.
This works around a problem in webkit2gtk where the download dialog
sometimes only renders a blank screen. Setting the environment variable
seems to help, not only in the cases that the issue describes (with a
NVidia graphics card), but also in my testing in a VM.
Fixes: #12587
The previous implementation didn't work because the import of
`download_and_install_package` happened before we checked for the missing
dependencies and so the program crashed. This change fixes this and now
does the imports after checking for the missing dependencies so that we
can display an error message to the user.
Also fix a warning.
Names can be Unicode strings or byte arrays. This change allows for both
kinds. Also properly deal with the case when we can't get the name from
the .ttf file. And finally change the test so that we don't need the
`KbdKhmr.ttf` font.
This change adds the `keymanFacename` attribute based on UnicodeFont
or AnsiFont to the root element of the generated .ldml file so that
onboard-keyman can display the proper font for the osk.
Fixes: #12019
Using the cache when getting data from the server is just an optimization
to speed up things. However, things still work if we don't use the cache.
This change therefore catches the AttributeError that sometimes happen
on some machines for unknown reasons and falls back to not using the
cache.
Fixes: 11855
Fixes: KEYMAN-LINUX-6R
This changes re-creates the `<package>.bmp.png` as well as the
`<package>.json` files if they are missing when `km-config` starts.
- `<package.bmp.png` gets created from a `.bmp` or `.ico` file included
in the package, similar to what happens when installing the keyboard.
- `<package>.json` gets created from downloaded metadata, similar to
the installation.
If the files are missing or we can't write to the directory, e.g. if it's
the shared area, we skip the re-creation.
Fixes: #9396
This suddenly started failing. I guess there was a deprecated
`assertEquals` in older Python libraries, but with the latest version in
Ubuntu 24.04 Noble this disappeared. Anyway, with this change we use
the same assert method as in the other test files.
Note: there is a bit of potential confusion about the difference between
/resources/builder.inc.sh (the full implementation for builder scripts),
and /resources/build/builder.inc.sh (the source script that builder
scripts should always use).
This allows us to make assumptions that will always be true for builder
scripts that may not be true for other scripts, such as setting base
folder.
Fixes#11324.
* Always `cd "$THIS_SCRIPT_PATH"`
* Remove unnecessary `cd` from all build.sh
* Remove unnecessary `set -eu` from all build.sh (and `# set -x`)
* Replace old build-utils.sh incantation in a few build.sh scripts
It seems some Ubuntu versions ignore the `icon` field and only use
`generic-icon`, so this change adds that field. This will fix displaying
the icon on newer Ubuntu versions. And since we keep the `icon` field
it should still work everywhere else.
Fixes#11144.
This change improves the way we detect if we're running a Gnome based
UI that needs it's keyboards installed under
`org.gnome.desktop.input-sources`. We use the environment variable
`XDG_CURRENT_DESKTOP` and check if it contains the word `gnome`.
Additionally this change renames `is_gnome_shell()` to
`is_gnome_desktop()`.
Fixes#11225.
When we launch dbus if it is not running, we're probably (un-)installing
keyboards for a different user. This is an unusual environment where not
everything is available, e.g. dconf-service won't be running and can't
be started because DISPLAY variable is not set. This means we can't
write gsettings values through the API. However, we can read them, and we
can write a keyfile and update the database. This is what this change
implements for the cases where we started dbus.