summaryrefslogtreecommitdiff
path: root/backends/aptcc/meson.build
blob: 0a9ce8b0dc4cb54db0410268c2c20d30450993f7 (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
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
add_languages('cpp')

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.11')

apt_pkg_dep = cpp_compiler.find_library('apt-pkg')
apt_inst_dep = cpp_compiler.find_library('apt-inst')

if not cpp_compiler.compiles(
  '''
    #include <apt-pkg/pkgsystem.h>
    int main () {
      _system->ArchitecturesSupported();
      return 0;
    }
  ''',
  dependencies: [
    apt_pkg_dep,
    apt_inst_dep
  ]
)
  error ('libapt-pkg 1.1 or later is required')
endif

if not cpp_compiler.compiles(
  '''
    #include <apt-pkg/pkgsystem.h>
    int main () {
      _system->LockInner();
      return 0;
    }
  ''',
  dependencies: [
    apt_pkg_dep,
    apt_inst_dep
  ]
)
  error ('libapt-pkg 1.7 or later is required - or backported frontend locking')
endif

# 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,
    apt_inst_dep
  ]
)
  ddtp_flag = ['-DHAVE_DDTP']
endif

shared_module(
  'pk_backend_aptcc',
  'acqpkitstatus.cpp',
  'acqpkitstatus.h',
  'gst-matcher.cpp',
  'gst-matcher.h',
  'apt-messages.cpp',
  'apt-messages.h',
  'apt-utils.cpp',
  'apt-utils.h',
  'apt-sourceslist.cpp',
  'apt-sourceslist.h',
  'apt-cache-file.cpp',
  'apt-cache-file.h',
  'apt-intf.cpp',
  'apt-intf.h',
  'pkg-list.cpp',
  'pkg-list.h',
  'deb-file.cpp',
  'deb-file.h',
  'pk-backend-aptcc.cpp',
  include_directories: packagekit_src_include,
  dependencies: [
    packagekit_glib2_dep,
    gmodule_dep,
    apt_pkg_dep,
    apt_inst_dep,
    gstreamer_dep,
    gstreamer_base_dep,
    gstreamer_plugins_base_dep,
    appstream_dep,
  ],
  cpp_args: [
    '-DG_LOG_DOMAIN="PackageKit-APTcc"',
    '-DPK_COMPILATION=1',
    '-DDATADIR="@0@"'.format(join_paths(get_option('prefix'), get_option('datadir'))),
    ddtp_flag,
  ],
  link_args: [
    '-lutil',
  ],
  override_options: ['c_std=c11', 'cpp_std=c++11'],
  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', 'aptcc'),
)