meson.build revision caa6d561
1project('xkeyboard-config',
2        version: '2.38',
3        license: 'MIT/Expat',
4        meson_version: '>= 0.54.0')
5
6dir_data        = join_paths(get_option('prefix'), get_option('datadir'))
7dir_xkb_base    = join_paths(dir_data, 'X11', 'xkb')
8dir_xkb_rules   = join_paths(dir_xkb_base, 'rules')
9dir_man7        = join_paths(get_option('prefix'), get_option('mandir'), 'man7')
10dir_pkgconfig   = join_paths(dir_data, 'pkgconfig')
11
12i18n = import('i18n')
13
14pkgconfig = import('pkgconfig')
15pkgconfig.generate(
16    filebase: 'xkeyboard-config',
17    name: 'XKeyboardConfig',
18    description: 'X Keyboard configuration data',
19    version: meson.project_version(),
20    variables: [
21        'datadir=@0@'.format(dir_data),
22        'xkb_base=@0@'.format(dir_xkb_base),
23    ],
24    install_dir: dir_pkgconfig,
25    dataonly: true,
26)
27
28# KcGST only need to be installed as-is
29foreach dir: ['compat', 'geometry', 'keycodes', 'symbols', 'types']
30    install_subdir(dir,
31                   exclude_files: ['Makefile.am'],
32                   install_dir: dir_xkb_base)
33endforeach
34
35# Rules are a bit more complicated
36subdir('rules')
37
38# man page
39xsltproc = find_program('xsltproc', required: false)
40if xsltproc.found()
41  man_substs = configuration_data()
42  man_substs.set('xkb_base', dir_xkb_base)
43  # emulating what the macros do for vendorversion, hardcoding the man
44  # suffixes
45  man_substs.set('vendorversion', '"@0@ @1@" "X Version 11"'.format(meson.project_name(), meson.project_version()))
46  xsl = configure_file(input: 'man/man.xsl',
47                       output: 'man.xsl',
48                       configuration: man_substs,
49                       install: false)
50  # evdev_ruleset is set by rules/meson.build
51  manpage = custom_target('man page',
52                          output: 'xkeyboard-config.7',
53                          build_by_default: true,
54                          command: [xsltproc, '-nonet', xsl, evdev_ruleset],
55                          capture: true,
56                          install:true,
57                          install_dir: dir_man7)
58
59endif
60
61subdir('po')
62