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 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153
|
add_languages('cpp', native: false)
cpp_compiler = meson.get_compiler('cpp')
gstreamer_dep = dependency('gstreamer-1.0')
gstreamer_base_dep = dependency('gstreamer-base-1.0')
gstreamer_plugins_base_dep = dependency('gstreamer-plugins-base-1.0')
appstream_dep = dependency('appstream', version: '>=0.16.0')
apt_pkg_dep = dependency('apt-pkg', version: '>=1.9.2')
# Check whether apt supports ddtp
ddtp_flag = []
if cpp_compiler.compiles(
'''
#include <apt-pkg/pkgcache.h>
int main () {
pkgCache::DescIterator d;
return 0;
}
''',
dependencies: [
apt_pkg_dep
]
)
ddtp_flag = ['-DHAVE_DDTP']
endif
c_args = ['-DG_LOG_DOMAIN="PackageKit-APT"',
'-DDATADIR="@0@"'.format(join_paths(get_option('prefix'), get_option('datadir'))),
]
# Required to be used by the test suite
packagekit_backend_apt_lib = static_library(
'pk_backend_apt_lib',
'acqpkitstatus.cpp',
'acqpkitstatus.h',
'apt-cache-file.cpp',
'apt-cache-file.h',
'apt-job.cpp',
'apt-job.h',
'apt-messages.cpp',
'apt-messages.h',
'apt-sourceslist.cpp',
'apt-sourceslist.h',
'apt-utils.cpp',
'apt-utils.h',
'deb822.cpp',
'deb822.h',
'deb-file.cpp',
'deb-file.h',
'gst-matcher.cpp',
'gst-matcher.h',
'pkg-list.cpp',
'pkg-list.h',
include_directories: packagekit_src_include,
dependencies: [
packagekit_glib2_dep,
apt_pkg_dep,
appstream_dep,
gstreamer_dep,
gstreamer_base_dep,
gstreamer_plugins_base_dep,
],
c_args: c_args,
cpp_args: [
c_args,
ddtp_flag,
],
link_args: [
'-lutil',
],
override_options: [
'b_lundef=false',
'c_std=gnu17',
'cpp_std=c++20'
],
)
packagekit_backend_apt_dep = declare_dependency(
link_whole: packagekit_backend_apt_lib,
include_directories: [
packagekit_src_include,
include_directories('.'),
],
dependencies: [
packagekit_glib2_dep,
],
)
packagekit_backend_apt_module = shared_module(
'pk_backend_apt',
'pk-backend-apt.cpp',
include_directories: packagekit_src_include,
dependencies: [
packagekit_glib2_dep,
packagekit_backend_apt_dep,
],
c_args: c_args,
cpp_args: [
c_args,
ddtp_flag,
],
override_options: [
'b_lundef=false',
'c_std=c11',
'cpp_std=c++17'
],
install: true,
install_dir: pk_plugin_dir,
)
install_data(
'20packagekit',
install_dir: join_paths(get_option('sysconfdir'), 'apt', 'apt.conf.d'),
)
install_data(
'pkconffile.nodiff',
install_dir: join_paths(get_option('datadir'), 'PackageKit', 'helpers', 'apt'),
)
if get_option('systemd')
executable(
'pk-debconf-helper',
'pk-debconf-helper.c',
dependencies: [
packagekit_glib2_dep,
libsystemd
],
install: true,
install_dir: get_option('libexecdir')
)
sd_config_data = configuration_data()
sd_config_data.set('libexecdir', join_paths(get_option('prefix'), get_option('libexecdir')))
configure_file(
input: 'pk-debconf-helper.service.in',
output: 'pk-debconf-helper.service',
configuration: sd_config_data,
install: true,
install_dir: systemd_user_unit_dir,
)
configure_file(
input: 'pk-debconf-helper.socket.in',
output: 'pk-debconf-helper.socket',
configuration: sd_config_data,
install: true,
install_dir: systemd_user_unit_dir,
)
endif
subdir('tests')
|