File: meson.build

package info (click to toggle)
wlogout 1.2.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 780 kB
  • sloc: ansic: 1,064; sh: 60; makefile: 7
file content (84 lines) | stat: -rw-r--r-- 2,244 bytes parent folder | download
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
project(
  'wlogout',
  'c',
  version: '1.2.2',
  license: 'MIT',
  default_options:
  [
    'c_std=c11',
    'werror=true'
  ]
)

add_project_arguments(
  [
    '-Wno-unused-parameter',
    '-Wno-unused-result',
    '-Wno-missing-braces'
  ],
  language: 'c'
)

# Set version in config.h
conf_data = configuration_data()
conf_data.set('PROJECT_VERSION', '"@0@"'.format(meson.project_version()))
configure_file(output: 'config.h', configuration: conf_data)

datadir = get_option('datadir')
sysconfdir = get_option('sysconfdir')

# Build man pages
scdoc = dependency('scdoc', native: true, required: get_option('man-pages'))
if scdoc.found()
  scdoc_prog = find_program(scdoc.get_pkgconfig_variable('scdoc'), native: true)
  sh = find_program('sh', native: true)
  mandir = get_option('mandir')
  man_files = [
            'man/wlogout.1.scd',
            'man/wlogout.5.scd'
  ]
  foreach filename : man_files
    topic = filename.split('.')[-3].split('/')[-1]
    section = filename.split('.')[-2]
    output = '@0@.@1@'.format(topic, section)

    custom_target(
      output,
      input: filename,
      output: output,
      command: [
        sh, '-c', '@0@ < @INPUT@ > @1@'.format(scdoc_prog.path(), output)
      ],
      install: true,
      install_dir: '@0@/man@1@'.format(mandir, section)
    )
  endforeach
endif

if get_option('bash-completions')
  bashdir = datadir + '/bash-completion/completions'
  install_data('completions/wlogout.bash', install_dir: bashdir)
endif

if get_option('fish-completions')
  fishdir = datadir + '/fish/completions'
  install_data('completions/wlogout.fish', install_dir: fishdir)
endif

if get_option('zsh-completions')
  zshdir = datadir + '/zsh/site-functions'
  install_data('completions/_wlogout', install_dir: zshdir)
endif

gtk = dependency('gtk+-wayland-3.0')
layershell = dependency('gtk-layer-shell-0', required : false)

if layershell.found()
  add_project_arguments('-DLAYERSHELL=1', language : 'c')
endif

install_subdir('assets', install_dir : datadir / 'wlogout')
install_subdir('icons', install_dir : datadir / 'wlogout')
install_data(['layout', 'style.css'], install_dir : sysconfdir / 'wlogout')

executable('wlogout', 'main.c', dependencies : [gtk, layershell], install : true)