File: meson.build

package info (click to toggle)
parlatype 4.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 10,616 kB
  • sloc: ansic: 14,504; xml: 160; python: 134; sh: 37; makefile: 28
file content (92 lines) | stat: -rw-r--r-- 2,811 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
85
86
87
88
89
90
91
92
project('parlatype', 'c',
        version: '4.3',
        meson_version: '>= 0.60.0',
        license: 'GPL3+',
        default_options: [ 'warning_level=2', 'werror=false', 'c_std=gnu11', ],
)

app_id = 'xyz.parlatype.Parlatype'
version = meson.project_version()

with_pocketsphinx_legacy = get_option('pocketsphinx-legacy')
with_pocketsphinx = get_option('pocketsphinx')
with_asr = with_pocketsphinx_legacy or with_pocketsphinx
if with_pocketsphinx_legacy and with_pocketsphinx
  error('Options pocketsphinx-legacy and pocketsphinx can’t be used together')
endif

prefix     = get_option('prefix')
bindir     = join_paths(prefix, get_option('bindir'))
libdir     = join_paths(prefix, get_option('libdir'))
datadir    = join_paths(prefix, get_option('datadir'))
pkgdatadir = join_paths(datadir, meson.project_name())
localedir  = join_paths(prefix, get_option('localedir'))

compiler = meson.get_compiler('c')

add_project_arguments('-DLOCALEDIR="@0@"'.format(localedir),
                      '-Wno-cast-function-type',
                      '-Wno-missing-field-initializers',
                      '-Wno-unused-parameter',
                      '-Wswitch-default',
                       language: 'c')

gettext_package = 'parlatype'

conf = configuration_data()
conf.set_quoted('PACKAGE_VERSION', '@VCS_TAG@')
conf.set_quoted('PACKAGE_NAME', meson.project_name())
conf.set_quoted('PACKAGE_URL', 'https://www.parlatype.xyz')
conf.set_quoted('APP_ID', app_id)
conf.set_quoted('ASR_DIR', join_paths(datadir, meson.project_name(), 'asr'))
conf.set('HAVE_ASR', with_asr)
conf_input = configure_file(output: 'config.h.in', configuration: conf)
conf_inc = include_directories('.', 'libparlatype/src', 'src')

config_h = declare_dependency(
  sources: vcs_tag(
    command: [ 'git', 'describe', '--tags' ],
    input: conf_input,
    output: 'config.h',
  )
)

gnome   = import('gnome')
i18n    = import('i18n')

# Checks for libraries.
gtk        = dependency('gtk4',         version: '>= 4.14')
glib       = dependency('glib-2.0',     version: '>= 2.76')
libadwaita = dependency('libadwaita-1', version: '>= 1.5')

# tools are not shipped in tarball, check if directory exists
fs = import('fs')
build_tools = fs.is_dir('tools')

subdir('libparlatype')
subdir('data')
subdir('docs')
subdir('help')
subdir('po')
subdir('src')

if build_tools
  subdir('tools')
endif


summary('prefix', prefix, section: 'Directories')
if (prefix != '/usr')
  summary(
    'Run command',
    'LD_LIBRARY_PATH=@0@ XDG_DATA_DIRS=$XDG_DATA_DIRS:@1@ @2@/parlatype'.format(libdir, datadir, bindir),
    section: 'Directories')
endif

summary({
  'gtk-doc'            : gtk_doc,
  'gir'                : gir,
  'pocketsphinx-legacy': with_pocketsphinx_legacy,
  'pocketsphinx'       : with_pocketsphinx,
  }, section: 'Configuration',
)