forked from jaos/gslapt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
meson.build
113 lines (105 loc) · 4.01 KB
/
meson.build
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
project('gslapt', 'c',
version: '0.5.9',
license: 'GPLv2',
meson_version: '>= 0.56',
default_options: [
'buildtype=debugoptimized',
'b_lto=true',
'warning_level=2',
],
)
package = meson.project_name()
version = meson.project_version()
i18n = import('i18n')
# paths
prefix = get_option('prefix')
localedir = join_paths(prefix, get_option('localedir'))
datadir = join_paths(prefix, get_option('datadir'))
pkgdatadir = join_paths(datadir, package)
pixmapsdir = join_paths(datadir, 'pixmaps')
polkitactiondir = join_paths(datadir, 'polkit-1', 'actions') # default, let pkg-config tell us the truth
docdatadir = join_paths(datadir, 'doc', package)
sbindir = join_paths(get_option('prefix'), get_option('sbindir'))
bindir = join_paths(get_option('prefix'), get_option('bindir'))
configuration = configuration_data()
configuration.set_quoted('PACKAGE', package)
configuration.set_quoted('GETTEXT_PACKAGE', package)
configuration.set_quoted('PACKAGE_DATA_DIR', datadir)
configuration.set_quoted('PACKAGE_LOCALE_DIR', localedir)
configuration.set_quoted('VERSION', version)
configuration.set('sbindir', sbindir)
configuration.set('bindir', bindir)
configuration.set('datadir', datadir)
configuration.set('privprog', '')
# compiler based checks
libcurl = dependency('libcurl')
zlib = dependency('zlib')
openssl = dependency('openssl')
libgpgme = dependency('gpgme', required: false)
cc = meson.get_compiler('c')
libm = cc.find_library('m')
# libslapt = dependency('libslapt', version: '>=0.11.3') # use this when we have a few pkg-config enabled releases out
libslapt = cc.find_library('slapt', has_headers: ['slapt.h'])
if libslapt.found()
# if libgpgme.found() and cc.has_function('slapt_add_pkg_source_gpg_key', dependencies: [libslapt])
if libgpgme.found() and cc.has_function('slapt_add_pkg_source_gpg_key', dependencies: [libcurl, zlib, openssl, libgpgme, libslapt])
configuration.set('SLAPT_HAS_GPGME', 1)
endif
endif
# Gtk makes this hard
#cflags = ['-Wno-cast-function-type']
#add_project_arguments(cc.get_supported_arguments(cflags), language: 'c')
# polkit
polkit_dep = dependency('polkit-gobject-1', required: false)
if polkit_dep.found()
polkitactiondir = polkit_dep.get_variable(pkgconfig: 'actiondir')#, define_variable: ['prefix', prefix])
endif
pkexec = find_program('pkexec', required: false)
if pkexec.found()
configuration.set('privprog', pkexec.full_path() + ' ')
custom_target('org.jaos.gslapt.policy',
input: configure_file(output: 'org.jaos.gslapt.policy.pre', input: 'org.jaos.gslapt.policy.in', configuration: configuration),
output: 'org.jaos.gslapt.policy',
command: ['intltool-merge', join_paths(meson.project_source_root(), 'po'), '-x', '-u', '@INPUT@', '@OUTPUT@'],
install: true,
install_dir: polkitactiondir,
)
custom_target('gslapt-polkit',
output: 'gslapt-polkit',
command: [find_program('mkpolkitwrapper.sh'), sbindir, '@OUTPUT@'],
install: true,
install_dir: get_option('bindir'),
)
endif
deps = [libcurl, zlib, openssl, libm, libgpgme, libslapt,
dependency('glib-2.0'),
dependency('gtk+-3.0', version: '>=3.4.0'),
]
i18n.merge_file(
input: configure_file(output: 'gslapt.desktop.pre', input: 'gslapt.desktop.in', configuration: configuration),
output: 'gslapt.desktop',
type: 'desktop',
po_dir: 'po',
install: true,
install_dir: get_option('datadir') / 'applications'
)
i18n.merge_file(
input: configure_file(output: 'gslapt-kde.desktop.pre', input: 'gslapt-kde.desktop.in', configuration: configuration),
output: 'gslapt-kde.desktop',
type: 'desktop',
po_dir: 'po',
install: true,
install_dir: get_option('datadir') / 'applications'
)
install_data('ui/gslapt.png', install_dir: pixmapsdir)
install_data(['AUTHORS', 'ChangeLog', 'COPYING', 'FAQ', 'README'], install_dir: docdatadir)
custom_target('series_map.rc',
input: 'series_map.rc.in',
output: 'series_map.rc',
command: [find_program('seriesmerge.sh'), '@INPUT@', '@OUTPUT@', join_paths(meson.project_source_root())],
install: true,
install_dir: pkgdatadir,
)
subdir('po')
subdir('src')
subdir('ui')