diff options
Diffstat (limited to 'rules')
-rw-r--r-- | rules/0010-lists.part (renamed from rules/0001-lists.part) | 8 | ||||
-rw-r--r-- | rules/0011-modellayoutvariant_symbols.part | 2 | ||||
-rw-r--r-- | rules/0018-modellayout2_symbols.part | 3 | ||||
-rw-r--r-- | rules/0020-base.lists.part (renamed from rules/0002-base.lists.part) | 0 | ||||
-rw-r--r-- | rules/0020-evdev.lists.part (renamed from rules/0002-evdev.lists.part) | 0 | ||||
-rw-r--r-- | rules/0020-modellayout3_symbols.part | 3 | ||||
-rw-r--r-- | rules/0040-base.model_keycodes.part (renamed from rules/0004-base.model_keycodes.part) | 0 | ||||
-rw-r--r-- | rules/0040-evdev.model_keycodes.part (renamed from rules/0004-evdev.model_keycodes.part) | 0 | ||||
-rw-r--r-- | rules/0050-layout1_keycodes.part (renamed from rules/0005-layout1_keycodes.part) | 0 | ||||
-rw-r--r-- | rules/0060-layout_keycodes.part (renamed from rules/0006-layout_keycodes.part) | 0 | ||||
-rw-r--r-- | rules/0070-options_keycodes.part (renamed from rules/0007-options_keycodes.part) | 0 | ||||
-rw-r--r-- | rules/0080-modellayout_geometry.part (renamed from rules/0008-modellayout_geometry.part) | 0 | ||||
-rw-r--r-- | rules/0090-model_geometry.part (renamed from rules/0009-model_geometry.part) | 0 | ||||
-rw-r--r-- | rules/0130-modellayout_symbols.part (renamed from rules/0013-modellayout_symbols.part) | 4 | ||||
-rw-r--r-- | rules/0160-modellayout1_symbols.part (renamed from rules/0016-modellayout1_symbols.part) | 4 | ||||
-rw-r--r-- | rules/0180-modellayout2_symbols.part | 4 | ||||
-rw-r--r-- | rules/0200-modellayout3_symbols.part | 4 | ||||
-rw-r--r-- | rules/0220-modellayout4_symbols.part (renamed from rules/0022-modellayout4_symbols.part) | 1 | ||||
-rw-r--r-- | rules/0260-base.model_symbols.part (renamed from rules/0026-base.model_symbols.part) | 0 | ||||
-rw-r--r-- | rules/0260-evdev.model_symbols.part (renamed from rules/0026-evdev.model_symbols.part) | 0 | ||||
-rw-r--r-- | rules/0270-base.modellayout_symbols1.part (renamed from rules/0027-base.modellayout_symbols1.part) | 0 | ||||
-rw-r--r-- | rules/0270-evdev.modellayout_symbols1.part (renamed from rules/0027-evdev.modellayout_symbols1.part) | 0 | ||||
-rw-r--r-- | rules/0330-modellayout_compat.part (renamed from rules/0033-modellayout_compat.part) | 0 | ||||
-rw-r--r-- | rules/0340-modellayout1_compat.part (renamed from rules/0034-modellayout1_compat.part) | 0 | ||||
-rw-r--r-- | rules/0350-model_types.part (renamed from rules/0035-model_types.part) | 0 | ||||
-rw-r--r-- | rules/0360-layoutoption_symbols.part (renamed from rules/0036-layoutoption_symbols.part) | 0 | ||||
-rw-r--r-- | rules/0370-layout1option_symbols.part (renamed from rules/0037-layout1option_symbols.part) | 0 | ||||
-rw-r--r-- | rules/0380-layout2option_symbols.part (renamed from rules/0038-layout2option_symbols.part) | 0 | ||||
-rw-r--r-- | rules/0390-layout3option_symbols.part (renamed from rules/0039-layout3option_symbols.part) | 0 | ||||
-rw-r--r-- | rules/0400-layout4option_symbols.part (renamed from rules/0040-layout4option_symbols.part) | 0 | ||||
-rw-r--r-- | rules/compat/0280-layoutvariant_compat.part (renamed from rules/compat/0028-layoutvariant_compat.part) | 0 | ||||
-rw-r--r-- | rules/compat/0290-layout1variant1_compat.part (renamed from rules/compat/0029-layout1variant1_compat.part) | 0 | ||||
-rw-r--r-- | rules/compat/0300-layout2variant2_compat.part (renamed from rules/compat/0030-layout2variant2_compat.part) | 0 | ||||
-rw-r--r-- | rules/compat/0310-layout3variant3_compat.part (renamed from rules/compat/0031-layout3variant3_compat.part) | 0 | ||||
-rw-r--r-- | rules/compat/0320-layout4variant4_compat.part (renamed from rules/compat/0032-layout4variant4_compat.part) | 0 | ||||
-rw-r--r-- | rules/compat/0410-option_symbols.part (renamed from rules/compat/0041-option_symbols.part) | 0 | ||||
-rwxr-xr-x | rules/compat/map-variants.py | 66 | ||||
-rw-r--r-- | rules/compat/variantsMapping-vendors.lst | 12 | ||||
-rw-r--r-- | rules/meson.build | 115 |
39 files changed, 154 insertions, 72 deletions
diff --git a/rules/0001-lists.part b/rules/0010-lists.part index d24430c8..2f55b528 100644 --- a/rules/0001-lists.part +++ b/rules/0010-lists.part @@ -24,6 +24,12 @@ ! $macvendorlayouts = ch de dk fi fr gb is it latam nl no pt se us +// Macintosh vendor: country-specific variants +! $mac_ch_variants = de fr nodeadkeys +! $mac_de_variants = nodeadkeys Sundeadkeys sundeadkeys +! $mac_dk_variants = macbookpro nodeadkeys +! $mac_pt_variants = nodeadkeys Sundeadkeys sundeadkeys + // The countries that predominantly have AZERTY or QWERTZ layouts: ! $azerty = be fr ! $qwertz = al ch cz de hr hu ro si sk @@ -43,6 +49,6 @@ ru se sk tr tw ua us ! $sun_var = sun_type6 sun_type6_suncompat sun_type6_de sun_type6_fr \ - sun_type7 sun_type7_suncompat suncompat + sun_type7 sun_type7_suncompat suncompat basic ! $sun_compat = sun_type6 sun_type6_suncompat sun_type7_suncompat suncompat diff --git a/rules/0011-modellayoutvariant_symbols.part b/rules/0011-modellayoutvariant_symbols.part deleted file mode 100644 index 615b8610..00000000 --- a/rules/0011-modellayoutvariant_symbols.part +++ /dev/null @@ -1,2 +0,0 @@ -! model layout variant = symbols - * $sun_custom $sun_var = pc+sun_vndr/%l%(v) diff --git a/rules/0018-modellayout2_symbols.part b/rules/0018-modellayout2_symbols.part deleted file mode 100644 index 293f8481..00000000 --- a/rules/0018-modellayout2_symbols.part +++ /dev/null @@ -1,3 +0,0 @@ -! model layout[2] = symbols - $sun $sun_custom = +sun_vndr/%l[2]%(v[2]):2 - * * = +%l[2]%(v[2]):2 diff --git a/rules/0002-base.lists.part b/rules/0020-base.lists.part index cb661240..cb661240 100644 --- a/rules/0002-base.lists.part +++ b/rules/0020-base.lists.part diff --git a/rules/0002-evdev.lists.part b/rules/0020-evdev.lists.part index 4fa2f756..4fa2f756 100644 --- a/rules/0002-evdev.lists.part +++ b/rules/0020-evdev.lists.part diff --git a/rules/0020-modellayout3_symbols.part b/rules/0020-modellayout3_symbols.part deleted file mode 100644 index 3724f77b..00000000 --- a/rules/0020-modellayout3_symbols.part +++ /dev/null @@ -1,3 +0,0 @@ -! model layout[3] = symbols - $sun $sun_custom = +sun_vndr/%l[3]%(v[3]):3 - * * = +%l[3]%(v[3]):3 diff --git a/rules/0004-base.model_keycodes.part b/rules/0040-base.model_keycodes.part index 81fb3e11..81fb3e11 100644 --- a/rules/0004-base.model_keycodes.part +++ b/rules/0040-base.model_keycodes.part diff --git a/rules/0004-evdev.model_keycodes.part b/rules/0040-evdev.model_keycodes.part index 62c21ffc..62c21ffc 100644 --- a/rules/0004-evdev.model_keycodes.part +++ b/rules/0040-evdev.model_keycodes.part diff --git a/rules/0005-layout1_keycodes.part b/rules/0050-layout1_keycodes.part index 3f2146af..3f2146af 100644 --- a/rules/0005-layout1_keycodes.part +++ b/rules/0050-layout1_keycodes.part diff --git a/rules/0006-layout_keycodes.part b/rules/0060-layout_keycodes.part index a0955177..a0955177 100644 --- a/rules/0006-layout_keycodes.part +++ b/rules/0060-layout_keycodes.part diff --git a/rules/0007-options_keycodes.part b/rules/0070-options_keycodes.part index 0c42cd84..0c42cd84 100644 --- a/rules/0007-options_keycodes.part +++ b/rules/0070-options_keycodes.part diff --git a/rules/0008-modellayout_geometry.part b/rules/0080-modellayout_geometry.part index 14e56d26..14e56d26 100644 --- a/rules/0008-modellayout_geometry.part +++ b/rules/0080-modellayout_geometry.part diff --git a/rules/0009-model_geometry.part b/rules/0090-model_geometry.part index 00cb87ac..00cb87ac 100644 --- a/rules/0009-model_geometry.part +++ b/rules/0090-model_geometry.part diff --git a/rules/0013-modellayout_symbols.part b/rules/0130-modellayout_symbols.part index 5a0fb273..de632b74 100644 --- a/rules/0013-modellayout_symbols.part +++ b/rules/0130-modellayout_symbols.part @@ -7,12 +7,12 @@ * empty = empty(basic) jollasbj $nonlatin = jolla_vndr/sbj(common)+us+%l%(v):2 jollasbj * = jolla_vndr/sbj(common)+%l%(v) - $sun $sun_custom = pc+sun_vndr/%l%(v) + $sun $sun_custom = pc+sun_vndr/%l pc98 jp = nec_vndr/jp(pc98)+nec_vndr/jp(jp):2 pc98 * = nec_vndr/jp(pc98)+%l%(v) applealu_jis jp = macintosh_vndr/apple(alukbd)+macintosh_vndr/jp(usmac)+macintosh_vndr/jp(mac):2 applealu_jis * = macintosh_vndr/apple(alukbd)+%l%(v)+macintosh_vndr/jp(mac):2 - $applealu $macvendorlayouts = macintosh_vndr/apple(alukbd)+macintosh_vndr/%l%(v) + $applealu $macvendorlayouts = macintosh_vndr/apple(alukbd)+macintosh_vndr/%l $applealu * = macintosh_vndr/apple(alukbd)+%l%(v) olpc $olpclayouts = olpc+%l%(m) olpc * = olpc+%l%(v) diff --git a/rules/0016-modellayout1_symbols.part b/rules/0160-modellayout1_symbols.part index db5b62de..12ef599e 100644 --- a/rules/0016-modellayout1_symbols.part +++ b/rules/0160-modellayout1_symbols.part @@ -2,9 +2,9 @@ ataritt * = xfree68_vndr/ataritt(us)+%l[1]%(v[1]) amiga * = xfree68_vndr/amiga(usa1)+%l[1]%(v[1]) jollasbj * = jolla_vndr/sbj(common)+%l[1]%(v[1]) - $sun $sun_custom = pc+sun_vndr/%l[1]%(v[1]) + $sun $sun_custom = pc+sun_vndr/%l[1] applealu_jis us = macintosh_vndr/apple(alukbd)+macintosh_vndr/jp(usmac) - $applealu $macvendorlayouts = macintosh_vndr/apple(alukbd)+macintosh_vndr/%l[1]%(v[1]) + $applealu $macvendorlayouts = macintosh_vndr/apple(alukbd)+macintosh_vndr/%l[1] $applealu * = macintosh_vndr/apple(alukbd)+%l[1]%(v[1]) $thinkpads br = pc+%l[1](thinkpad) * * = pc+%l[1]%(v[1]) diff --git a/rules/0180-modellayout2_symbols.part b/rules/0180-modellayout2_symbols.part new file mode 100644 index 00000000..666d8423 --- /dev/null +++ b/rules/0180-modellayout2_symbols.part @@ -0,0 +1,4 @@ +! model layout[2] = symbols + $applealu $macvendorlayouts = +macintosh_vndr/%l[2]:2 + $sun $sun_custom = +sun_vndr/%l[2]:2 + * * = +%l[2]%(v[2]):2 diff --git a/rules/0200-modellayout3_symbols.part b/rules/0200-modellayout3_symbols.part new file mode 100644 index 00000000..44ecb443 --- /dev/null +++ b/rules/0200-modellayout3_symbols.part @@ -0,0 +1,4 @@ +! model layout[3] = symbols + $applealu $macvendorlayouts = +macintosh_vndr/%l[3]:3 + $sun $sun_custom = +sun_vndr/%l[3]:3 + * * = +%l[3]%(v[3]):3 diff --git a/rules/0022-modellayout4_symbols.part b/rules/0220-modellayout4_symbols.part index cb83ed50..7b094053 100644 --- a/rules/0022-modellayout4_symbols.part +++ b/rules/0220-modellayout4_symbols.part @@ -1,3 +1,4 @@ ! model layout[4] = symbols + $applealu $macvendorlayouts = +macintosh_vndr/%l[4]:4 $sun $sun_custom = +sun_vndr/%l[4]%(v[4]):4 * * = +%l[4]%(v[4]):4 diff --git a/rules/0026-base.model_symbols.part b/rules/0260-base.model_symbols.part index c8e481a2..c8e481a2 100644 --- a/rules/0026-base.model_symbols.part +++ b/rules/0260-base.model_symbols.part diff --git a/rules/0026-evdev.model_symbols.part b/rules/0260-evdev.model_symbols.part index c40a90fb..c40a90fb 100644 --- a/rules/0026-evdev.model_symbols.part +++ b/rules/0260-evdev.model_symbols.part diff --git a/rules/0027-base.modellayout_symbols1.part b/rules/0270-base.modellayout_symbols1.part index 55bac5fd..55bac5fd 100644 --- a/rules/0027-base.modellayout_symbols1.part +++ b/rules/0270-base.modellayout_symbols1.part diff --git a/rules/0027-evdev.modellayout_symbols1.part b/rules/0270-evdev.modellayout_symbols1.part index 8ff2163a..8ff2163a 100644 --- a/rules/0027-evdev.modellayout_symbols1.part +++ b/rules/0270-evdev.modellayout_symbols1.part diff --git a/rules/0033-modellayout_compat.part b/rules/0330-modellayout_compat.part index db702358..db702358 100644 --- a/rules/0033-modellayout_compat.part +++ b/rules/0330-modellayout_compat.part diff --git a/rules/0034-modellayout1_compat.part b/rules/0340-modellayout1_compat.part index 874e4e34..874e4e34 100644 --- a/rules/0034-modellayout1_compat.part +++ b/rules/0340-modellayout1_compat.part diff --git a/rules/0035-model_types.part b/rules/0350-model_types.part index f1f97ec4..f1f97ec4 100644 --- a/rules/0035-model_types.part +++ b/rules/0350-model_types.part diff --git a/rules/0036-layoutoption_symbols.part b/rules/0360-layoutoption_symbols.part index 9420fbd7..9420fbd7 100644 --- a/rules/0036-layoutoption_symbols.part +++ b/rules/0360-layoutoption_symbols.part diff --git a/rules/0037-layout1option_symbols.part b/rules/0370-layout1option_symbols.part index 2ad0fc30..2ad0fc30 100644 --- a/rules/0037-layout1option_symbols.part +++ b/rules/0370-layout1option_symbols.part diff --git a/rules/0038-layout2option_symbols.part b/rules/0380-layout2option_symbols.part index fefccda6..fefccda6 100644 --- a/rules/0038-layout2option_symbols.part +++ b/rules/0380-layout2option_symbols.part diff --git a/rules/0039-layout3option_symbols.part b/rules/0390-layout3option_symbols.part index 5d8e97a8..5d8e97a8 100644 --- a/rules/0039-layout3option_symbols.part +++ b/rules/0390-layout3option_symbols.part diff --git a/rules/0040-layout4option_symbols.part b/rules/0400-layout4option_symbols.part index 07d40908..07d40908 100644 --- a/rules/0040-layout4option_symbols.part +++ b/rules/0400-layout4option_symbols.part diff --git a/rules/compat/0028-layoutvariant_compat.part b/rules/compat/0280-layoutvariant_compat.part index faf94a52..faf94a52 100644 --- a/rules/compat/0028-layoutvariant_compat.part +++ b/rules/compat/0280-layoutvariant_compat.part diff --git a/rules/compat/0029-layout1variant1_compat.part b/rules/compat/0290-layout1variant1_compat.part index c19d0bc2..c19d0bc2 100644 --- a/rules/compat/0029-layout1variant1_compat.part +++ b/rules/compat/0290-layout1variant1_compat.part diff --git a/rules/compat/0030-layout2variant2_compat.part b/rules/compat/0300-layout2variant2_compat.part index 88589075..88589075 100644 --- a/rules/compat/0030-layout2variant2_compat.part +++ b/rules/compat/0300-layout2variant2_compat.part diff --git a/rules/compat/0031-layout3variant3_compat.part b/rules/compat/0310-layout3variant3_compat.part index 051cd3b9..051cd3b9 100644 --- a/rules/compat/0031-layout3variant3_compat.part +++ b/rules/compat/0310-layout3variant3_compat.part diff --git a/rules/compat/0032-layout4variant4_compat.part b/rules/compat/0320-layout4variant4_compat.part index 1fc7fbc8..1fc7fbc8 100644 --- a/rules/compat/0032-layout4variant4_compat.part +++ b/rules/compat/0320-layout4variant4_compat.part diff --git a/rules/compat/0041-option_symbols.part b/rules/compat/0410-option_symbols.part index 088a5236..088a5236 100644 --- a/rules/compat/0041-option_symbols.part +++ b/rules/compat/0410-option_symbols.part diff --git a/rules/compat/map-variants.py b/rules/compat/map-variants.py index dd24882b..6d383f1d 100755 --- a/rules/compat/map-variants.py +++ b/rules/compat/map-variants.py @@ -31,15 +31,19 @@ class Layout: layout: str variant: str + model: str + symbols_prefix: str @classmethod - def parse(cls, layout: str, variant: str = ""): + def parse( + cls, layout: str, variant: str = "", model: str = "*", symbols_prefix: str = "" + ): # parse a layout(variant) string if match := cls.PATTERN.match(layout): - assert not variant + assert not variant, variant layout = match.group("layout") variant = match.group("variant") - return cls(layout, variant) + return cls(layout, variant, model, symbols_prefix) def __str__(self): if self.variant: @@ -53,6 +57,15 @@ class Layout: """ if not isinstance(other, self.__class__): return NotImplemented + elif self.model != other.model: + if (self.model == "*") ^ (other.model == "*"): + return other.model == "*" + else: + return self.model < other.model + elif (self.layout == "*") ^ (other.layout == "*"): + return other.layout == "*" + elif self.layout.startswith("$") ^ other.layout.startswith("$"): + return other.layout.startswith("$") elif self.layout == other.layout: if self.variant == other.variant: return False @@ -68,7 +81,9 @@ class Layout: return self.layout < other.layout @classmethod - def read_file(cls, path: str) -> Generator[tuple[Layout, Layout], None, None]: + def read_file( + cls, path: str, vendor: bool = False + ) -> Generator[tuple[Layout, Layout], None, None]: """Returns a list of two-layout tuples [(layout1, layout2), ...]""" with open(path, "rt", encoding="utf-8") as fd: @@ -78,7 +93,12 @@ class Layout: # Split on whitespaces groups = tuple(line.split()) length = len(groups) - if length == 2: + if vendor: + if length != 4: + raise ValueError(f"Invalid line: {line}") + l1 = Layout.parse(groups[2], model=groups[0]) + l2 = Layout.parse(groups[3], symbols_prefix=groups[1]) + elif length == 2: l1 = Layout.parse(groups[0]) l2 = Layout.parse(groups[1]) elif length == 4: @@ -95,6 +115,7 @@ def write_rules( number: int, expect_variant: bool, write_header: bool, + vendor: bool, ): index = f"[{number}]" if number > 0 else "" if write_header: @@ -108,7 +129,6 @@ def write_rules( # pc+layout(variant) # This part is only executed for the variantMappings.lst - base = "pc" if number <= 1 else "" suffix = "" if number <= 1 else ":{}".format(number) for l1, l2 in mappings: @@ -120,9 +140,15 @@ def write_rules( second_layout = l2.layout else: second_layout = str(l2) if l2.variant else f"{l2.layout}%(v{index})" + second_layout = second_layout.replace("[%i]", index) + if number <= 1: + base = l2.symbols_prefix or "pc" + else: + base = "" + model = l1.model if l1.model != "*" else "*\t" dest.write( - " * {}{} = {}+{}{}\n".format( - l1.layout, variant, base, second_layout, suffix + " {} {}{} = {}+{}{}\n".format( + model, l1.layout, variant, base, second_layout, suffix ) ) @@ -198,12 +224,25 @@ def check_mapping(symbols: bool, mapping: tuple[Layout, Layout]) -> bool: def run( - dest: str, files, dry_run: bool, symbols: bool, expect_variant: bool, number: int + dest: str, + files, + dry_run: bool, + vendor: bool, + symbols: bool, + expect_variant: bool, + number: int, ): - check = functools.partial(check_mapping, symbols) + # FIXME + if vendor: + + def check(_): + return True + else: + check = functools.partial(check_mapping, symbols) # Read all files and sort their entry on the aliased layout + parse_file = functools.partial(Layout.read_file, vendor=vendor) mappings = sorted( - filter(check, itertools.chain.from_iterable(map(Layout.read_file, files))), + filter(check, itertools.chain.from_iterable(map(parse_file, files))), key=lambda ls: ls[0], ) if symbols: @@ -213,7 +252,7 @@ def run( if dest == "-": fd = sys.stdout with fd or open(ns.dest, "w") as fd: - write_rules(fd, mappings, number, expect_variant, True) + write_rules(fd, mappings, number, expect_variant, True, vendor) if __name__ == "__main__": @@ -222,9 +261,10 @@ if __name__ == "__main__": parser.add_argument("--dry-run", action="store_true") parser.add_argument("--has-variant", action="store_true") parser.add_argument("--symbols", action="store_true", help="Write symbols files") + parser.add_argument("--vendor", action="store_true", help="Parse vendor files") parser.add_argument("dest", type=str) parser.add_argument("files", nargs="+", type=str) ns = parser.parse_args() - run(ns.dest, ns.files, ns.dry_run, ns.symbols, ns.has_variant, ns.number) + run(ns.dest, ns.files, ns.dry_run, ns.vendor, ns.symbols, ns.has_variant, ns.number) diff --git a/rules/compat/variantsMapping-vendors.lst b/rules/compat/variantsMapping-vendors.lst new file mode 100644 index 00000000..f3eb2478 --- /dev/null +++ b/rules/compat/variantsMapping-vendors.lst @@ -0,0 +1,12 @@ +$applealu macintosh_vndr/apple(alukbd) ch($mac_ch_variants) macintosh_vndr/%l[%i]%(v[%i]) +$applealu macintosh_vndr/apple(alukbd) de($mac_de_variants) macintosh_vndr/%l[%i]%(v[%i]) +$applealu macintosh_vndr/apple(alukbd) dk($mac_dk_variants) macintosh_vndr/%l[%i]%(v[%i]) +$applealu macintosh_vndr/apple(alukbd) fi(nodeadkeys) macintosh_vndr/%l[%i]%(v[%i]) +$applealu macintosh_vndr/apple(alukbd) is(nodeadkeys) macintosh_vndr/%l[%i]%(v[%i]) +$applealu macintosh_vndr/apple(alukbd) jp(mac) macintosh_vndr/%l[%i]%(v[%i]) +$applealu macintosh_vndr/apple(alukbd) no(nodeadkeys) macintosh_vndr/%l[%i]%(v[%i]) +$applealu macintosh_vndr/apple(alukbd) pt($mac_pt_variants) macintosh_vndr/%l[%i]%(v[%i]) +$applealu macintosh_vndr/apple(alukbd) se(nodeadkeys) macintosh_vndr/%l[%i]%(v[%i]) +$applealu macintosh_vndr/apple(alukbd) $macvendorlayouts(*) %l[%i]%(v[%i]) +$sun pc $sun_custom($sun_var) sun_vndr/%l[%i]%(v[%i]) +$sun pc $sun_custom(*) %l[%i]%(v[%i]) diff --git a/rules/meson.build b/rules/meson.build index 6144618a..8dc964e5 100644 --- a/rules/meson.build +++ b/rules/meson.build @@ -9,42 +9,41 @@ base_extras_xml = files('base.extras.xml') # specific order parts = [ '0000-hdr.part', - '0001-lists.part', - '0002-@0@.lists.part', - '0004-@0@.model_keycodes.part', - '0005-layout1_keycodes.part', - '0006-layout_keycodes.part', - '0007-options_keycodes.part', - '0008-modellayout_geometry.part', - '0009-model_geometry.part', - '0011-modellayoutvariant_symbols.part', - '0013-modellayout_symbols.part', - '0016-modellayout1_symbols.part', - '0018-modellayout2_symbols.part', - '0020-modellayout3_symbols.part', - '0022-modellayout4_symbols.part', - '0026-@0@.model_symbols.part', - '0027-@0@.modellayout_symbols1.part', - '0033-modellayout_compat.part', - '0034-modellayout1_compat.part', - '0035-model_types.part', - '0036-layoutoption_symbols.part', - '0037-layout1option_symbols.part', - '0038-layout2option_symbols.part', - '0039-layout3option_symbols.part', - '0040-layout4option_symbols.part', - # 0042-option_symbols.part is generated from base{.extras}.xml - # 0043-option_compat.part is generated from base{.extras}.xml - # 0044-option_types.part is generated from base{.extras}.xml + '0010-lists.part', + '0020-@0@.lists.part', + '0040-@0@.model_keycodes.part', + '0050-layout1_keycodes.part', + '0060-layout_keycodes.part', + '0070-options_keycodes.part', + '0080-modellayout_geometry.part', + '0090-model_geometry.part', + '0130-modellayout_symbols.part', + '0160-modellayout1_symbols.part', + '0180-modellayout2_symbols.part', + '0200-modellayout3_symbols.part', + '0220-modellayout4_symbols.part', + '0260-@0@.model_symbols.part', + '0270-@0@.modellayout_symbols1.part', + '0330-modellayout_compat.part', + '0340-modellayout1_compat.part', + '0350-model_types.part', + '0360-layoutoption_symbols.part', + '0370-layout1option_symbols.part', + '0380-layout2option_symbols.part', + '0390-layout3option_symbols.part', + '0400-layout4option_symbols.part', + # 0420-option_symbols.part is generated from base{.extras}.xml + # 0430-option_compat.part is generated from base{.extras}.xml + # 0440-option_types.part is generated from base{.extras}.xml ] rules_parts_generated = [] generate_rules_options_symbols = find_program('generate-options-symbols.py') generated = [ - ['0042-option_symbols.part', 'symbols'], - ['0043-option_compat.part', 'compatibility'], - ['0044-option_types.part', 'types'], + ['0420-option_symbols.part', 'symbols'], + ['0430-option_compat.part', 'compatibility'], + ['0440-option_types.part', 'types'], ] foreach g: generated filename = g[0] @@ -64,34 +63,43 @@ endforeach if get_option('compat-rules') # non-generated compat parts parts += [ - 'compat/0028-layoutvariant_compat.part', - 'compat/0029-layout1variant1_compat.part', - 'compat/0030-layout2variant2_compat.part', - 'compat/0031-layout3variant3_compat.part', - 'compat/0032-layout4variant4_compat.part', - 'compat/0041-option_symbols.part', + 'compat/0280-layoutvariant_compat.part', + 'compat/0290-layout1variant1_compat.part', + 'compat/0300-layout2variant2_compat.part', + 'compat/0310-layout3variant3_compat.part', + 'compat/0320-layout4variant4_compat.part', + 'compat/0410-option_symbols.part', ] layout_mappings = files('compat/layoutsMapping.lst') variant_mappings = files('compat/variantsMapping.lst') + vendors_variant_mappings = files('compat/variantsMapping-vendors.lst') map_variants_py = find_program('compat/map-variants.py') # two sets of files are generated: ml_s.part and mlv_s.part # each with the level name in the filename lvl_ml_s = { - '0': '0012-ml_s.part', - '1': '0015-ml1_s.part', - '2': '0017-ml2_s.part', - '3': '0019-ml3_s.part', - '4': '0021-ml4_s.part', + '0': '0120-ml_s.part', + '1': '0150-ml1_s.part', + '2': '0170-ml2_s.part', + '3': '0190-ml3_s.part', + '4': '0210-ml4_s.part', } lvl_mlv_s = { - '0': '0010-mlv_s.part', - '1': '0014-ml1v1_s.part', - '2': '0023-ml2v2_s.part', - '3': '0024-ml3v3_s.part', - '4': '0025-ml4v4_s.part', + '0': '0100-mlv_s.part', + '1': '0140-ml1v1_s.part', + '2': '0230-ml2v2_s.part', + '3': '0240-ml3v3_s.part', + '4': '0250-ml4v4_s.part', + } + + lvl_mlv_s_vendors = { + '0': '0111-mlv_s.part', + '1': '0141-ml1v1_s.part', + '2': '0231-ml2v2_s.part', + '3': '0241-ml3v3_s.part', + '4': '0251-ml4v4_s.part', } foreach lvl: [0, 1, 2, 3, 4] @@ -121,6 +129,21 @@ if get_option('compat-rules') output: mlv_s_file, install: false) rules_parts_generated += [mlv_s] + + mlv_s_file = lvl_mlv_s_vendors['@0@'.format(lvl)] + mlv_s = custom_target(mlv_s_file, + build_by_default: true, + command: [ + map_variants_py, + '--has-variant', + '--number=@0@'.format(lvl), + '--vendor', + '@OUTPUT@', + vendors_variant_mappings, + ], + output: mlv_s_file, + install: false) + rules_parts_generated += [mlv_s] endforeach endif # compat-rules |