summaryrefslogtreecommitdiff
path: root/rules/meson.build
AgeCommit message (Collapse)AuthorFilesLines
2024-08-21rules: Fix layout compat rulesPierre Le Marre1-5/+4
Layout compatibility rules are broken in configurations with 2 or more layouts, e.g.: - Works: - config: `--layout fi --variant basic` - symbols: `pc+fi(classic)+inet(evdev)`. `fi(basic)` is correctly remapped to `fi(classic)`. - Does not work: - config `--layout fi,us --variant basic,` - symbols: `pc+fi(basic)+us:2+inet(evdev)`. `fi(basic)` is not remapped and leads to an include error. - Does not work: - config `--layout us,fi --variant ,basic` - symbols: `pc+us:fi(basic):2+fi(classic):2+inet(evdev)`. `fi(basic)` is not remapped and leads to an include error. I initially thought merging the following rules sets to fix it: 1. `model layout[n] = symbols` 2. `model layout[n] variant[n] = symbols` but it does not work: `*` wildcard does *not* match empty values. There is another issue: using a variant will check and match *both* rules sets. In the first rule set, compat rules are only for deleted symbols files (e.g. `dev`). But when the symbols file exists, we end up with an invalid include statement (see `fi(basic)` examples above). This is because the first rules set has a catch-all rule that will always match, while we want it to match only in the second rules set. Unfortunately such rules cannot be expressed in rules files. So the solution is to append generated compatibility sections in the corresponding symbols files and remove the corresponding current rules. Section name clashes are checked and will raise an error. E.g.: currently we append the following to `symbols/de`: partial xkb_symbols "lld" { include "it(lldde)" }; If we already had a section named lld, this would produce the following error: Cannot add compatibility section in symbols/de: "lld" already exists Also: - Move symbols handling in meson into the symbols subfolder. - Sort compat layout rules. - We ensure that rules with variant take priority over rules without one. Part-of: <https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/-/merge_requests/728>
2024-07-19rules: Fix compat mappingsPierre Le Marre1-1/+0
Previously the compatibility rules where incorrect: - Lines with a comment starting by “//” where parsed incorrectly, because comments where in fact not supported. - `variantsMapping.lst` was added to rules without variant. This resulted in incorrect rules with MLVO = (model, layout), e.g. the beautiful following rules: ``` ! model layout = symbols * mao(nz(mao)) = pc+//(Delete) * ben(basic) = pc+in(ben) ``` Fixed the issue and ensure to raise an error if expectation on layout variant is broken.
2024-06-13Require Python >=3.9 + optional strenum fallbackPierre Le Marre1-4/+9
Fallback with package `strenum` is required for Python < 3.11. Part-of: <https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/-/merge_requests/702>
2024-06-11rules: Check required Python versionPierre Le Marre1-0/+9
2024-05-29Rules: fix generation script by not hard-coding rules exceptionsWismill1-3/+3
2024-05-24rules: generate the option->{symbols,compat,types} mappings from our XML filesPeter Hutterer1-11/+34
The vast majority of options are a straightforward foo:bar = +foo(bar) mapping. Instead of maintaining those mappings by hand let's generate the rules file from the files we definitely maintain by hand: the base.xml (and base.extras.xml) files. This also makes it clearer which ones are exceptions and need to be filled in through other means (or ignored because the option does not affect any symbols). The resulting rules file is identical to the previous hand-generated one but it is alphabetically sorted and uses different whitespacing. For merge.py to work we need to also fix the whitespaces in rules/compat/0041-option_symbols.part, otherwise the duplicate header detection won't work.
2024-05-24rules: rename the .part files to be more explicitPeter Hutterer1-31/+31
This makes it immediately readable what maps to what over e.g. ml4_s.part.
2023-11-20meson: use builtin install_symlinkwael1-4/+10
use the builtin `install_symlink` target provided by meson instead of providing on external `ln` and `sh`.
2022-07-07rename three group options, to be distinct from "while-pressed" optionsBenno Schulenberg1-0/+1
In general, options whose name ends in "_switch" do something *while* the relevant key or key combination is being held -- see, for example, grp:menu_switch, lv3:ralt_switch, or lv5:rctrl_switch. The renamed three options, however, set a group when they are pressed, and this group remains set when the relevant key is released. Keep the old names around as aliases, for backward compatibility. Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2022-06-26rules/compat: remove the incomplete and faulty rules for Dvorak layoutsBenno Schulenberg1-1/+0
They are incomplete because, for example, 'setxkbmap dvorak it' will give you the American Dvorak layout, not the Italian one. They are faulty because, for example, 'setxkbmap dvorak ca' fails (because the rules expect the layout to be called "dvorak", not "fr-dvorak"). These rules may have been useful during a transition period of a few years, but now they are just anomalies that distract from the basic format of 'setxkbmap country-code variant-name'. Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2022-06-24rules/compat: delete an alias that should no longer be neededBenno Schulenberg1-1/+0
Eighteen years ago, in commit 1bdb65affc, the inaccurately named option 'shift_toggle' was renamed to the better 'shifts_toggle', and 'shift_toggle' was added as a convenience alias for existing users of the option. For how long should such an alias be kept? Ten years seems more than enough, so it's time to drop this one. Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2021-06-08xml2lst: use dynamic Perl pathIssam E. Maghni1-1/+0
Stop hardcoding the Perl path to /usr/bin/perl. Not all systems have Perl installed to /usr/bin, and some users might have installed Perl to a custom location. Instead, use /usr/bin/env, which performs a $PATH lookup to find the Perl executable.
2021-04-27meson.build: add option to install the legacy xorg symlinksPeter Hutterer1-0/+7
console-setup still relies on the xorg ruleset [1] and there may be other tools out there. Let's provide an equivalent option to our autotools build to install the xorg symlinks. Note that unlike the autotools approach, only the "xorg" symlinks are provided, not the well and truly legacy "xfree86" ones. [1] https://salsa.debian.org/installer-team/console-setup/-/merge_requests/7/ Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-06-19Add support for the meson build systemPeter Hutterer1-0/+174
This produces virtually the same installed tree as the autotools builds with the following exceptions: - rules symlinks is no longer supported. This option is 16y old and likely hasn't been used in the last decade or so - the xkeyboard-config.pc file uses expanded paths now, e.g. xkb_base=/usr/share/X11/xkb vs autotools' xkb_base=${datarootdir}/X11/xkb The values are the same for both so this is not a functional change. - substitutions in the man page are hardcoded since we can't use the m4 XORG_MACROS. This appears to only matter for the miscmansuffix and there only for solaris up to including 11.3. so... meh? - the .mo files differ, but it's hard to say why since they're generated Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>