| 1 |
name = '@0@-gobject-@1@'.format(meson.project_name(), pk_api_version) |
| 2 |
|
| 3 |
enum_headers = files( |
| 4 |
'polkitauthorityfeatures.h', |
| 5 |
'polkitcheckauthorizationflags.h', |
| 6 |
'polkiterror.h', |
| 7 |
'polkitimplicitauthorization.h', |
| 8 |
) |
| 9 |
|
| 10 |
headers = enum_headers + files( |
| 11 |
'polkitactiondescription.h', |
| 12 |
'polkitauthority.h', |
| 13 |
'polkitauthorizationresult.h', |
| 14 |
'polkitdetails.h', |
| 15 |
'polkit.h', |
| 16 |
'polkitidentity.h', |
| 17 |
'polkitpermission.h', |
| 18 |
'polkitsubject.h', |
| 19 |
'polkitsystembusname.h', |
| 20 |
'polkittemporaryauthorization.h', |
| 21 |
'polkitunixgroup.h', |
| 22 |
'polkitunixnetgroup.h', |
| 23 |
'polkitunixprocess.h', |
| 24 |
'polkitunixsession.h', |
| 25 |
'polkitunixuser.h', |
| 26 |
) |
| 27 |
|
| 28 |
private_headers = files( |
| 29 |
'polkitprivate.h', |
| 30 |
'polkittypes.h', |
| 31 |
) |
| 32 |
|
| 33 |
install_headers( |
| 34 |
headers + private_headers, |
| 35 |
install_dir: pk_pkgincludedir / 'polkit', |
| 36 |
) |
| 37 |
|
| 38 |
common_deps = [ |
| 39 |
gio_dep, |
| 40 |
gio_unix_dep, |
| 41 |
glib_dep, |
| 42 |
] |
| 43 |
|
| 44 |
enum_sources = gnome.mkenums_simple( |
| 45 |
'polkitenumtypes', |
| 46 |
sources: enum_headers, |
| 47 |
install_header: true, |
| 48 |
install_dir: pk_pkgincludedir / 'polkit', |
| 49 |
) |
| 50 |
|
| 51 |
sources = enum_sources + files( |
| 52 |
'polkitactiondescription.c', |
| 53 |
'polkitauthority.c', |
| 54 |
'polkitauthorityfeatures.c', |
| 55 |
'polkitauthorizationresult.c', |
| 56 |
'polkitcheckauthorizationflags.c', |
| 57 |
'polkitdetails.c', |
| 58 |
'polkiterror.c', |
| 59 |
'polkitidentity.c', |
| 60 |
'polkitimplicitauthorization.c', |
| 61 |
'polkitpermission.c', |
| 62 |
'polkitsubject.c', |
| 63 |
'polkitsystembusname.c', |
| 64 |
'polkittemporaryauthorization.c', |
| 65 |
'polkitunixgroup.c', |
| 66 |
'polkitunixnetgroup.c', |
| 67 |
'polkitunixprocess.c', |
| 68 |
'polkitunixuser.c', |
| 69 |
) |
| 70 |
|
| 71 |
incs = [ |
| 72 |
top_inc, |
| 73 |
src_inc, |
| 74 |
] |
| 75 |
|
| 76 |
deps = common_deps |
| 77 |
|
| 78 |
c_flags = '-D_POLKIT_COMPILATION' |
| 79 |
|
| 80 |
if enable_logind |
| 81 |
sources += 'polkitunixsession-systemd.c' |
| 82 |
|
| 83 |
deps += logind_dep |
| 84 |
else |
| 85 |
sources += 'polkitunixsession.c' |
| 86 |
endif |
| 87 |
|
| 88 |
libpolkit_gobject = shared_library( |
| 89 |
name, |
| 90 |
sources: sources, |
| 91 |
version: libversion, |
| 92 |
include_directories: incs, |
| 93 |
dependencies: deps, |
| 94 |
c_args: c_flags, |
| 95 |
link_args: ldflags, |
| 96 |
link_depends: symbol_map, |
| 97 |
install: true, |
| 98 |
) |
| 99 |
|
| 100 |
libpolkit_gobject_dep = declare_dependency( |
| 101 |
sources: enum_sources[1], |
| 102 |
include_directories: src_inc, |
| 103 |
dependencies: common_deps, |
| 104 |
link_with: libpolkit_gobject, |
| 105 |
) |
| 106 |
|
| 107 |
pkg.generate( |
| 108 |
libraries: libpolkit_gobject, |
| 109 |
version: pk_version, |
| 110 |
name: name, |
| 111 |
description: 'PolicyKit Authorization API', |
| 112 |
filebase: name, |
| 113 |
subdirs: pk_api_name, |
| 114 |
requires: common_deps, |
| 115 |
variables: [ |
| 116 |
'exec_prefix=${prefix}', |
| 117 |
'policydir=' + ('${datadir}' / pk_actiondir), |
| 118 |
'actiondir=' + ('${datadir}' / pk_actiondir), |
| 119 |
'pkcheck_supports_uid=true', |
| 120 |
], |
| 121 |
) |
| 122 |
|
| 123 |
if enable_introspection |
| 124 |
libpolkit_gobject_gir = gnome.generate_gir( |
| 125 |
libpolkit_gobject, |
| 126 |
sources: sources + headers, |
| 127 |
extra_args: c_flags, |
| 128 |
nsversion: pk_gir_version, |
| 129 |
namespace: pk_gir_ns, |
| 130 |
export_packages: name, |
| 131 |
includes: 'Gio-2.0', |
| 132 |
header: 'polkit/polkit.h', |
| 133 |
install: true, |
| 134 |
) |
| 135 |
endif |