summaryrefslogtreecommitdiff
path: root/rules/compat
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2019-09-04 12:37:04 +1000
committerSergey Udaltsov <sergey.udaltsov@gmail.com>2020-06-19 21:46:51 +0000
commit7095744237eeb7eccfd72d9958191d990587f1d5 (patch)
tree80b3d7cce6b2487fae6cdd8c4bdcc2621f1c8929 /rules/compat
parent3e39f931e39a81870f966f8e9fe24e1dd447e51b (diff)
downloadxkeyboard-config-7095744237eeb7eccfd72d9958191d990587f1d5.tar.gz
Add support for the meson build system
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>
Diffstat (limited to 'rules/compat')
-rwxr-xr-xrules/compat/map-variants.py7
-rw-r--r--rules/compat/meson.build84
2 files changed, 90 insertions, 1 deletions
diff --git a/rules/compat/map-variants.py b/rules/compat/map-variants.py
index 2162d65..92d3a80 100755
--- a/rules/compat/map-variants.py
+++ b/rules/compat/map-variants.py
@@ -2,6 +2,7 @@
import argparse
import re
+import sys
class Layout(object):
@@ -132,5 +133,9 @@ if __name__ == '__main__':
parser.add_argument('files', nargs='+', type=str)
ns = parser.parse_args()
- with open(ns.dest, 'w') as fd:
+ dest = None
+ if ns.dest == '-':
+ dest = sys.stdout
+
+ with dest or open(ns.dest, 'w') as fd:
map_variant(fd, ns.files, ns.want, ns.number)
diff --git a/rules/compat/meson.build b/rules/compat/meson.build
new file mode 100644
index 0000000..8510a3e
--- /dev/null
+++ b/rules/compat/meson.build
@@ -0,0 +1,84 @@
+# generated files
+rules_compat_generated = []
+
+layout_mappings = files('layoutsMapping.lst')
+variant_mappings = files('variantsMapping.lst')
+map_variants_py = find_program('map-variants.py')
+
+ml_s_file = 'base.ml_s.part'
+ml_s = custom_target(ml_s_file,
+ build_by_default: true,
+ command: [
+ map_variants_py,
+ '--want=mls',
+ '@OUTPUT@',
+ layout_mappings,
+ variant_mappings,
+ ],
+ output: ml_s_file,
+ install: false)
+rules_compat_generated += [ml_s]
+
+# base.mlv_s.part and friends
+mlv_s_file = 'base.mlv_s.part'
+mlv_s = custom_target(mlv_s_file,
+ build_by_default: true,
+ command: [
+ map_variants_py,
+ '--want=mlvs',
+ '@OUTPUT@',
+ variant_mappings,
+ ],
+ output: mlv_s_file,
+ install: false)
+rules_compat_generated += [mlv_s]
+
+foreach lvl: [1, 2, 3, 4]
+ # base.ml1_s.part and friends
+ ml_s_file = 'base.ml@0@_s.part'.format(lvl)
+ ml_s = custom_target(ml_s_file,
+ build_by_default: true,
+ command: [
+ map_variants_py,
+ '--want=mls',
+ '--number=@0@'.format(lvl),
+ '@OUTPUT@',
+ layout_mappings,
+ variant_mappings,
+ ],
+ output: ml_s_file,
+ install: false)
+ rules_compat_generated += [ml_s]
+
+ # base.ml1v1_s.part and friends
+ mlv_s_file = 'base.ml@0@v@0@_s.part'.format(lvl)
+ mlv_s = custom_target(mlv_s_file,
+ build_by_default: true,
+ command: [
+ map_variants_py,
+ '--want=mlvs',
+ '--number=@0@'.format(lvl),
+ '@OUTPUT@',
+ variant_mappings,
+ ],
+ output: mlv_s_file,
+ install: false)
+ rules_compat_generated += [mlv_s]
+endforeach
+
+# Non-generated files
+others = [
+ 'base.lists.part',
+ 'base.lv_c.part',
+ 'base.l1v1_c.part',
+ 'base.l2v2_c.part',
+ 'base.l3v3_c.part',
+ 'base.l4v4_c.part',
+ 'base.o_s.part',
+]
+foreach o: others
+ configure_file(output: o,
+ input: o,
+ copy: true,
+ install: false)
+endforeach