summaryrefslogtreecommitdiff
path: root/meson.build
blob: 71002be719199db1f0b531b10a1d90abd869cd1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
project('xkeyboard-config',
        version: '2.31.99', # change version in configure.ac as well
        license: 'MIT/Expat',
        meson_version: '>= 0.54.0')

dir_data        = join_paths(get_option('prefix'), get_option('datadir'))
dir_xkb_base    = join_paths(dir_data, 'X11', 'xkb')
dir_xkb_rules   = join_paths(dir_xkb_base, 'rules')
dir_man7        = join_paths(get_option('prefix'), get_option('mandir'), 'man7')
dir_pkgconfig   = join_paths(dir_data, 'pkgconfig')

i18n = import('i18n')

pkgconfig = import('pkgconfig')
pkgconfig.generate(
    filebase: 'xkeyboard-config',
    name: 'XKeyboardConfig',
    description: 'X Keyboard configuration data',
    version: meson.project_version(),
    variables: [
        'datadir=@0@'.format(dir_data),
        'xkb_base=@0@'.format(dir_xkb_base),
    ],
    install_dir: dir_pkgconfig,
    dataonly: true,
)

# KcGST only need to be installed as-is
foreach dir: ['compat', 'geometry', 'keycodes', 'symbols', 'types']
    install_subdir(dir,
                   exclude_files: ['Makefile.am'],
                   install_dir: dir_xkb_base)
endforeach

# Rules are a bit more complicated
subdir('rules')

# man page
xsltproc = find_program('xsltproc', required: false)
if xsltproc.found()
  man_substs = configuration_data()
  man_substs.set('xkb_base', dir_xkb_base)
  # emulating what the macros do for vendorversion, hardcoding the man
  # suffixes
  man_substs.set('vendorversion', '"@0@ @1@" "X Version 11"'.format(meson.project_name(), meson.project_version()))
  man_substs.set('appmansuffix', '1')
  man_substs.set('miscmansuffix', '7')
  xsl = configure_file(input: 'man/man.xsl',
                       output: 'man.xsl',
                       configuration: man_substs,
                       install: false)
  # evdev_ruleset is set by rules/meson.build
  manpage = custom_target('man page',
                          output: 'xkeyboard-config.7',
                          build_by_default: true,
                          command: [xsltproc, '-nonet', xsl, evdev_ruleset],
                          capture: true,
                          install:true,
                          install_dir: dir_man7)

endif

subdir('po')